22 #ifndef V8_INTERPRETED_REGEXP
97 #define __ ACCESS_MASM(masm_)
101 int registers_to_save,
103 : NativeRegExpMacroAssembler(zone),
104 masm_(new MacroAssembler(zone->isolate(),
NULL, kRegExpCodeSize)),
106 num_registers_(registers_to_save),
107 num_saved_registers_(registers_to_save),
114 __ jmp(&entry_label_);
115 __ bind(&start_label_);
119 RegExpMacroAssemblerARM::~RegExpMacroAssemblerARM() {
122 entry_label_.Unuse();
123 start_label_.Unuse();
124 success_label_.Unuse();
125 backtrack_label_.Unuse();
127 check_preempt_label_.Unuse();
128 stack_overflow_label_.Unuse();
132 int RegExpMacroAssemblerARM::stack_limit_slack() {
133 return RegExpStack::kStackLimitSlack;
137 void RegExpMacroAssemblerARM::AdvanceCurrentPosition(
int by) {
139 __ add(current_input_offset(),
140 current_input_offset(), Operand(by * char_size()));
145 void RegExpMacroAssemblerARM::AdvanceRegister(
int reg,
int by) {
147 DCHECK(reg < num_registers_);
149 __ ldr(
r0, register_location(reg));
150 __ add(
r0,
r0, Operand(by));
151 __ str(
r0, register_location(reg));
156 void RegExpMacroAssemblerARM::Backtrack() {
160 __ add(
pc,
r0, Operand(code_pointer()));
164 void RegExpMacroAssemblerARM::Bind(Label* label) {
169 void RegExpMacroAssemblerARM::CheckCharacter(
uint32_t c, Label* on_equal) {
170 __ cmp(current_character(), Operand(c));
171 BranchOrBacktrack(
eq, on_equal);
175 void RegExpMacroAssemblerARM::CheckCharacterGT(
uc16 limit, Label* on_greater) {
176 __ cmp(current_character(), Operand(limit));
177 BranchOrBacktrack(
gt, on_greater);
181 void RegExpMacroAssemblerARM::CheckAtStart(Label* on_at_start) {
185 __ cmp(
r0, Operand::Zero());
186 BranchOrBacktrack(
ne, ¬_at_start);
190 __ add(
r0, end_of_input_address(), Operand(current_input_offset()));
192 BranchOrBacktrack(
eq, on_at_start);
193 __ bind(¬_at_start);
197 void RegExpMacroAssemblerARM::CheckNotAtStart(Label* on_not_at_start) {
200 __ cmp(
r0, Operand::Zero());
201 BranchOrBacktrack(
ne, on_not_at_start);
204 __ add(
r0, end_of_input_address(), Operand(current_input_offset()));
206 BranchOrBacktrack(
ne, on_not_at_start);
210 void RegExpMacroAssemblerARM::CheckCharacterLT(
uc16 limit, Label* on_less) {
211 __ cmp(current_character(), Operand(limit));
212 BranchOrBacktrack(
lt, on_less);
216 void RegExpMacroAssemblerARM::CheckGreedyLoop(Label* on_equal) {
218 __ cmp(current_input_offset(),
r0);
219 __ add(backtrack_stackpointer(),
221 BranchOrBacktrack(
eq, on_equal);
225 void RegExpMacroAssemblerARM::CheckNotBackReferenceIgnoreCase(
227 Label* on_no_match) {
229 __ ldr(
r0, register_location(start_reg));
230 __ ldr(
r1, register_location(start_reg + 1));
235 __ b(
eq, &fallthrough);
238 __ cmn(
r1, Operand(current_input_offset()));
239 BranchOrBacktrack(
gt, on_no_match);
241 if (mode_ == LATIN1) {
248 __ add(
r0,
r0, Operand(end_of_input_address()));
249 __ add(
r2, end_of_input_address(), Operand(current_input_offset()));
261 __ b(
eq, &loop_check);
264 __ orr(
r3,
r3, Operand(0x20));
265 __ orr(
r4,
r4, Operand(0x20));
268 __ sub(
r3,
r3, Operand(
'a'));
269 __ cmp(
r3, Operand(
'z' -
'a'));
270 __ b(
ls, &loop_check);
272 __ sub(
r3,
r3, Operand(224 -
'a'));
273 __ cmp(
r3, Operand(254 - 224));
275 __ cmp(
r3, Operand(247 - 224));
278 __ bind(&loop_check);
284 BranchOrBacktrack(
al, on_no_match);
288 __ sub(current_input_offset(),
r2, end_of_input_address());
291 int argument_count = 4;
292 __ PrepareCallCFunction(argument_count,
r2);
305 __ add(
r0,
r0, Operand(end_of_input_address()));
311 __ add(
r1, current_input_offset(), Operand(end_of_input_address()));
313 __ mov(
r3, Operand(ExternalReference::isolate_address(isolate())));
316 AllowExternalCallThatCantCauseGC scope(masm_);
317 ExternalReference
function =
318 ExternalReference::re_case_insensitive_compare_uc16(isolate());
319 __ CallCFunction(
function, argument_count);
323 __ cmp(
r0, Operand::Zero());
324 BranchOrBacktrack(
eq, on_no_match);
326 __ add(current_input_offset(), current_input_offset(), Operand(
r4));
329 __ bind(&fallthrough);
333 void RegExpMacroAssemblerARM::CheckNotBackReference(
335 Label* on_no_match) {
340 __ ldr(
r0, register_location(start_reg));
341 __ ldr(
r1, register_location(start_reg + 1));
344 __ b(
eq, &fallthrough);
347 __ cmn(
r1, Operand(current_input_offset()));
348 BranchOrBacktrack(
gt, on_no_match);
351 __ add(
r0,
r0, Operand(end_of_input_address()));
352 __ add(
r2, end_of_input_address(), Operand(current_input_offset()));
357 if (mode_ == LATIN1) {
366 BranchOrBacktrack(
ne, on_no_match);
371 __ sub(current_input_offset(),
r2, end_of_input_address());
372 __ bind(&fallthrough);
376 void RegExpMacroAssemblerARM::CheckNotCharacter(
unsigned c,
377 Label* on_not_equal) {
378 __ cmp(current_character(), Operand(c));
379 BranchOrBacktrack(
ne, on_not_equal);
383 void RegExpMacroAssemblerARM::CheckCharacterAfterAnd(
uint32_t c,
387 __ tst(current_character(), Operand(mask));
389 __ and_(
r0, current_character(), Operand(mask));
390 __ cmp(
r0, Operand(c));
392 BranchOrBacktrack(
eq, on_equal);
396 void RegExpMacroAssemblerARM::CheckNotCharacterAfterAnd(
unsigned c,
398 Label* on_not_equal) {
400 __ tst(current_character(), Operand(mask));
402 __ and_(
r0, current_character(), Operand(mask));
403 __ cmp(
r0, Operand(c));
405 BranchOrBacktrack(
ne, on_not_equal);
409 void RegExpMacroAssemblerARM::CheckNotCharacterAfterMinusAnd(
413 Label* on_not_equal) {
414 DCHECK(minus < String::kMaxUtf16CodeUnit);
415 __ sub(
r0, current_character(), Operand(minus));
416 __ and_(
r0,
r0, Operand(mask));
417 __ cmp(
r0, Operand(c));
418 BranchOrBacktrack(
ne, on_not_equal);
422 void RegExpMacroAssemblerARM::CheckCharacterInRange(
425 Label* on_in_range) {
426 __ sub(
r0, current_character(), Operand(from));
427 __ cmp(
r0, Operand(
to - from));
428 BranchOrBacktrack(
ls, on_in_range);
432 void RegExpMacroAssemblerARM::CheckCharacterNotInRange(
435 Label* on_not_in_range) {
436 __ sub(
r0, current_character(), Operand(from));
437 __ cmp(
r0, Operand(
to - from));
438 BranchOrBacktrack(
hi, on_not_in_range);
442 void RegExpMacroAssemblerARM::CheckBitInTable(
443 Handle<ByteArray> table,
445 __ mov(
r0, Operand(table));
446 if (mode_ != LATIN1 || kTableMask != String::kMaxOneByteCharCode) {
447 __ and_(
r1, current_character(), Operand(kTableSize - 1));
455 __ cmp(
r0, Operand::Zero());
456 BranchOrBacktrack(
ne, on_bit_set);
460 bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(
uc16 type,
461 Label* on_no_match) {
467 if (mode_ == LATIN1) {
470 __ cmp(current_character(), Operand(
' '));
473 __ sub(
r0, current_character(), Operand(
'\t'));
474 __ cmp(
r0, Operand(
'\r' -
'\t'));
477 __ cmp(
r0, Operand(0x00a0 -
'\t'));
478 BranchOrBacktrack(
ne, on_no_match);
488 __ sub(
r0, current_character(), Operand(
'0'));
489 __ cmp(
r0, Operand(
'9' -
'0'));
490 BranchOrBacktrack(
hi, on_no_match);
494 __ sub(
r0, current_character(), Operand(
'0'));
495 __ cmp(
r0, Operand(
'9' -
'0'));
496 BranchOrBacktrack(
ls, on_no_match);
500 __ eor(
r0, current_character(), Operand(0x01));
502 __ sub(
r0,
r0, Operand(0x0b));
503 __ cmp(
r0, Operand(0x0c - 0x0b));
504 BranchOrBacktrack(
ls, on_no_match);
509 __ sub(
r0,
r0, Operand(0x2028 - 0x0b));
510 __ cmp(
r0, Operand(1));
511 BranchOrBacktrack(
ls, on_no_match);
517 __ eor(
r0, current_character(), Operand(0x01));
519 __ sub(
r0,
r0, Operand(0x0b));
520 __ cmp(
r0, Operand(0x0c - 0x0b));
521 if (mode_ == LATIN1) {
522 BranchOrBacktrack(
hi, on_no_match);
529 __ sub(
r0,
r0, Operand(0x2028 - 0x0b));
530 __ cmp(
r0, Operand(1));
531 BranchOrBacktrack(
hi, on_no_match);
537 if (mode_ != LATIN1) {
539 __ cmp(current_character(), Operand(
'z'));
540 BranchOrBacktrack(
hi, on_no_match);
542 ExternalReference
map = ExternalReference::re_word_character_map();
545 __ cmp(
r0, Operand::Zero());
546 BranchOrBacktrack(
eq, on_no_match);
551 if (mode_ != LATIN1) {
553 __ cmp(current_character(), Operand(
'z'));
556 ExternalReference
map = ExternalReference::re_word_character_map();
559 __ cmp(
r0, Operand::Zero());
560 BranchOrBacktrack(
ne, on_no_match);
561 if (mode_ != LATIN1) {
576 void RegExpMacroAssemblerARM::Fail() {
577 __ mov(
r0, Operand(FAILURE));
578 __ jmp(&exit_label_);
582 Handle<HeapObject> RegExpMacroAssemblerARM::GetCode(Handle<String> source) {
588 __ bind(&entry_label_);
592 FrameScope scope(masm_, StackFrame::MANUAL);
603 __ stm(
db_w,
sp, argument_registers | registers_to_retain |
lr.
bit());
607 __ mov(
r0, Operand::Zero());
611 Label stack_limit_hit;
614 ExternalReference stack_limit =
615 ExternalReference::address_of_stack_limit(isolate());
616 __ mov(
r0, Operand(stack_limit));
620 __ b(
ls, &stack_limit_hit);
627 __ mov(
r0, Operand(EXCEPTION));
630 __ bind(&stack_limit_hit);
631 CallCheckStackGuardState(
r0);
632 __ cmp(
r0, Operand::Zero());
634 __ b(
ne, &return_r0);
641 __ ldr(end_of_input_address(),
MemOperand(frame_pointer(), kInputEnd));
645 __ sub(current_input_offset(),
r0, end_of_input_address());
649 __ sub(
r0, current_input_offset(), Operand(char_size()));
650 __ sub(
r0,
r0, Operand(
r1,
LSL, (mode_ == UC16) ? 1 : 0));
656 __ mov(code_pointer(), Operand(masm_->CodeObject()));
658 Label load_char_start_regexp, start_regexp;
660 __ cmp(
r1, Operand::Zero());
661 __ b(
ne, &load_char_start_regexp);
662 __ mov(current_character(), Operand(
'\n'),
LeaveCC,
eq);
663 __ jmp(&start_regexp);
666 __ bind(&load_char_start_regexp);
668 LoadCurrentCharacterUnchecked(-1, 1);
669 __ bind(&start_regexp);
672 if (num_saved_registers_ > 0) {
674 if (num_saved_registers_ > 8) {
676 __ add(
r1, frame_pointer(), Operand(kRegisterZero));
677 __ mov(
r2, Operand(num_saved_registers_));
682 __ b(
ne, &init_loop);
684 for (
int i = 0;
i < num_saved_registers_;
i++) {
685 __ str(
r0, register_location(
i));
691 __ ldr(backtrack_stackpointer(),
MemOperand(frame_pointer(), kStackHighEnd));
693 __ jmp(&start_label_);
696 if (success_label_.is_linked()) {
698 __ bind(&success_label_);
699 if (num_saved_registers_ > 0) {
704 __ sub(
r1, end_of_input_address(),
r1);
717 for (
int i = 0;
i < num_saved_registers_;
i += 2) {
718 __ ldr(
r2, register_location(
i));
719 __ ldr(
r3, register_location(
i + 1));
720 if (
i == 0 && global_with_zero_length_check()) {
742 __ add(
r0,
r0, Operand(1));
746 __ sub(
r1,
r1, Operand(num_saved_registers_));
748 __ cmp(
r1, Operand(num_saved_registers_));
749 __ b(
lt, &return_r0);
759 if (global_with_zero_length_check()) {
762 __ cmp(current_input_offset(),
r4);
764 __ b(
ne, &load_char_start_regexp);
766 __ cmp(current_input_offset(), Operand::Zero());
767 __ b(
eq, &exit_label_);
769 __ add(current_input_offset(),
770 current_input_offset(),
771 Operand((mode_ == UC16) ? 2 : 1));
774 __ b(&load_char_start_regexp);
776 __ mov(
r0, Operand(SUCCESS));
781 __ bind(&exit_label_);
788 __ mov(
sp, frame_pointer());
793 if (backtrack_label_.is_linked()) {
794 __ bind(&backtrack_label_);
798 Label exit_with_exception;
801 if (check_preempt_label_.is_linked()) {
802 SafeCallTarget(&check_preempt_label_);
804 CallCheckStackGuardState(
r0);
805 __ cmp(
r0, Operand::Zero());
808 __ b(
ne, &return_r0);
811 __ ldr(end_of_input_address(),
MemOperand(frame_pointer(), kInputEnd));
816 if (stack_overflow_label_.is_linked()) {
817 SafeCallTarget(&stack_overflow_label_);
822 static const int num_arguments = 3;
823 __ PrepareCallCFunction(num_arguments,
r0);
824 __ mov(
r0, backtrack_stackpointer());
825 __ add(
r1, frame_pointer(), Operand(kStackHighEnd));
826 __ mov(
r2, Operand(ExternalReference::isolate_address(isolate())));
827 ExternalReference grow_stack =
828 ExternalReference::re_grow_stack(isolate());
829 __ CallCFunction(grow_stack, num_arguments);
832 __ cmp(
r0, Operand::Zero());
833 __ b(
eq, &exit_with_exception);
835 __ mov(backtrack_stackpointer(),
r0);
840 if (exit_with_exception.is_linked()) {
842 __ bind(&exit_with_exception);
844 __ mov(
r0, Operand(EXCEPTION));
849 masm_->GetCode(&code_desc);
850 Handle<Code> code = isolate()->factory()->NewCode(
851 code_desc, Code::ComputeFlags(Code::REGEXP), masm_->CodeObject());
852 PROFILE(masm_->isolate(), RegExpCodeCreateEvent(*code, *source));
853 return Handle<HeapObject>::cast(code);
857 void RegExpMacroAssemblerARM::GoTo(Label*
to) {
858 BranchOrBacktrack(
al,
to);
862 void RegExpMacroAssemblerARM::IfRegisterGE(
int reg,
865 __ ldr(
r0, register_location(reg));
866 __ cmp(
r0, Operand(comparand));
867 BranchOrBacktrack(
ge, if_ge);
871 void RegExpMacroAssemblerARM::IfRegisterLT(
int reg,
874 __ ldr(
r0, register_location(reg));
875 __ cmp(
r0, Operand(comparand));
876 BranchOrBacktrack(
lt, if_lt);
880 void RegExpMacroAssemblerARM::IfRegisterEqPos(
int reg,
882 __ ldr(
r0, register_location(reg));
883 __ cmp(
r0, Operand(current_input_offset()));
884 BranchOrBacktrack(
eq, if_eq);
888 RegExpMacroAssembler::IrregexpImplementation
889 RegExpMacroAssemblerARM::Implementation() {
890 return kARMImplementation;
894 void RegExpMacroAssemblerARM::LoadCurrentCharacter(
int cp_offset,
895 Label* on_end_of_input,
899 DCHECK(cp_offset < (1<<30));
901 CheckPosition(cp_offset + characters - 1, on_end_of_input);
903 LoadCurrentCharacterUnchecked(cp_offset, characters);
907 void RegExpMacroAssemblerARM::PopCurrentPosition() {
908 Pop(current_input_offset());
912 void RegExpMacroAssemblerARM::PopRegister(
int register_index) {
914 __ str(
r0, register_location(register_index));
918 void RegExpMacroAssemblerARM::PushBacktrack(Label* label) {
919 __ mov_label_offset(
r0, label);
925 void RegExpMacroAssemblerARM::PushCurrentPosition() {
926 Push(current_input_offset());
930 void RegExpMacroAssemblerARM::PushRegister(
int register_index,
931 StackCheckFlag check_stack_limit) {
932 __ ldr(
r0, register_location(register_index));
934 if (check_stack_limit) CheckStackLimit();
938 void RegExpMacroAssemblerARM::ReadCurrentPositionFromRegister(
int reg) {
939 __ ldr(current_input_offset(), register_location(reg));
943 void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(
int reg) {
944 __ ldr(backtrack_stackpointer(), register_location(reg));
946 __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(
r0));
950 void RegExpMacroAssemblerARM::SetCurrentPositionFromEnd(
int by) {
951 Label after_position;
952 __ cmp(current_input_offset(), Operand(-by * char_size()));
953 __ b(
ge, &after_position);
954 __ mov(current_input_offset(), Operand(-by * char_size()));
958 LoadCurrentCharacterUnchecked(-1, 1);
959 __ bind(&after_position);
963 void RegExpMacroAssemblerARM::SetRegister(
int register_index,
int to) {
964 DCHECK(register_index >= num_saved_registers_);
966 __ str(
r0, register_location(register_index));
970 bool RegExpMacroAssemblerARM::Succeed() {
971 __ jmp(&success_label_);
976 void RegExpMacroAssemblerARM::WriteCurrentPositionToRegister(
int reg,
978 if (cp_offset == 0) {
979 __ str(current_input_offset(), register_location(reg));
981 __ add(
r0, current_input_offset(), Operand(cp_offset * char_size()));
982 __ str(
r0, register_location(reg));
987 void RegExpMacroAssemblerARM::ClearRegisters(
int reg_from,
int reg_to) {
988 DCHECK(reg_from <= reg_to);
990 for (
int reg = reg_from; reg <= reg_to; reg++) {
991 __ str(
r0, register_location(reg));
996 void RegExpMacroAssemblerARM::WriteStackPointerToRegister(
int reg) {
998 __ sub(
r0, backtrack_stackpointer(),
r1);
999 __ str(
r0, register_location(reg));
1005 void RegExpMacroAssemblerARM::CallCheckStackGuardState(Register scratch) {
1006 __ PrepareCallCFunction(3, scratch);
1009 __ mov(
r2, frame_pointer());
1011 __ mov(
r1, Operand(masm_->CodeObject()));
1014 int stack_alignment = base::OS::ActivationFrameAlignment();
1016 __ sub(
sp,
sp, Operand(stack_alignment));
1021 ExternalReference stack_guard_check =
1022 ExternalReference::re_check_stack_guard_state(isolate());
1023 __ mov(
ip, Operand(stack_guard_check));
1024 DirectCEntryStub stub(isolate());
1025 stub.GenerateCall(masm_,
ip);
1028 __ add(
sp,
sp, Operand(stack_alignment));
1030 DCHECK(stack_alignment != 0);
1033 __ mov(code_pointer(), Operand(masm_->CodeObject()));
1038 template <
typename T>
1039 static T& frame_entry(
Address re_frame,
int frame_offset) {
1040 return reinterpret_cast<T&
>(Memory::int32_at(re_frame + frame_offset));
1044 int RegExpMacroAssemblerARM::CheckStackGuardState(
Address* return_address,
1047 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
1048 StackLimitCheck check(isolate);
1049 if (check.JsHasOverflowed()) {
1050 isolate->StackOverflow();
1059 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1064 HandleScope handles(isolate);
1065 Handle<Code> code_handle(re_code);
1067 Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1070 bool is_one_byte = subject->IsOneByteRepresentationUnderneath();
1072 DCHECK(re_code->instruction_start() <= *return_address);
1073 DCHECK(*return_address <=
1074 re_code->instruction_start() + re_code->instruction_size());
1076 Object* result = isolate->stack_guard()->HandleInterrupts();
1078 if (*code_handle != re_code) {
1079 int delta = code_handle->address() - re_code->address();
1081 *return_address += delta;
1084 if (result->IsException()) {
1088 Handle<String> subject_tmp = subject;
1089 int slice_offset = 0;
1092 if (StringShape(*subject_tmp).IsCons()) {
1093 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
1094 }
else if (StringShape(*subject_tmp).IsSliced()) {
1095 SlicedString* slice = SlicedString::cast(*subject_tmp);
1096 subject_tmp = Handle<String>(slice->parent());
1097 slice_offset = slice->offset();
1101 if (subject_tmp->IsOneByteRepresentation() != is_one_byte) {
1112 DCHECK(StringShape(*subject_tmp).IsSequential() ||
1113 StringShape(*subject_tmp).IsExternal());
1116 const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
1120 int start_index = frame_entry<int>(re_frame, kStartIndex);
1121 const byte* new_address = StringCharacterPosition(*subject_tmp,
1122 start_index + slice_offset);
1124 if (start_address != new_address) {
1127 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd);
1128 int byte_length =
static_cast<int>(end_address - start_address);
1129 frame_entry<const String*>(re_frame, kInputString) = *subject;
1130 frame_entry<const byte*>(re_frame, kInputStart) = new_address;
1131 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
1132 }
else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
1136 frame_entry<const String*>(re_frame, kInputString) = *subject;
1143 MemOperand RegExpMacroAssemblerARM::register_location(
int register_index) {
1144 DCHECK(register_index < (1<<30));
1145 if (num_registers_ <= register_index) {
1146 num_registers_ = register_index + 1;
1153 void RegExpMacroAssemblerARM::CheckPosition(
int cp_offset,
1154 Label* on_outside_input) {
1155 __ cmp(current_input_offset(), Operand(-cp_offset * char_size()));
1156 BranchOrBacktrack(
ge, on_outside_input);
1160 void RegExpMacroAssemblerARM::BranchOrBacktrack(
Condition condition,
1162 if (condition ==
al) {
1171 __ b(condition, &backtrack_label_);
1174 __ b(condition,
to);
1178 void RegExpMacroAssemblerARM::SafeCall(Label*
to,
Condition cond) {
1183 void RegExpMacroAssemblerARM::SafeReturn() {
1185 __ add(
pc,
lr, Operand(masm_->CodeObject()));
1189 void RegExpMacroAssemblerARM::SafeCallTarget(Label*
name) {
1191 __ sub(
lr,
lr, Operand(masm_->CodeObject()));
1197 DCHECK(!source.is(backtrack_stackpointer()));
1203 void RegExpMacroAssemblerARM::Pop(Register target) {
1204 DCHECK(!target.is(backtrack_stackpointer()));
1210 void RegExpMacroAssemblerARM::CheckPreemption() {
1212 ExternalReference stack_limit =
1213 ExternalReference::address_of_stack_limit(isolate());
1214 __ mov(
r0, Operand(stack_limit));
1217 SafeCall(&check_preempt_label_,
ls);
1221 void RegExpMacroAssemblerARM::CheckStackLimit() {
1222 ExternalReference stack_limit =
1223 ExternalReference::address_of_regexp_stack_limit(isolate());
1224 __ mov(
r0, Operand(stack_limit));
1226 __ cmp(backtrack_stackpointer(), Operand(
r0));
1227 SafeCall(&stack_overflow_label_,
ls);
1231 bool RegExpMacroAssemblerARM::CanReadUnaligned() {
1236 void RegExpMacroAssemblerARM::LoadCurrentCharacterUnchecked(
int cp_offset,
1238 Register offset = current_input_offset();
1239 if (cp_offset != 0) {
1241 __ add(
r4, current_input_offset(), Operand(cp_offset * char_size()));
1248 if (!CanReadUnaligned()) {
1252 if (mode_ == LATIN1) {
1253 if (characters == 4) {
1254 __ ldr(current_character(),
MemOperand(end_of_input_address(), offset));
1255 }
else if (characters == 2) {
1256 __ ldrh(current_character(),
MemOperand(end_of_input_address(), offset));
1259 __ ldrb(current_character(),
MemOperand(end_of_input_address(), offset));
1263 if (characters == 2) {
1264 __ ldr(current_character(),
MemOperand(end_of_input_address(), offset));
1267 __ ldrh(current_character(),
MemOperand(end_of_input_address(), offset));
RegExpMacroAssemblerARM(Mode mode, int registers_to_save, Zone *zone)
#define PROFILE(IsolateGetter, Call)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
static int Push(SpecialRPOStackFrame *stack, int depth, BasicBlock *child, int unvisited)
kSerializedDataOffset Object
bool IsAligned(T value, U alignment)
Debugger support for the V8 JavaScript engine.
#define T(name, string, precedence)
Definitions and convenience functions for working with unicode.