1 // Copyright 2008-2009 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
6 #define V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
9 #include "src/regexp/bytecodes-irregexp.h"
14 #ifdef V8_INTERPRETED_REGEXP
16 void RegExpMacroAssemblerIrregexp::Emit(uint32_t byte,
17 uint32_t twenty_four_bits) {
18 uint32_t word = ((twenty_four_bits << BYTECODE_SHIFT) | byte);
19 DCHECK(pc_ <= buffer_.length());
20 if (pc_ + 3 >= buffer_.length()) {
23 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
28 void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) {
29 DCHECK(pc_ <= buffer_.length());
30 if (pc_ + 1 >= buffer_.length()) {
33 *reinterpret_cast<uint16_t*>(buffer_.start() + pc_) = word;
38 void RegExpMacroAssemblerIrregexp::Emit8(uint32_t word) {
39 DCHECK(pc_ <= buffer_.length());
40 if (pc_ == buffer_.length()) {
43 *reinterpret_cast<unsigned char*>(buffer_.start() + pc_) = word;
48 void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) {
49 DCHECK(pc_ <= buffer_.length());
50 if (pc_ + 3 >= buffer_.length()) {
53 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word;
57 #endif // V8_INTERPRETED_REGEXP
59 } // namespace internal
62 #endif // V8_REGEXP_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_