30 #if defined(V8_TARGET_ARCH_IA32)
42 #ifndef V8_INTERPRETED_REGEXP
100 #define __ ACCESS_MASM(masm_)
104 int registers_to_save,
106 : NativeRegExpMacroAssembler(zone),
107 masm_(new MacroAssembler(Isolate::Current(),
NULL, kRegExpCodeSize)),
109 num_registers_(registers_to_save),
110 num_saved_registers_(registers_to_save),
117 __ jmp(&entry_label_);
118 __ bind(&start_label_);
122 RegExpMacroAssemblerIA32::~RegExpMacroAssemblerIA32() {
125 entry_label_.Unuse();
126 start_label_.Unuse();
127 success_label_.Unuse();
128 backtrack_label_.Unuse();
130 check_preempt_label_.Unuse();
131 stack_overflow_label_.Unuse();
135 int RegExpMacroAssemblerIA32::stack_limit_slack() {
136 return RegExpStack::kStackLimitSlack;
140 void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(
int by) {
142 __ add(
edi, Immediate(by * char_size()));
147 void RegExpMacroAssemblerIA32::AdvanceRegister(
int reg,
int by) {
149 ASSERT(reg < num_registers_);
151 __ add(register_location(reg), Immediate(by));
156 void RegExpMacroAssemblerIA32::Backtrack() {
160 __ add(
ebx, Immediate(masm_->CodeObject()));
165 void RegExpMacroAssemblerIA32::Bind(Label* label) {
170 void RegExpMacroAssemblerIA32::CheckCharacter(uint32_t c, Label* on_equal) {
171 __ cmp(current_character(), c);
172 BranchOrBacktrack(
equal, on_equal);
176 void RegExpMacroAssemblerIA32::CheckCharacterGT(
uc16 limit, Label* on_greater) {
177 __ cmp(current_character(), limit);
178 BranchOrBacktrack(
greater, on_greater);
182 void RegExpMacroAssemblerIA32::CheckAtStart(Label* on_at_start) {
185 __ cmp(Operand(
ebp, kStartIndex), Immediate(0));
186 BranchOrBacktrack(
not_equal, ¬_at_start);
189 __ cmp(
eax, Operand(
ebp, kInputStart));
190 BranchOrBacktrack(
equal, on_at_start);
191 __ bind(¬_at_start);
195 void RegExpMacroAssemblerIA32::CheckNotAtStart(Label* on_not_at_start) {
197 __ cmp(Operand(
ebp, kStartIndex), Immediate(0));
198 BranchOrBacktrack(
not_equal, on_not_at_start);
201 __ cmp(
eax, Operand(
ebp, kInputStart));
202 BranchOrBacktrack(
not_equal, on_not_at_start);
206 void RegExpMacroAssemblerIA32::CheckCharacterLT(
uc16 limit, Label* on_less) {
207 __ cmp(current_character(), limit);
208 BranchOrBacktrack(
less, on_less);
212 void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str,
215 bool check_end_of_string) {
219 if (mode_ == ASCII) {
220 ASSERT(String::IsAscii(str.start(), str.length()));
223 int byte_length = str.length() * char_size();
224 int byte_offset = cp_offset * char_size();
225 if (check_end_of_string) {
227 __ cmp(
edi, Immediate(-(byte_offset + byte_length)));
228 BranchOrBacktrack(
greater, on_failure);
231 if (on_failure ==
NULL) {
233 on_failure = &backtrack_label_;
241 if (mode_ == ASCII) {
243 static_cast<int8_t>(str[0]));
249 __ cmp(
eax, static_cast<int32_t>(str[0]));
251 BranchOrBacktrack(
not_equal, on_failure);
254 for (
int i = 1, n = str.length(); i < n;) {
255 if (mode_ == ASCII) {
258 (
static_cast<uint32_t
>(str[i + 0]) << 0) |
259 (
static_cast<uint32_t
>(str[i + 1]) << 8) |
260 (
static_cast<uint32_t
>(str[i + 2]) << 16) |
261 (
static_cast<uint32_t
>(str[i + 3]) << 24);
262 __ cmp(Operand(
ebx, byte_offset + i), Immediate(combined_chars));
265 __ cmpb(Operand(
ebx, byte_offset + i),
266 static_cast<int8_t>(str[i]));
272 __ cmp(Operand(
ebx, byte_offset + i *
sizeof(
uc16)),
273 Immediate(*reinterpret_cast<const int*>(&str[i])));
282 Operand(
ebx, byte_offset + i *
sizeof(
uc16)));
283 __ cmp(
eax, static_cast<int32_t>(str[i]));
287 BranchOrBacktrack(
not_equal, on_failure);
292 void RegExpMacroAssemblerIA32::CheckGreedyLoop(Label* on_equal) {
294 __ cmp(
edi, Operand(backtrack_stackpointer(), 0));
298 __ bind(&fallthrough);
302 void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
304 Label* on_no_match) {
306 __ mov(
edx, register_location(start_reg));
307 __ mov(
ebx, register_location(start_reg + 1));
313 BranchOrBacktrack(
less, on_no_match);
322 BranchOrBacktrack(
greater, on_no_match);
324 if (mode_ == ASCII) {
327 Label loop_increment;
330 __ push(backtrack_stackpointer());
340 __ cmpb_al(Operand(
edx, 0));
346 __ cmp(
ecx, static_cast<int32_t>(
'z' -
'a'));
355 __ bind(&loop_increment);
357 __ add(
edx, Immediate(1));
358 __ add(
edi, Immediate(1));
366 __ pop(backtrack_stackpointer());
372 __ pop(backtrack_stackpointer());
382 __ push(backtrack_stackpointer());
385 static const int argument_count = 4;
386 __ PrepareCallCFunction(argument_count,
ecx);
396 Immediate(ExternalReference::isolate_address()));
410 AllowExternalCallThatCantCauseGC scope(masm_);
411 ExternalReference compare =
412 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
413 __ CallCFunction(compare, argument_count);
417 __ pop(backtrack_stackpointer());
423 BranchOrBacktrack(
zero, on_no_match);
427 __ bind(&fallthrough);
431 void RegExpMacroAssemblerIA32::CheckNotBackReference(
433 Label* on_no_match) {
439 __ mov(
edx, register_location(start_reg));
440 __ mov(
eax, register_location(start_reg + 1));
443 BranchOrBacktrack(
less, on_no_match);
450 BranchOrBacktrack(
greater, on_no_match);
453 __ push(backtrack_stackpointer());
462 if (mode_ == ASCII) {
464 __ cmpb_al(Operand(
ebx, 0));
468 __ cmpw_ax(Operand(
ebx, 0));
472 __ add(
edx, Immediate(char_size()));
473 __ add(
ebx, Immediate(char_size()));
481 __ pop(backtrack_stackpointer());
489 __ pop(backtrack_stackpointer());
491 __ bind(&fallthrough);
495 void RegExpMacroAssemblerIA32::CheckNotCharacter(uint32_t c,
496 Label* on_not_equal) {
497 __ cmp(current_character(), c);
498 BranchOrBacktrack(
not_equal, on_not_equal);
502 void RegExpMacroAssemblerIA32::CheckCharacterAfterAnd(uint32_t c,
506 __ test(current_character(), Immediate(mask));
509 __ and_(
eax, current_character());
512 BranchOrBacktrack(
equal, on_equal);
516 void RegExpMacroAssemblerIA32::CheckNotCharacterAfterAnd(uint32_t c,
518 Label* on_not_equal) {
520 __ test(current_character(), Immediate(mask));
523 __ and_(
eax, current_character());
526 BranchOrBacktrack(
not_equal, on_not_equal);
530 void RegExpMacroAssemblerIA32::CheckNotCharacterAfterMinusAnd(
534 Label* on_not_equal) {
535 ASSERT(minus < String::kMaxUtf16CodeUnit);
536 __ lea(
eax, Operand(current_character(), -minus));
538 __ test(
eax, Immediate(mask));
543 BranchOrBacktrack(
not_equal, on_not_equal);
547 void RegExpMacroAssemblerIA32::CheckCharacterInRange(
550 Label* on_in_range) {
551 __ lea(
eax, Operand(current_character(), -from));
552 __ cmp(
eax, to - from);
557 void RegExpMacroAssemblerIA32::CheckCharacterNotInRange(
560 Label* on_not_in_range) {
561 __ lea(
eax, Operand(current_character(), -from));
562 __ cmp(
eax, to - from);
563 BranchOrBacktrack(
above, on_not_in_range);
567 void RegExpMacroAssemblerIA32::CheckBitInTable(
568 Handle<ByteArray> table,
570 __ mov(
eax, Immediate(table));
571 Register index = current_character();
573 __ mov(
ebx, kTableSize - 1);
574 __ and_(
ebx, current_character());
578 BranchOrBacktrack(
not_equal, on_bit_set);
582 bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(
uc16 type,
583 Label* on_no_match) {
589 if (mode_ == ASCII) {
592 __ cmp(current_character(),
' ');
595 __ lea(
eax, Operand(current_character(), -
'\t'));
596 __ cmp(
eax,
'\r' -
'\t');
597 BranchOrBacktrack(
above, on_no_match);
604 if (mode_ == ASCII) {
606 __ cmp(current_character(),
' ');
607 BranchOrBacktrack(
equal, on_no_match);
608 __ lea(
eax, Operand(current_character(), -
'\t'));
609 __ cmp(
eax,
'\r' -
'\t');
616 __ lea(
eax, Operand(current_character(), -
'0'));
617 __ cmp(
eax,
'9' -
'0');
618 BranchOrBacktrack(
above, on_no_match);
622 __ lea(
eax, Operand(current_character(), -
'0'));
623 __ cmp(
eax,
'9' -
'0');
628 __ mov(
eax, current_character());
629 __ xor_(
eax, Immediate(0x01));
631 __ sub(
eax, Immediate(0x0b));
632 __ cmp(
eax, 0x0c - 0x0b);
638 __ sub(
eax, Immediate(0x2028 - 0x0b));
639 __ cmp(
eax, 0x2029 - 0x2028);
645 if (mode_ != ASCII) {
647 __ cmp(current_character(), Immediate(
'z'));
648 BranchOrBacktrack(
above, on_no_match);
651 ExternalReference word_map = ExternalReference::re_word_character_map();
652 __ test_b(current_character(),
653 Operand::StaticArray(current_character(),
times_1, word_map));
654 BranchOrBacktrack(
zero, on_no_match);
659 if (mode_ != ASCII) {
661 __ cmp(current_character(), Immediate(
'z'));
665 ExternalReference word_map = ExternalReference::re_word_character_map();
666 __ test_b(current_character(),
667 Operand::StaticArray(current_character(),
times_1, word_map));
668 BranchOrBacktrack(
not_zero, on_no_match);
669 if (mode_ != ASCII) {
681 __ mov(
eax, current_character());
682 __ xor_(
eax, Immediate(0x01));
684 __ sub(
eax, Immediate(0x0b));
685 __ cmp(
eax, 0x0c - 0x0b);
686 if (mode_ == ASCII) {
687 BranchOrBacktrack(
above, on_no_match);
695 __ sub(
eax, Immediate(0x2028 - 0x0b));
697 BranchOrBacktrack(
above, on_no_match);
712 __ Set(
eax, Immediate(FAILURE));
714 __ jmp(&exit_label_);
718 Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
724 __ bind(&entry_label_);
728 FrameScope scope(masm_, StackFrame::MANUAL);
738 __ push(Immediate(0));
739 __ push(Immediate(0));
742 Label stack_limit_hit;
745 ExternalReference stack_limit =
746 ExternalReference::address_of_stack_limit(masm_->isolate());
748 __ sub(
ecx, Operand::StaticVariable(stack_limit));
757 __ mov(
eax, EXCEPTION);
760 __ bind(&stack_limit_hit);
761 CallCheckStackGuardState(
ebx);
768 __ mov(
ebx, Operand(
ebp, kStartIndex));
773 __ mov(
esi, Operand(
ebp, kInputEnd));
775 __ mov(
edi, Operand(
ebp, kInputStart));
789 __ mov(Operand(
ebp, kInputStartMinusOne),
eax);
794 const int kPageSize = 4096;
796 for (
int i = num_saved_registers_ + kRegistersPerPage - 1;
798 i += kRegistersPerPage) {
799 __ mov(register_location(i),
eax);
803 Label load_char_start_regexp, start_regexp;
805 __ cmp(Operand(
ebp, kStartIndex), Immediate(0));
806 __ j(
not_equal, &load_char_start_regexp, Label::kNear);
807 __ mov(current_character(),
'\n');
808 __ jmp(&start_regexp, Label::kNear);
811 __ bind(&load_char_start_regexp);
813 LoadCurrentCharacterUnchecked(-1, 1);
814 __ bind(&start_regexp);
817 if (num_saved_registers_ > 0) {
821 if (num_saved_registers_ > 8) {
822 __ mov(
ecx, kRegisterZero);
830 for (
int i = 0; i < num_saved_registers_; i++) {
831 __ mov(register_location(i),
eax);
837 __ mov(backtrack_stackpointer(), Operand(
ebp, kStackHighEnd));
839 __ jmp(&start_label_);
842 if (success_label_.is_linked()) {
844 __ bind(&success_label_);
845 if (num_saved_registers_ > 0) {
847 __ mov(
ebx, Operand(
ebp, kRegisterOutput));
848 __ mov(
ecx, Operand(
ebp, kInputEnd));
849 __ mov(
edx, Operand(
ebp, kStartIndex));
850 __ sub(
ecx, Operand(
ebp, kInputStart));
856 for (
int i = 0; i < num_saved_registers_; i++) {
857 __ mov(
eax, register_location(i));
858 if (i == 0 && global_with_zero_length_check()) {
874 __ inc(Operand(
ebp, kSuccessfulCaptures));
877 __ mov(
ecx, Operand(
ebp, kNumOutputRegisters));
878 __ sub(
ecx, Immediate(num_saved_registers_));
880 __ cmp(
ecx, Immediate(num_saved_registers_));
883 __ mov(Operand(
ebp, kNumOutputRegisters),
ecx);
885 __ add(Operand(
ebp, kRegisterOutput),
889 __ mov(
eax, Operand(
ebp, kInputStartMinusOne));
891 if (global_with_zero_length_check()) {
899 __ j(
zero, &exit_label_, Label::kNear);
902 __ add(
edi, Immediate(2));
908 __ jmp(&load_char_start_regexp);
910 __ mov(
eax, Immediate(SUCCESS));
914 __ bind(&exit_label_);
917 __ mov(
eax, Operand(
ebp, kSuccessfulCaptures));
920 __ bind(&return_eax);
922 __ lea(
esp, Operand(
ebp, kBackup_ebx));
932 if (backtrack_label_.is_linked()) {
933 __ bind(&backtrack_label_);
937 Label exit_with_exception;
940 if (check_preempt_label_.is_linked()) {
941 SafeCallTarget(&check_preempt_label_);
943 __ push(backtrack_stackpointer());
946 CallCheckStackGuardState(
ebx);
953 __ pop(backtrack_stackpointer());
955 __ mov(
esi, Operand(
ebp, kInputEnd));
960 if (stack_overflow_label_.is_linked()) {
961 SafeCallTarget(&stack_overflow_label_);
970 static const int num_arguments = 3;
971 __ PrepareCallCFunction(num_arguments,
ebx);
973 Immediate(ExternalReference::isolate_address()));
974 __ lea(
eax, Operand(
ebp, kStackHighEnd));
977 ExternalReference grow_stack =
978 ExternalReference::re_grow_stack(masm_->isolate());
979 __ CallCFunction(grow_stack, num_arguments);
983 __ j(
equal, &exit_with_exception);
985 __ mov(backtrack_stackpointer(),
eax);
992 if (exit_with_exception.is_linked()) {
994 __ bind(&exit_with_exception);
996 __ mov(
eax, EXCEPTION);
1001 masm_->GetCode(&code_desc);
1003 masm_->isolate()->factory()->NewCode(code_desc,
1004 Code::ComputeFlags(Code::REGEXP),
1005 masm_->CodeObject());
1006 PROFILE(masm_->isolate(), RegExpCodeCreateEvent(*code, *source));
1007 return Handle<HeapObject>::cast(code);
1011 void RegExpMacroAssemblerIA32::GoTo(Label* to) {
1016 void RegExpMacroAssemblerIA32::IfRegisterGE(
int reg,
1019 __ cmp(register_location(reg), Immediate(comparand));
1024 void RegExpMacroAssemblerIA32::IfRegisterLT(
int reg,
1027 __ cmp(register_location(reg), Immediate(comparand));
1028 BranchOrBacktrack(
less, if_lt);
1032 void RegExpMacroAssemblerIA32::IfRegisterEqPos(
int reg,
1034 __ cmp(
edi, register_location(reg));
1035 BranchOrBacktrack(
equal, if_eq);
1039 RegExpMacroAssembler::IrregexpImplementation
1040 RegExpMacroAssemblerIA32::Implementation() {
1041 return kIA32Implementation;
1045 void RegExpMacroAssemblerIA32::LoadCurrentCharacter(
int cp_offset,
1046 Label* on_end_of_input,
1050 ASSERT(cp_offset < (1<<30));
1052 CheckPosition(cp_offset + characters - 1, on_end_of_input);
1054 LoadCurrentCharacterUnchecked(cp_offset, characters);
1058 void RegExpMacroAssemblerIA32::PopCurrentPosition() {
1063 void RegExpMacroAssemblerIA32::PopRegister(
int register_index) {
1065 __ mov(register_location(register_index),
eax);
1069 void RegExpMacroAssemblerIA32::PushBacktrack(Label* label) {
1070 Push(Immediate::CodeRelativeOffset(label));
1075 void RegExpMacroAssemblerIA32::PushCurrentPosition() {
1080 void RegExpMacroAssemblerIA32::PushRegister(
int register_index,
1081 StackCheckFlag check_stack_limit) {
1082 __ mov(
eax, register_location(register_index));
1084 if (check_stack_limit) CheckStackLimit();
1088 void RegExpMacroAssemblerIA32::ReadCurrentPositionFromRegister(
int reg) {
1089 __ mov(
edi, register_location(reg));
1093 void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(
int reg) {
1094 __ mov(backtrack_stackpointer(), register_location(reg));
1095 __ add(backtrack_stackpointer(), Operand(
ebp, kStackHighEnd));
1098 void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(
int by) {
1099 Label after_position;
1100 __ cmp(
edi, -by * char_size());
1102 __ mov(
edi, -by * char_size());
1106 LoadCurrentCharacterUnchecked(-1, 1);
1107 __ bind(&after_position);
1110 void RegExpMacroAssemblerIA32::SetRegister(
int register_index,
int to) {
1111 ASSERT(register_index >= num_saved_registers_);
1112 __ mov(register_location(register_index), Immediate(to));
1116 bool RegExpMacroAssemblerIA32::Succeed() {
1117 __ jmp(&success_label_);
1122 void RegExpMacroAssemblerIA32::WriteCurrentPositionToRegister(
int reg,
1124 if (cp_offset == 0) {
1125 __ mov(register_location(reg),
edi);
1127 __ lea(
eax, Operand(
edi, cp_offset * char_size()));
1128 __ mov(register_location(reg),
eax);
1133 void RegExpMacroAssemblerIA32::ClearRegisters(
int reg_from,
int reg_to) {
1134 ASSERT(reg_from <= reg_to);
1135 __ mov(
eax, Operand(
ebp, kInputStartMinusOne));
1136 for (
int reg = reg_from; reg <= reg_to; reg++) {
1137 __ mov(register_location(reg),
eax);
1142 void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(
int reg) {
1143 __ mov(
eax, backtrack_stackpointer());
1144 __ sub(
eax, Operand(
ebp, kStackHighEnd));
1145 __ mov(register_location(reg),
eax);
1151 void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) {
1152 static const int num_arguments = 3;
1153 __ PrepareCallCFunction(num_arguments, scratch);
1161 ExternalReference check_stack_guard =
1162 ExternalReference::re_check_stack_guard_state(masm_->isolate());
1163 __ CallCFunction(check_stack_guard, num_arguments);
1168 template <
typename T>
1169 static T& frame_entry(
Address re_frame,
int frame_offset) {
1170 return reinterpret_cast<T&
>(Memory::int32_at(re_frame + frame_offset));
1174 int RegExpMacroAssemblerIA32::CheckStackGuardState(
Address* return_address,
1177 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
1178 ASSERT(isolate == Isolate::Current());
1179 if (isolate->stack_guard()->IsStackOverflow()) {
1180 isolate->StackOverflow();
1189 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1194 HandleScope handles(isolate);
1195 Handle<Code> code_handle(re_code);
1197 Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1200 bool is_ascii = subject->IsAsciiRepresentationUnderneath();
1202 ASSERT(re_code->instruction_start() <= *return_address);
1203 ASSERT(*return_address <=
1204 re_code->instruction_start() + re_code->instruction_size());
1206 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate);
1208 if (*code_handle != re_code) {
1209 int delta = code_handle->address() - re_code->address();
1211 *return_address += delta;
1214 if (result->IsException()) {
1218 Handle<String> subject_tmp = subject;
1219 int slice_offset = 0;
1222 if (StringShape(*subject_tmp).IsCons()) {
1223 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
1224 }
else if (StringShape(*subject_tmp).IsSliced()) {
1225 SlicedString* slice = SlicedString::cast(*subject_tmp);
1226 subject_tmp = Handle<String>(slice->parent());
1227 slice_offset = slice->offset();
1231 if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
1242 ASSERT(StringShape(*subject_tmp).IsSequential() ||
1243 StringShape(*subject_tmp).IsExternal());
1246 const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
1250 int start_index = frame_entry<int>(re_frame, kStartIndex);
1251 const byte* new_address = StringCharacterPosition(*subject_tmp,
1252 start_index + slice_offset);
1254 if (start_address != new_address) {
1257 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd);
1258 int byte_length =
static_cast<int>(end_address - start_address);
1259 frame_entry<const String*>(re_frame, kInputString) = *subject;
1260 frame_entry<const byte*>(re_frame, kInputStart) = new_address;
1261 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
1262 }
else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
1266 frame_entry<const String*>(re_frame, kInputString) = *subject;
1273 Operand RegExpMacroAssemblerIA32::register_location(
int register_index) {
1274 ASSERT(register_index < (1<<30));
1275 if (num_registers_ <= register_index) {
1276 num_registers_ = register_index + 1;
1282 void RegExpMacroAssemblerIA32::CheckPosition(
int cp_offset,
1283 Label* on_outside_input) {
1284 __ cmp(
edi, -cp_offset * char_size());
1289 void RegExpMacroAssemblerIA32::BranchOrBacktrack(
Condition condition,
1291 if (condition < 0) {
1300 __ j(condition, &backtrack_label_);
1303 __ j(condition, to);
1307 void RegExpMacroAssemblerIA32::SafeCall(Label* to) {
1309 __ push(Immediate::CodeRelativeOffset(&return_to));
1311 __ bind(&return_to);
1315 void RegExpMacroAssemblerIA32::SafeReturn() {
1317 __ add(
ebx, Immediate(masm_->CodeObject()));
1322 void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) {
1327 void RegExpMacroAssemblerIA32::Push(Register source) {
1328 ASSERT(!source.is(backtrack_stackpointer()));
1331 __ mov(Operand(backtrack_stackpointer(), 0), source);
1335 void RegExpMacroAssemblerIA32::Push(Immediate value) {
1338 __ mov(Operand(backtrack_stackpointer(), 0), value);
1342 void RegExpMacroAssemblerIA32::Pop(Register target) {
1343 ASSERT(!target.is(backtrack_stackpointer()));
1344 __ mov(target, Operand(backtrack_stackpointer(), 0));
1350 void RegExpMacroAssemblerIA32::CheckPreemption() {
1353 ExternalReference stack_limit =
1354 ExternalReference::address_of_stack_limit(masm_->isolate());
1355 __ cmp(
esp, Operand::StaticVariable(stack_limit));
1358 SafeCall(&check_preempt_label_);
1360 __ bind(&no_preempt);
1364 void RegExpMacroAssemblerIA32::CheckStackLimit() {
1365 Label no_stack_overflow;
1366 ExternalReference stack_limit =
1367 ExternalReference::address_of_regexp_stack_limit(masm_->isolate());
1368 __ cmp(backtrack_stackpointer(), Operand::StaticVariable(stack_limit));
1369 __ j(
above, &no_stack_overflow);
1371 SafeCall(&stack_overflow_label_);
1373 __ bind(&no_stack_overflow);
1377 void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(
int cp_offset,
1379 if (mode_ == ASCII) {
1380 if (characters == 4) {
1382 }
else if (characters == 2) {
1383 __ movzx_w(current_character(), Operand(
esi,
edi,
times_1, cp_offset));
1386 __ movzx_b(current_character(), Operand(
esi,
edi,
times_1, cp_offset));
1390 if (characters == 2) {
1391 __ mov(current_character(),
1395 __ movzx_w(current_character(),
1404 #endif // V8_INTERPRETED_REGEXP
1408 #endif // V8_TARGET_ARCH_IA32
v8::Handle< v8::Value > Fail(const v8::Arguments &args)
#define ASSERT(condition)
#define PROFILE(isolate, Call)
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save, Zone *zone)
Operand FieldOperand(Register object, int offset)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
#define T(name, string, precedence)
#define ASSERT_EQ(v1, v2)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
#define STATIC_ASSERT(test)
const uc32 kMaxAsciiCharCode