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);
319 if (mode_ == ASCII) {
322 Label loop_increment;
325 __ push(backtrack_stackpointer());
335 __ cmpb_al(Operand(
edx, 0));
341 __ cmp(
ecx, static_cast<int32_t>(
'z' -
'a'));
350 __ bind(&loop_increment);
352 __ add(
edx, Immediate(1));
353 __ add(
edi, Immediate(1));
361 __ pop(backtrack_stackpointer());
367 __ pop(backtrack_stackpointer());
377 __ push(backtrack_stackpointer());
380 static const int argument_count = 4;
381 __ PrepareCallCFunction(argument_count,
ecx);
391 Immediate(ExternalReference::isolate_address()));
405 AllowExternalCallThatCantCauseGC scope(masm_);
406 ExternalReference compare =
407 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
408 __ CallCFunction(compare, argument_count);
412 __ pop(backtrack_stackpointer());
418 BranchOrBacktrack(
zero, on_no_match);
422 __ bind(&fallthrough);
426 void RegExpMacroAssemblerIA32::CheckNotBackReference(
428 Label* on_no_match) {
434 __ mov(
edx, register_location(start_reg));
435 __ mov(
eax, register_location(start_reg + 1));
438 BranchOrBacktrack(
less, on_no_match);
445 BranchOrBacktrack(
greater, on_no_match);
448 __ push(backtrack_stackpointer());
457 if (mode_ == ASCII) {
459 __ cmpb_al(Operand(
ebx, 0));
463 __ cmpw_ax(Operand(
ebx, 0));
467 __ add(
edx, Immediate(char_size()));
468 __ add(
ebx, Immediate(char_size()));
476 __ pop(backtrack_stackpointer());
484 __ pop(backtrack_stackpointer());
486 __ bind(&fallthrough);
490 void RegExpMacroAssemblerIA32::CheckNotCharacter(uint32_t c,
491 Label* on_not_equal) {
492 __ cmp(current_character(), c);
493 BranchOrBacktrack(
not_equal, on_not_equal);
497 void RegExpMacroAssemblerIA32::CheckCharacterAfterAnd(uint32_t c,
501 __ test(current_character(), Immediate(mask));
504 __ and_(
eax, current_character());
507 BranchOrBacktrack(
equal, on_equal);
511 void RegExpMacroAssemblerIA32::CheckNotCharacterAfterAnd(uint32_t c,
513 Label* on_not_equal) {
515 __ test(current_character(), Immediate(mask));
518 __ and_(
eax, current_character());
521 BranchOrBacktrack(
not_equal, on_not_equal);
525 void RegExpMacroAssemblerIA32::CheckNotCharacterAfterMinusAnd(
529 Label* on_not_equal) {
530 ASSERT(minus < String::kMaxUtf16CodeUnit);
531 __ lea(
eax, Operand(current_character(), -minus));
533 __ test(
eax, Immediate(mask));
538 BranchOrBacktrack(
not_equal, on_not_equal);
542 void RegExpMacroAssemblerIA32::CheckCharacterInRange(
545 Label* on_in_range) {
546 __ lea(
eax, Operand(current_character(), -from));
547 __ cmp(
eax, to - from);
552 void RegExpMacroAssemblerIA32::CheckCharacterNotInRange(
555 Label* on_not_in_range) {
556 __ lea(
eax, Operand(current_character(), -from));
557 __ cmp(
eax, to - from);
558 BranchOrBacktrack(
above, on_not_in_range);
562 void RegExpMacroAssemblerIA32::CheckBitInTable(
563 Handle<ByteArray> table,
565 __ mov(
eax, Immediate(table));
566 Register index = current_character();
568 __ mov(
ebx, kTableSize - 1);
569 __ and_(
ebx, current_character());
573 BranchOrBacktrack(
not_equal, on_bit_set);
577 bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(
uc16 type,
578 Label* on_no_match) {
584 if (mode_ == ASCII) {
587 __ cmp(current_character(),
' ');
590 __ lea(
eax, Operand(current_character(), -
'\t'));
591 __ cmp(
eax,
'\r' -
'\t');
592 BranchOrBacktrack(
above, on_no_match);
599 if (mode_ == ASCII) {
601 __ cmp(current_character(),
' ');
602 BranchOrBacktrack(
equal, on_no_match);
603 __ lea(
eax, Operand(current_character(), -
'\t'));
604 __ cmp(
eax,
'\r' -
'\t');
611 __ lea(
eax, Operand(current_character(), -
'0'));
612 __ cmp(
eax,
'9' -
'0');
613 BranchOrBacktrack(
above, on_no_match);
617 __ lea(
eax, Operand(current_character(), -
'0'));
618 __ cmp(
eax,
'9' -
'0');
623 __ mov(
eax, current_character());
624 __ xor_(
eax, Immediate(0x01));
626 __ sub(
eax, Immediate(0x0b));
627 __ cmp(
eax, 0x0c - 0x0b);
633 __ sub(
eax, Immediate(0x2028 - 0x0b));
634 __ cmp(
eax, 0x2029 - 0x2028);
640 if (mode_ != ASCII) {
642 __ cmp(current_character(), Immediate(
'z'));
643 BranchOrBacktrack(
above, on_no_match);
646 ExternalReference word_map = ExternalReference::re_word_character_map();
647 __ test_b(current_character(),
648 Operand::StaticArray(current_character(),
times_1, word_map));
649 BranchOrBacktrack(
zero, on_no_match);
654 if (mode_ != ASCII) {
656 __ cmp(current_character(), Immediate(
'z'));
660 ExternalReference word_map = ExternalReference::re_word_character_map();
661 __ test_b(current_character(),
662 Operand::StaticArray(current_character(),
times_1, word_map));
663 BranchOrBacktrack(
not_zero, on_no_match);
664 if (mode_ != ASCII) {
676 __ mov(
eax, current_character());
677 __ xor_(
eax, Immediate(0x01));
679 __ sub(
eax, Immediate(0x0b));
680 __ cmp(
eax, 0x0c - 0x0b);
681 if (mode_ == ASCII) {
682 BranchOrBacktrack(
above, on_no_match);
690 __ sub(
eax, Immediate(0x2028 - 0x0b));
692 BranchOrBacktrack(
above, on_no_match);
707 __ Set(
eax, Immediate(FAILURE));
709 __ jmp(&exit_label_);
713 Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
719 __ bind(&entry_label_);
723 FrameScope scope(masm_, StackFrame::MANUAL);
733 __ push(Immediate(0));
734 __ push(Immediate(0));
737 Label stack_limit_hit;
740 ExternalReference stack_limit =
741 ExternalReference::address_of_stack_limit(masm_->isolate());
743 __ sub(
ecx, Operand::StaticVariable(stack_limit));
752 __ mov(
eax, EXCEPTION);
755 __ bind(&stack_limit_hit);
756 CallCheckStackGuardState(
ebx);
763 __ mov(
ebx, Operand(
ebp, kStartIndex));
768 __ mov(
esi, Operand(
ebp, kInputEnd));
770 __ mov(
edi, Operand(
ebp, kInputStart));
784 __ mov(Operand(
ebp, kInputStartMinusOne),
eax);
789 const int kPageSize = 4096;
791 for (
int i = num_saved_registers_ + kRegistersPerPage - 1;
793 i += kRegistersPerPage) {
794 __ mov(register_location(i),
eax);
798 Label load_char_start_regexp, start_regexp;
800 __ cmp(Operand(
ebp, kStartIndex), Immediate(0));
801 __ j(
not_equal, &load_char_start_regexp, Label::kNear);
802 __ mov(current_character(),
'\n');
803 __ jmp(&start_regexp, Label::kNear);
806 __ bind(&load_char_start_regexp);
808 LoadCurrentCharacterUnchecked(-1, 1);
809 __ bind(&start_regexp);
812 if (num_saved_registers_ > 0) {
816 if (num_saved_registers_ > 8) {
817 __ mov(
ecx, kRegisterZero);
825 for (
int i = 0; i < num_saved_registers_; i++) {
826 __ mov(register_location(i),
eax);
832 __ mov(backtrack_stackpointer(), Operand(
ebp, kStackHighEnd));
834 __ jmp(&start_label_);
837 if (success_label_.is_linked()) {
839 __ bind(&success_label_);
840 if (num_saved_registers_ > 0) {
842 __ mov(
ebx, Operand(
ebp, kRegisterOutput));
843 __ mov(
ecx, Operand(
ebp, kInputEnd));
844 __ mov(
edx, Operand(
ebp, kStartIndex));
845 __ sub(
ecx, Operand(
ebp, kInputStart));
851 for (
int i = 0; i < num_saved_registers_; i++) {
852 __ mov(
eax, register_location(i));
853 if (i == 0 && global_with_zero_length_check()) {
869 __ inc(Operand(
ebp, kSuccessfulCaptures));
872 __ mov(
ecx, Operand(
ebp, kNumOutputRegisters));
873 __ sub(
ecx, Immediate(num_saved_registers_));
875 __ cmp(
ecx, Immediate(num_saved_registers_));
878 __ mov(Operand(
ebp, kNumOutputRegisters),
ecx);
880 __ add(Operand(
ebp, kRegisterOutput),
884 __ mov(
eax, Operand(
ebp, kInputStartMinusOne));
886 if (global_with_zero_length_check()) {
894 __ j(
zero, &exit_label_, Label::kNear);
897 __ add(
edi, Immediate(2));
903 __ jmp(&load_char_start_regexp);
905 __ mov(
eax, Immediate(SUCCESS));
909 __ bind(&exit_label_);
912 __ mov(
eax, Operand(
ebp, kSuccessfulCaptures));
915 __ bind(&return_eax);
917 __ lea(
esp, Operand(
ebp, kBackup_ebx));
927 if (backtrack_label_.is_linked()) {
928 __ bind(&backtrack_label_);
932 Label exit_with_exception;
935 if (check_preempt_label_.is_linked()) {
936 SafeCallTarget(&check_preempt_label_);
938 __ push(backtrack_stackpointer());
941 CallCheckStackGuardState(
ebx);
948 __ pop(backtrack_stackpointer());
950 __ mov(
esi, Operand(
ebp, kInputEnd));
955 if (stack_overflow_label_.is_linked()) {
956 SafeCallTarget(&stack_overflow_label_);
965 static const int num_arguments = 3;
966 __ PrepareCallCFunction(num_arguments,
ebx);
968 Immediate(ExternalReference::isolate_address()));
969 __ lea(
eax, Operand(
ebp, kStackHighEnd));
972 ExternalReference grow_stack =
973 ExternalReference::re_grow_stack(masm_->isolate());
974 __ CallCFunction(grow_stack, num_arguments);
978 __ j(
equal, &exit_with_exception);
980 __ mov(backtrack_stackpointer(),
eax);
987 if (exit_with_exception.is_linked()) {
989 __ bind(&exit_with_exception);
991 __ mov(
eax, EXCEPTION);
996 masm_->GetCode(&code_desc);
998 masm_->isolate()->factory()->NewCode(code_desc,
999 Code::ComputeFlags(Code::REGEXP),
1000 masm_->CodeObject());
1001 PROFILE(masm_->isolate(), RegExpCodeCreateEvent(*code, *source));
1002 return Handle<HeapObject>::cast(code);
1006 void RegExpMacroAssemblerIA32::GoTo(Label* to) {
1011 void RegExpMacroAssemblerIA32::IfRegisterGE(
int reg,
1014 __ cmp(register_location(reg), Immediate(comparand));
1019 void RegExpMacroAssemblerIA32::IfRegisterLT(
int reg,
1022 __ cmp(register_location(reg), Immediate(comparand));
1023 BranchOrBacktrack(
less, if_lt);
1027 void RegExpMacroAssemblerIA32::IfRegisterEqPos(
int reg,
1029 __ cmp(
edi, register_location(reg));
1030 BranchOrBacktrack(
equal, if_eq);
1034 RegExpMacroAssembler::IrregexpImplementation
1035 RegExpMacroAssemblerIA32::Implementation() {
1036 return kIA32Implementation;
1040 void RegExpMacroAssemblerIA32::LoadCurrentCharacter(
int cp_offset,
1041 Label* on_end_of_input,
1045 ASSERT(cp_offset < (1<<30));
1047 CheckPosition(cp_offset + characters - 1, on_end_of_input);
1049 LoadCurrentCharacterUnchecked(cp_offset, characters);
1053 void RegExpMacroAssemblerIA32::PopCurrentPosition() {
1058 void RegExpMacroAssemblerIA32::PopRegister(
int register_index) {
1060 __ mov(register_location(register_index),
eax);
1064 void RegExpMacroAssemblerIA32::PushBacktrack(Label* label) {
1065 Push(Immediate::CodeRelativeOffset(label));
1070 void RegExpMacroAssemblerIA32::PushCurrentPosition() {
1075 void RegExpMacroAssemblerIA32::PushRegister(
int register_index,
1076 StackCheckFlag check_stack_limit) {
1077 __ mov(
eax, register_location(register_index));
1079 if (check_stack_limit) CheckStackLimit();
1083 void RegExpMacroAssemblerIA32::ReadCurrentPositionFromRegister(
int reg) {
1084 __ mov(
edi, register_location(reg));
1088 void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(
int reg) {
1089 __ mov(backtrack_stackpointer(), register_location(reg));
1090 __ add(backtrack_stackpointer(), Operand(
ebp, kStackHighEnd));
1093 void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(
int by) {
1094 Label after_position;
1095 __ cmp(
edi, -by * char_size());
1097 __ mov(
edi, -by * char_size());
1101 LoadCurrentCharacterUnchecked(-1, 1);
1102 __ bind(&after_position);
1105 void RegExpMacroAssemblerIA32::SetRegister(
int register_index,
int to) {
1106 ASSERT(register_index >= num_saved_registers_);
1107 __ mov(register_location(register_index), Immediate(to));
1111 bool RegExpMacroAssemblerIA32::Succeed() {
1112 __ jmp(&success_label_);
1117 void RegExpMacroAssemblerIA32::WriteCurrentPositionToRegister(
int reg,
1119 if (cp_offset == 0) {
1120 __ mov(register_location(reg),
edi);
1122 __ lea(
eax, Operand(
edi, cp_offset * char_size()));
1123 __ mov(register_location(reg),
eax);
1128 void RegExpMacroAssemblerIA32::ClearRegisters(
int reg_from,
int reg_to) {
1129 ASSERT(reg_from <= reg_to);
1130 __ mov(
eax, Operand(
ebp, kInputStartMinusOne));
1131 for (
int reg = reg_from; reg <= reg_to; reg++) {
1132 __ mov(register_location(reg),
eax);
1137 void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(
int reg) {
1138 __ mov(
eax, backtrack_stackpointer());
1139 __ sub(
eax, Operand(
ebp, kStackHighEnd));
1140 __ mov(register_location(reg),
eax);
1146 void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) {
1147 static const int num_arguments = 3;
1148 __ PrepareCallCFunction(num_arguments, scratch);
1156 ExternalReference check_stack_guard =
1157 ExternalReference::re_check_stack_guard_state(masm_->isolate());
1158 __ CallCFunction(check_stack_guard, num_arguments);
1163 template <
typename T>
1164 static T& frame_entry(
Address re_frame,
int frame_offset) {
1165 return reinterpret_cast<T&
>(Memory::int32_at(re_frame + frame_offset));
1169 int RegExpMacroAssemblerIA32::CheckStackGuardState(
Address* return_address,
1172 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
1173 ASSERT(isolate == Isolate::Current());
1174 if (isolate->stack_guard()->IsStackOverflow()) {
1175 isolate->StackOverflow();
1184 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1189 HandleScope handles(isolate);
1190 Handle<Code> code_handle(re_code);
1192 Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1195 bool is_ascii = subject->IsAsciiRepresentationUnderneath();
1197 ASSERT(re_code->instruction_start() <= *return_address);
1198 ASSERT(*return_address <=
1199 re_code->instruction_start() + re_code->instruction_size());
1201 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate);
1203 if (*code_handle != re_code) {
1204 int delta = code_handle->address() - re_code->address();
1206 *return_address += delta;
1209 if (result->IsException()) {
1213 Handle<String> subject_tmp = subject;
1214 int slice_offset = 0;
1217 if (StringShape(*subject_tmp).IsCons()) {
1218 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
1219 }
else if (StringShape(*subject_tmp).IsSliced()) {
1220 SlicedString* slice = SlicedString::cast(*subject_tmp);
1221 subject_tmp = Handle<String>(slice->parent());
1222 slice_offset = slice->offset();
1226 if (subject_tmp->IsAsciiRepresentation() != is_ascii) {
1237 ASSERT(StringShape(*subject_tmp).IsSequential() ||
1238 StringShape(*subject_tmp).IsExternal());
1241 const byte* start_address = frame_entry<const byte*>(re_frame, kInputStart);
1245 int start_index = frame_entry<int>(re_frame, kStartIndex);
1246 const byte* new_address = StringCharacterPosition(*subject_tmp,
1247 start_index + slice_offset);
1249 if (start_address != new_address) {
1252 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd);
1253 int byte_length =
static_cast<int>(end_address - start_address);
1254 frame_entry<const String*>(re_frame, kInputString) = *subject;
1255 frame_entry<const byte*>(re_frame, kInputStart) = new_address;
1256 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
1257 }
else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
1261 frame_entry<const String*>(re_frame, kInputString) = *subject;
1268 Operand RegExpMacroAssemblerIA32::register_location(
int register_index) {
1269 ASSERT(register_index < (1<<30));
1270 if (num_registers_ <= register_index) {
1271 num_registers_ = register_index + 1;
1277 void RegExpMacroAssemblerIA32::CheckPosition(
int cp_offset,
1278 Label* on_outside_input) {
1279 __ cmp(
edi, -cp_offset * char_size());
1284 void RegExpMacroAssemblerIA32::BranchOrBacktrack(
Condition condition,
1286 if (condition < 0) {
1295 __ j(condition, &backtrack_label_);
1298 __ j(condition, to);
1302 void RegExpMacroAssemblerIA32::SafeCall(Label* to) {
1304 __ push(Immediate::CodeRelativeOffset(&return_to));
1306 __ bind(&return_to);
1310 void RegExpMacroAssemblerIA32::SafeReturn() {
1312 __ add(
ebx, Immediate(masm_->CodeObject()));
1317 void RegExpMacroAssemblerIA32::SafeCallTarget(Label*
name) {
1322 void RegExpMacroAssemblerIA32::Push(Register source) {
1323 ASSERT(!source.is(backtrack_stackpointer()));
1326 __ mov(Operand(backtrack_stackpointer(), 0), source);
1330 void RegExpMacroAssemblerIA32::Push(Immediate value) {
1333 __ mov(Operand(backtrack_stackpointer(), 0), value);
1337 void RegExpMacroAssemblerIA32::Pop(Register target) {
1338 ASSERT(!target.is(backtrack_stackpointer()));
1339 __ mov(target, Operand(backtrack_stackpointer(), 0));
1345 void RegExpMacroAssemblerIA32::CheckPreemption() {
1348 ExternalReference stack_limit =
1349 ExternalReference::address_of_stack_limit(masm_->isolate());
1350 __ cmp(
esp, Operand::StaticVariable(stack_limit));
1353 SafeCall(&check_preempt_label_);
1355 __ bind(&no_preempt);
1359 void RegExpMacroAssemblerIA32::CheckStackLimit() {
1360 Label no_stack_overflow;
1361 ExternalReference stack_limit =
1362 ExternalReference::address_of_regexp_stack_limit(masm_->isolate());
1363 __ cmp(backtrack_stackpointer(), Operand::StaticVariable(stack_limit));
1364 __ j(
above, &no_stack_overflow);
1366 SafeCall(&stack_overflow_label_);
1368 __ bind(&no_stack_overflow);
1372 void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(
int cp_offset,
1374 if (mode_ == ASCII) {
1375 if (characters == 4) {
1377 }
else if (characters == 2) {
1378 __ movzx_w(current_character(), Operand(
esi,
edi,
times_1, cp_offset));
1381 __ movzx_b(current_character(), Operand(
esi,
edi,
times_1, cp_offset));
1385 if (characters == 2) {
1386 __ mov(current_character(),
1390 __ movzx_w(current_character(),
1399 #endif // V8_INTERPRETED_REGEXP
1403 #endif // V8_TARGET_ARCH_IA32
v8::Handle< v8::Value > Fail(const v8::Arguments &args)
value format" "after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false, "print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false, "print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false, "report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true, "garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true, "flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true, "use incremental marking") DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") DEFINE_bool(trace_incremental_marking, false, "trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true, "Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false, "Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true, "use inline caching") DEFINE_bool(native_code_counters, false, "generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false, "Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true, "Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false, "Never perform compaction on full GC-testing only") DEFINE_bool(compact_code_space, true, "Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and" "flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0, "Default seed for initializing random generator" "(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true, "allows verbose printing") DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") DEFINE_bool(trace_sim, false, "Trace simulator execution") DEFINE_bool(check_icache, false, "Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator(4 or 8, 8 is default)") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, "preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true, "randomize hashes to avoid predictable hash collisions" "(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0, "Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false, "activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") DEFINE_int(testing_int_flag, 13, "testing_int_flag") DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_string(testing_serialization_file, "/tmp/serdes", "file in which to serialize heap") DEFINE_bool(help, false, "Print usage message, including flags, on console") DEFINE_bool(dump_counters, false, "Dump counters on exit") DEFINE_string(map_counters, "", "Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT, "Pass all remaining arguments to the script.Alias for\"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#43"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2#define FLAG_MODE_DEFINE_DEFAULTS#1"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flag-definitions.h"1#define FLAG_FULL(ftype, ctype, nam, def, cmt)#define FLAG_READONLY(ftype, ctype, nam, def, cmt)#define DEFINE_implication(whenflag, thenflag)#define DEFINE_bool(nam, def, cmt)#define DEFINE_int(nam, def, cmt)#define DEFINE_float(nam, def, cmt)#define DEFINE_string(nam, def, cmt)#define DEFINE_args(nam, def, cmt)#define FLAG DEFINE_bool(use_strict, false,"enforce strict mode") DEFINE_bool(es5_readonly, false,"activate correct semantics for inheriting readonliness") DEFINE_bool(es52_globals, false,"activate new semantics for global var declarations") DEFINE_bool(harmony_typeof, false,"enable harmony semantics for typeof") DEFINE_bool(harmony_scoping, false,"enable harmony block scoping") DEFINE_bool(harmony_modules, false,"enable harmony modules (implies block scoping)") DEFINE_bool(harmony_proxies, false,"enable harmony proxies") DEFINE_bool(harmony_collections, false,"enable harmony collections (sets, maps, and weak maps)") DEFINE_bool(harmony, false,"enable all harmony features (except typeof)") DEFINE_implication(harmony, harmony_scoping) DEFINE_implication(harmony, harmony_modules) DEFINE_implication(harmony, harmony_proxies) DEFINE_implication(harmony, harmony_collections) DEFINE_implication(harmony_modules, harmony_scoping) DEFINE_bool(packed_arrays, false,"optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true,"tracks arrays with only smi values") DEFINE_bool(clever_optimizations, true,"Optimize object size, Array shift, DOM strings and string +") DEFINE_bool(unbox_double_arrays, true,"automatically unbox arrays of doubles") DEFINE_bool(string_slices, true,"use string slices") DEFINE_bool(crankshaft, true,"use crankshaft") DEFINE_string(hydrogen_filter,"","optimization filter") DEFINE_bool(use_range, true,"use hydrogen range analysis") DEFINE_bool(eliminate_dead_phis, true,"eliminate dead phis") DEFINE_bool(use_gvn, true,"use hydrogen global value numbering") DEFINE_bool(use_canonicalizing, true,"use hydrogen instruction canonicalizing") DEFINE_bool(use_inlining, true,"use function inlining") DEFINE_int(max_inlined_source_size, 600,"maximum source size in bytes considered for a single inlining") DEFINE_int(max_inlined_nodes, 196,"maximum number of AST nodes considered for a single inlining") DEFINE_int(max_inlined_nodes_cumulative, 196,"maximum cumulative number of AST nodes considered for inlining") DEFINE_bool(loop_invariant_code_motion, true,"loop invariant code motion") DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true,"crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false,"print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false,"trace generated hydrogen to file") DEFINE_string(trace_phase,"Z","trace generated IR for specified phases") DEFINE_bool(trace_inlining, false,"trace inlining decisions") DEFINE_bool(trace_alloc, false,"trace register allocator") DEFINE_bool(trace_all_uses, false,"trace all use positions") DEFINE_bool(trace_range, false,"trace range analysis") DEFINE_bool(trace_gvn, false,"trace global value numbering") DEFINE_bool(trace_representation, false,"trace representation types") DEFINE_bool(stress_pointer_maps, false,"pointer map for every instruction") DEFINE_bool(stress_environments, false,"environment for every instruction") DEFINE_int(deopt_every_n_times, 0,"deoptimize every n times a deopt point is passed") DEFINE_bool(trap_on_deopt, false,"put a break point before deoptimizing") DEFINE_bool(deoptimize_uncommon_cases, true,"deoptimize uncommon cases") DEFINE_bool(polymorphic_inlining, true,"polymorphic inlining") DEFINE_bool(use_osr, true,"use on-stack replacement") DEFINE_bool(array_bounds_checks_elimination, false,"perform array bounds checks elimination") DEFINE_bool(array_index_dehoisting, false,"perform array index dehoisting") DEFINE_bool(trace_osr, false,"trace on-stack replacement") DEFINE_int(stress_runs, 0,"number of stress runs") DEFINE_bool(optimize_closures, true,"optimize closures") DEFINE_bool(inline_construct, true,"inline constructor calls") DEFINE_bool(inline_arguments, true,"inline functions with arguments object") DEFINE_int(loop_weight, 1,"loop weight for representation inference") DEFINE_bool(optimize_for_in, true,"optimize functions containing for-in loops") DEFINE_bool(experimental_profiler, true,"enable all profiler experiments") DEFINE_bool(watch_ic_patching, false,"profiler considers IC stability") DEFINE_int(frame_count, 1,"number of stack frames inspected by the profiler") DEFINE_bool(self_optimization, false,"primitive functions trigger their own optimization") DEFINE_bool(direct_self_opt, false,"call recompile stub directly when self-optimizing") DEFINE_bool(retry_self_opt, false,"re-try self-optimization if it failed") DEFINE_bool(count_based_interrupts, false,"trigger profiler ticks based on counting instead of timing") DEFINE_bool(interrupt_at_exit, false,"insert an interrupt check at function exit") DEFINE_bool(weighted_back_edges, false,"weight back edges by jump distance for interrupt triggering") DEFINE_int(interrupt_budget, 5900,"execution budget before interrupt is triggered") DEFINE_int(type_info_threshold, 15,"percentage of ICs that must have type info to allow optimization") DEFINE_int(self_opt_count, 130,"call count before self-optimization") DEFINE_implication(experimental_profiler, watch_ic_patching) DEFINE_implication(experimental_profiler, self_optimization) DEFINE_implication(experimental_profiler, retry_self_opt) DEFINE_implication(experimental_profiler, count_based_interrupts) DEFINE_implication(experimental_profiler, interrupt_at_exit) DEFINE_implication(experimental_profiler, weighted_back_edges) DEFINE_bool(trace_opt_verbose, false,"extra verbose compilation tracing") DEFINE_implication(trace_opt_verbose, trace_opt) DEFINE_bool(debug_code, false,"generate extra code (assertions) for debugging") DEFINE_bool(code_comments, false,"emit comments in code disassembly") DEFINE_bool(enable_sse2, true,"enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true,"enable use of SSE3 instructions if available") DEFINE_bool(enable_sse4_1, true,"enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true,"enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true,"enable use of RDTSC instruction if available") DEFINE_bool(enable_sahf, true,"enable use of SAHF instruction if available (X64 only)") DEFINE_bool(enable_vfp3, true,"enable use of VFP3 instructions if available - this implies ""enabling ARMv7 instructions (ARM only)") DEFINE_bool(enable_armv7, true,"enable use of ARMv7 instructions if available (ARM only)") DEFINE_bool(enable_fpu, true,"enable use of MIPS FPU instructions if available (MIPS only)") DEFINE_string(expose_natives_as, NULL,"expose natives in global object") DEFINE_string(expose_debug_as, NULL,"expose debug in global object") DEFINE_bool(expose_gc, false,"expose gc extension") DEFINE_bool(expose_externalize_string, false,"expose externalize string extension") DEFINE_int(stack_trace_limit, 10,"number of stack frames to capture") DEFINE_bool(builtins_in_stack_traces, false,"show built-in functions in stack traces") DEFINE_bool(disable_native_files, false,"disable builtin natives files") DEFINE_bool(inline_new, true,"use fast inline allocation") DEFINE_bool(stack_trace_on_abort, true,"print a stack trace if an assertion failure occurs") DEFINE_bool(trace, false,"trace function calls") DEFINE_bool(mask_constants_with_cookie, true,"use random jit cookie to mask large constants") DEFINE_bool(lazy, true,"use lazy compilation") DEFINE_bool(trace_opt, false,"trace lazy optimization") DEFINE_bool(trace_opt_stats, false,"trace lazy optimization statistics") DEFINE_bool(opt, true,"use adaptive optimizations") DEFINE_bool(always_opt, false,"always try to optimize functions") DEFINE_bool(prepare_always_opt, false,"prepare for turning on always opt") DEFINE_bool(trace_deopt, false,"trace deoptimization") DEFINE_int(min_preparse_length, 1024,"minimum length for automatic enable preparsing") DEFINE_bool(always_full_compiler, false,"try to use the dedicated run-once backend for all code") DEFINE_bool(trace_bailout, false,"print reasons for falling back to using the classic V8 backend") DEFINE_bool(compilation_cache, true,"enable compilation cache") DEFINE_bool(cache_prototype_transitions, true,"cache prototype transitions") DEFINE_bool(trace_debug_json, false,"trace debugging JSON request/response") DEFINE_bool(debugger_auto_break, true,"automatically set the debug break flag when debugger commands are ""in the queue") DEFINE_bool(enable_liveedit, true,"enable liveedit experimental feature") DEFINE_bool(break_on_abort, true,"always cause a debug break before aborting") DEFINE_int(stack_size, kPointerSize *123,"default size of stack region v8 is allowed to use (in kBytes)") DEFINE_int(max_stack_trace_source_length, 300,"maximum length of function source code printed in a stack trace.") DEFINE_bool(always_inline_smi_code, false,"always inline smi code in non-opt code") DEFINE_int(max_new_space_size, 0,"max size of the new generation (in kBytes)") DEFINE_int(max_old_space_size, 0,"max size of the old generation (in Mbytes)") DEFINE_int(max_executable_size, 0,"max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false,"always perform global GCs") DEFINE_int(gc_interval,-1,"garbage collect after <n> allocations") DEFINE_bool(trace_gc, false,"print one trace line following each garbage collection") DEFINE_bool(trace_gc_nvp, false,"print one detailed trace line in name=value format ""after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false,"print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false,"print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false,"report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true,"garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true,"flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true,"use incremental marking") DEFINE_bool(incremental_marking_steps, true,"do incremental marking steps") DEFINE_bool(trace_incremental_marking, false,"trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true,"Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false,"Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true,"use inline caching") DEFINE_bool(native_code_counters, false,"generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false,"Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true,"Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false,"Never perform compaction on full GC - testing only") DEFINE_bool(compact_code_space, true,"Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true,"Flush inline caches prior to mark compact collection and ""flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0,"Default seed for initializing random generator ""(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true,"allows verbose printing") DEFINE_bool(allow_natives_syntax, false,"allow natives syntax") DEFINE_bool(trace_sim, false,"Trace simulator execution") DEFINE_bool(check_icache, false,"Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0,"Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8,"Stack alingment in bytes in simulator (4 or 8, 8 is default)") DEFINE_bool(trace_exception, false,"print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false,"preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true,"randomize hashes to avoid predictable hash collisions ""(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0,"Fixed seed to use to hash property keys (0 means random)""(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false,"activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true,"generate optimized regexp code") DEFINE_bool(testing_bool_flag, true,"testing_bool_flag") DEFINE_int(testing_int_flag, 13,"testing_int_flag") DEFINE_float(testing_float_flag, 2.5,"float-flag") DEFINE_string(testing_string_flag,"Hello, world!","string-flag") DEFINE_int(testing_prng_seed, 42,"Seed used for threading test randomness") DEFINE_string(testing_serialization_file,"/tmp/serdes","file in which to serialize heap") DEFINE_bool(help, false,"Print usage message, including flags, on console") DEFINE_bool(dump_counters, false,"Dump counters on exit") DEFINE_string(map_counters,"","Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT,"Pass all remaining arguments to the script. Alias for \"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#47"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2 namespace{struct Flag{enum FlagType{TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARGS} name
#define ASSERT(condition)
#define PROFILE(isolate, Call)
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save, Zone *zone)
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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt 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 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
Operand FieldOperand(Register object, int offset)
#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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt 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 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
#define STATIC_ASSERT(test)
const uc32 kMaxAsciiCharCode