30 #if defined(V8_TARGET_ARCH_ARM)
39 #define __ ACCESS_MASM(masm)
42 static void ProbeTable(Isolate* isolate,
52 Register offset_scratch) {
53 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
54 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
55 ExternalReference map_offset(isolate->stub_cache()->map_reference(table));
57 uint32_t key_off_addr =
reinterpret_cast<uint32_t
>(key_offset.address());
58 uint32_t value_off_addr =
reinterpret_cast<uint32_t
>(value_offset.address());
59 uint32_t map_off_addr =
reinterpret_cast<uint32_t
>(map_offset.address());
62 ASSERT(value_off_addr > key_off_addr);
63 ASSERT((value_off_addr - key_off_addr) % 4 == 0);
64 ASSERT((value_off_addr - key_off_addr) < (256 * 4));
65 ASSERT(map_off_addr > key_off_addr);
66 ASSERT((map_off_addr - key_off_addr) % 4 == 0);
67 ASSERT((map_off_addr - key_off_addr) < (256 * 4));
70 Register base_addr = scratch;
74 __ add(offset_scratch, offset, Operand(offset,
LSL, 1));
77 __ mov(base_addr, Operand(key_offset));
92 Register code = scratch2;
94 __ ldr(code,
MemOperand(base_addr, value_off_addr - key_off_addr));
97 Register flags_reg = base_addr;
103 ASSERT(
__ ImmediateFitsAddrMode1Instruction(mask));
104 __ bic(flags_reg, flags_reg, Operand(mask));
107 __ cmn(flags_reg, Operand(-flags));
109 __ cmp(flags_reg, Operand(flags));
134 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
141 Counters* counters = masm->isolate()->counters();
142 __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
143 __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
147 const int kInterceptorOrAccessCheckNeededMask =
151 Register map = scratch1;
154 __ tst(scratch0, Operand(kInterceptorOrAccessCheckNeededMask));
155 __ b(
ne, miss_label);
160 __ b(
lt, miss_label);
163 Register properties = scratch0;
167 Register tmp = properties;
168 __ LoadRoot(tmp, Heap::kHashTableMapRootIndex);
170 __ b(
ne, miss_label);
184 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
196 Isolate* isolate = masm->isolate();
201 ASSERT(
sizeof(Entry) == 12);
207 ASSERT(!scratch.is(receiver));
208 ASSERT(!scratch.is(name));
209 ASSERT(!extra.is(receiver));
211 ASSERT(!extra.is(scratch));
212 ASSERT(!extra2.is(receiver));
214 ASSERT(!extra2.is(scratch));
215 ASSERT(!extra2.is(extra));
223 Counters* counters = masm->isolate()->counters();
224 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1,
228 __ JumpIfSmi(receiver, &miss);
233 __ add(scratch, scratch, Operand(
ip));
234 uint32_t mask = kPrimaryTableSize - 1;
242 __ and_(scratch, scratch, Operand(mask));
258 uint32_t mask2 = kSecondaryTableSize - 1;
260 __ and_(scratch, scratch, Operand(mask2));
277 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1,
282 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
284 Register prototype) {
300 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
301 MacroAssembler* masm,
305 Isolate* isolate = masm->isolate();
308 __ Move(
ip, isolate->global());
309 __ cmp(prototype,
ip);
312 Handle<JSFunction>
function(
315 __ Move(prototype, Handle<Map>(function->initial_map()));
324 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
327 Handle<JSObject> holder,
330 index -= holder->map()->inobject_properties();
333 int offset = holder->map()->instance_size() + (index *
kPointerSize);
344 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
349 __ JumpIfSmi(receiver, miss_label);
353 __ b(
ne, miss_label);
364 static void GenerateStringCheck(MacroAssembler* masm,
369 Label* non_string_object) {
371 __ JumpIfSmi(receiver, smi);
378 __ cmp(scratch2, Operand(static_cast<int32_t>(
kStringTag)));
379 __ b(
ne, non_string_object);
387 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
392 bool support_wrappers) {
397 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss,
398 support_wrappers ? &check_wrapper : miss);
404 if (support_wrappers) {
406 __ bind(&check_wrapper);
412 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss);
419 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
424 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
425 __ mov(
r0, scratch1);
434 void StubCompiler::GenerateStoreField(MacroAssembler* masm,
435 Handle<JSObject>
object,
437 Handle<Map> transition,
439 Register receiver_reg,
447 LookupResult lookup(masm->isolate());
448 object->Lookup(*name, &lookup);
449 if (lookup.IsFound() && (lookup.IsReadOnly() || !lookup.IsCacheable())) {
460 __ CheckMap(receiver_reg, scratch1, Handle<Map>(object->map()), miss_label,
464 if (object->IsJSGlobalProxy()) {
465 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
469 if (!transition.is_null() &&
object->GetPrototype()->IsJSObject()) {
471 if (lookup.IsFound()) {
472 holder = lookup.holder();
478 }
while (holder->GetPrototype()->IsJSObject());
482 Label miss_pop, done_check;
483 CheckPrototypes(
object, receiver_reg, Handle<JSObject>(holder), name_reg,
484 scratch1, scratch2, name, &miss_pop);
489 __ bind(&done_check);
495 ASSERT(object->IsJSGlobalProxy() || !
object->IsAccessCheckNeeded());
498 if (!transition.is_null() && (
object->map()->unused_property_fields() == 0)) {
501 __ push(receiver_reg);
502 __ mov(
r2, Operand(transition));
504 __ TailCallExternalReference(
505 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
512 if (!transition.is_null()) {
514 __ mov(scratch1, Operand(transition));
519 __ RecordWriteField(receiver_reg,
532 index -=
object->map()->inobject_properties();
536 int offset =
object->map()->instance_size() + (index *
kPointerSize);
540 __ JumpIfSmi(
r0, &exit);
544 __ mov(name_reg,
r0);
545 __ RecordWriteField(receiver_reg,
560 __ JumpIfSmi(
r0, &exit);
564 __ mov(name_reg,
r0);
565 __ RecordWriteField(scratch1,
579 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm,
Code::Kind kind) {
582 ? masm->isolate()->builtins()->LoadIC_Miss()
583 : masm->isolate()->builtins()->KeyedLoadIC_Miss();
584 __ Jump(code, RelocInfo::CODE_TARGET);
588 static void GenerateCallFunction(MacroAssembler* masm,
589 Handle<Object>
object,
590 const ParameterCount& arguments,
599 __ JumpIfSmi(
r1, miss);
605 if (object->IsGlobalObject()) {
618 static void PushInterceptorArguments(MacroAssembler* masm,
622 Handle<JSObject> holder_obj) {
624 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
625 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
626 Register scratch =
name;
627 __ mov(scratch, Operand(interceptor));
633 __ mov(scratch, Operand(ExternalReference::isolate_address()));
638 static void CompileCallLoadPropertyWithInterceptor(
639 MacroAssembler* masm,
643 Handle<JSObject> holder_obj) {
644 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
646 ExternalReference ref =
647 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
649 __ mov(
r0, Operand(6));
650 __ mov(
r1, Operand(ref));
657 static const int kFastApiCallArguments = 4;
663 static void ReserveSpaceForFastApiCall(MacroAssembler* masm,
666 for (
int i = 0; i < kFastApiCallArguments; i++) {
673 static void FreeSpaceForFastApiCall(MacroAssembler* masm) {
674 __ Drop(kFastApiCallArguments);
678 static void GenerateFastApiDirectCall(MacroAssembler* masm,
679 const CallOptimization& optimization,
692 Handle<JSFunction>
function = optimization.constant_function();
693 __ LoadHeapObject(
r5,
function);
697 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
698 Handle<Object> call_data(api_call_info->data());
699 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
700 __ Move(
r0, api_call_info);
703 __ Move(
r6, call_data);
705 __ mov(
r7, Operand(ExternalReference::isolate_address()));
714 const int kApiStackSpace = 4;
716 FrameScope frame_scope(masm, StackFrame::MANUAL);
717 __ EnterExitFrame(
false, kApiStackSpace);
728 __ mov(
ip, Operand(argc));
731 __ mov(
ip, Operand(0));
734 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1;
735 Address function_address = v8::ToCData<Address>(api_call_info->callback());
736 ApiFunction fun(function_address);
737 ExternalReference ref = ExternalReference(&fun,
738 ExternalReference::DIRECT_API_CALL,
740 AllowExternalCallThatCantCauseGC scope(masm);
742 __ CallApiFunctionAndReturn(ref, kStackUnwindSpace);
748 CallInterceptorCompiler(StubCompiler* stub_compiler,
749 const ParameterCount& arguments,
752 : stub_compiler_(stub_compiler),
753 arguments_(arguments),
755 extra_ic_state_(extra_ic_state) {}
757 void Compile(MacroAssembler* masm,
758 Handle<JSObject>
object,
759 Handle<JSObject> holder,
761 LookupResult* lookup,
767 ASSERT(holder->HasNamedInterceptor());
768 ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
771 __ JumpIfSmi(receiver, miss);
772 CallOptimization optimization(lookup);
773 if (optimization.is_constant_call()) {
774 CompileCacheable(masm,
object, receiver, scratch1, scratch2, scratch3,
775 holder, lookup, name, optimization, miss);
777 CompileRegular(masm,
object, receiver, scratch1, scratch2, scratch3,
783 void CompileCacheable(MacroAssembler* masm,
784 Handle<JSObject>
object,
789 Handle<JSObject> interceptor_holder,
790 LookupResult* lookup,
792 const CallOptimization& optimization,
794 ASSERT(optimization.is_constant_call());
795 ASSERT(!lookup->holder()->IsGlobalObject());
796 Counters* counters = masm->isolate()->counters();
799 bool can_do_fast_api_call =
false;
800 if (optimization.is_simple_api_call() &&
801 !lookup->holder()->IsGlobalObject()) {
802 depth1 = optimization.GetPrototypeDepthOfExpectedType(
803 object, interceptor_holder);
805 depth2 = optimization.GetPrototypeDepthOfExpectedType(
806 interceptor_holder, Handle<JSObject>(lookup->holder()));
808 can_do_fast_api_call =
812 __ IncrementCounter(counters->call_const_interceptor(), 1,
815 if (can_do_fast_api_call) {
816 __ IncrementCounter(counters->call_const_interceptor_fast_api(), 1,
818 ReserveSpaceForFastApiCall(masm, scratch1);
824 Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
826 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
827 scratch1, scratch2, scratch3,
832 Label regular_invoke;
833 LoadWithInterceptor(masm, receiver, holder, interceptor_holder, scratch2,
841 if (*interceptor_holder != lookup->holder()) {
842 stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
843 Handle<JSObject>(lookup->holder()),
844 scratch1, scratch2, scratch3,
855 if (can_do_fast_api_call) {
856 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate());
861 __ InvokeFunction(optimization.constant_function(), arguments_,
866 if (can_do_fast_api_call) {
867 __ bind(&miss_cleanup);
868 FreeSpaceForFastApiCall(masm);
873 __ bind(®ular_invoke);
874 if (can_do_fast_api_call) {
875 FreeSpaceForFastApiCall(masm);
879 void CompileRegular(MacroAssembler* masm,
880 Handle<JSObject>
object,
886 Handle<JSObject> interceptor_holder,
889 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
890 scratch1, scratch2, scratch3,
897 PushInterceptorArguments(masm, receiver, holder,
name_, interceptor_holder);
898 __ CallExternalReference(
899 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
907 void LoadWithInterceptor(MacroAssembler* masm,
910 Handle<JSObject> holder_obj,
912 Label* interceptor_succeeded) {
916 CompileCallLoadPropertyWithInterceptor(masm,
925 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex);
927 __ b(
ne, interceptor_succeeded);
930 StubCompiler* stub_compiler_;
931 const ParameterCount& arguments_;
940 static void GenerateCheckPropertyCell(MacroAssembler* masm,
941 Handle<GlobalObject> global,
945 Handle<JSGlobalPropertyCell> cell =
947 ASSERT(cell->value()->IsTheHole());
948 __ mov(scratch, Operand(cell));
951 __ LoadRoot(
ip, Heap::kTheHoleValueRootIndex);
959 static void GenerateCheckPropertyCells(MacroAssembler* masm,
960 Handle<JSObject>
object,
961 Handle<JSObject> holder,
965 Handle<JSObject> current = object;
966 while (!current.is_identical_to(holder)) {
967 if (current->IsGlobalObject()) {
968 GenerateCheckPropertyCell(masm,
969 Handle<GlobalObject>::cast(current),
974 current = Handle<JSObject>(
JSObject::cast(current->GetPrototype()));
982 static void StoreIntAsFloat(MacroAssembler* masm,
990 CpuFeatures::Scope scope(
VFP3);
992 __ add(scratch1, dst, Operand(wordoffset,
LSL, 2));
994 __ vstr(
s0, scratch1, 0);
996 Label not_special, done;
1009 __ cmp(ival, Operand(1));
1010 __ b(
gt, ¬_special);
1013 static const uint32_t exponent_word_for_1 =
1016 __ orr(fval, fval, Operand(exponent_word_for_1),
LeaveCC,
eq);
1019 __ bind(¬_special);
1022 Register zeros = scratch2;
1023 __ CountLeadingZeros(zeros, ival, scratch1);
1032 Operand(scratch1,
LSL, kBinary32ExponentShift));
1035 __ add(zeros, zeros, Operand(1));
1037 __ mov(ival, Operand(ival,
LSL, zeros));
1054 static void GenerateUInt2Double(MacroAssembler* masm,
1058 int leading_zeroes) {
1059 const int meaningful_bits =
kBitsPerInt - leading_zeroes - 1;
1062 const int mantissa_shift_for_hi_word =
1065 const int mantissa_shift_for_lo_word =
1069 if (mantissa_shift_for_hi_word > 0) {
1070 __ mov(loword, Operand(hiword,
LSL, mantissa_shift_for_lo_word));
1071 __ orr(hiword, scratch, Operand(hiword,
LSR, mantissa_shift_for_hi_word));
1074 __ orr(hiword, scratch, Operand(hiword,
LSL, mantissa_shift_for_hi_word));
1079 if (!(biased_exponent & 1)) {
1086 #define __ ACCESS_MASM(masm())
1089 Register StubCompiler::CheckPrototypes(Handle<JSObject>
object,
1090 Register object_reg,
1091 Handle<JSObject> holder,
1092 Register holder_reg,
1095 Handle<String> name,
1099 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
1100 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
1101 && !scratch2.is(scratch1));
1104 Register reg = object_reg;
1107 if (save_at_depth == depth) {
1113 Handle<JSObject> current = object;
1114 while (!current.is_identical_to(holder)) {
1119 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
1121 Handle<JSObject> prototype(
JSObject::cast(current->GetPrototype()));
1122 if (!current->HasFastProperties() &&
1123 !current->IsJSGlobalObject() &&
1124 !current->IsJSGlobalProxy()) {
1125 if (!name->IsSymbol()) {
1126 name = factory()->LookupSymbol(name);
1128 ASSERT(current->property_dictionary()->FindEntry(*name) ==
1131 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
1132 scratch1, scratch2);
1138 Handle<Map> current_map(current->map());
1145 if (current->IsJSGlobalProxy()) {
1146 __ CheckAccessGlobalProxy(reg, scratch2, miss);
1150 if (heap()->InNewSpace(*prototype)) {
1156 __ mov(reg, Operand(prototype));
1160 if (save_at_depth == depth) {
1165 current = prototype;
1169 LOG(masm()->isolate(), IntEvent(
"check-maps-depth", depth + 1));
1172 __ CheckMap(reg, scratch1, Handle<Map>(current->map()), miss,
1176 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
1177 if (holder->IsJSGlobalProxy()) {
1178 __ CheckAccessGlobalProxy(reg, scratch1, miss);
1184 GenerateCheckPropertyCells(masm(),
object, holder, name, scratch1, miss);
1191 void StubCompiler::GenerateLoadField(Handle<JSObject>
object,
1192 Handle<JSObject> holder,
1198 Handle<String> name,
1201 __ JumpIfSmi(receiver, miss);
1204 Register reg = CheckPrototypes(
1205 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1206 GenerateFastPropertyLoad(masm(),
r0, reg, holder, index);
1211 void StubCompiler::GenerateLoadConstant(Handle<JSObject>
object,
1212 Handle<JSObject> holder,
1217 Handle<JSFunction> value,
1218 Handle<String> name,
1221 __ JumpIfSmi(receiver, miss);
1225 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1228 __ LoadHeapObject(
r0, value);
1233 void StubCompiler::GenerateLoadCallback(Handle<JSObject>
object,
1234 Handle<JSObject> holder,
1240 Handle<AccessorInfo> callback,
1241 Handle<String> name,
1244 __ JumpIfSmi(receiver, miss);
1247 Register reg = CheckPrototypes(
object, receiver, holder, scratch1,
1248 scratch2, scratch3, name, miss);
1253 __ mov(scratch2,
sp);
1254 if (heap()->InNewSpace(callback->data())) {
1255 __ Move(scratch3, callback);
1258 __ Move(scratch3, Handle<Object>(callback->data()));
1260 __ Push(reg, scratch3);
1261 __ mov(scratch3, Operand(ExternalReference::isolate_address()));
1262 __ Push(scratch3, name_reg);
1265 const int kApiStackSpace = 1;
1266 FrameScope frame_scope(masm(), StackFrame::MANUAL);
1267 __ EnterExitFrame(
false, kApiStackSpace);
1274 const int kStackUnwindSpace = 5;
1275 Address getter_address = v8::ToCData<Address>(callback->getter());
1276 ApiFunction fun(getter_address);
1277 ExternalReference ref =
1278 ExternalReference(&fun,
1279 ExternalReference::DIRECT_GETTER_CALL,
1281 __ CallApiFunctionAndReturn(ref, kStackUnwindSpace);
1285 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject>
object,
1286 Handle<JSObject> interceptor_holder,
1287 LookupResult* lookup,
1293 Handle<String> name,
1295 ASSERT(interceptor_holder->HasNamedInterceptor());
1296 ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
1299 __ JumpIfSmi(receiver, miss);
1304 bool compile_followup_inline =
false;
1305 if (lookup->IsFound() && lookup->IsCacheable()) {
1306 if (lookup->type() ==
FIELD) {
1307 compile_followup_inline =
true;
1308 }
else if (lookup->type() ==
CALLBACKS &&
1309 lookup->GetCallbackObject()->IsAccessorInfo()) {
1311 compile_followup_inline = callback->getter() !=
NULL &&
1312 callback->IsCompatibleReceiver(*
object);
1316 if (compile_followup_inline) {
1320 Register holder_reg = CheckPrototypes(
object, receiver, interceptor_holder,
1321 scratch1, scratch2, scratch3,
1323 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
1329 bool must_perfrom_prototype_check = *interceptor_holder != lookup->holder();
1330 bool must_preserve_receiver_reg = !receiver.is(holder_reg) &&
1331 (lookup->type() ==
CALLBACKS || must_perfrom_prototype_check);
1337 if (must_preserve_receiver_reg) {
1338 __ Push(receiver, holder_reg, name_reg);
1340 __ Push(holder_reg, name_reg);
1345 CompileCallLoadPropertyWithInterceptor(masm(),
1349 interceptor_holder);
1352 Label interceptor_failed;
1353 __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex);
1354 __ cmp(
r0, scratch1);
1355 __ b(
eq, &interceptor_failed);
1356 frame_scope.GenerateLeaveFrame();
1359 __ bind(&interceptor_failed);
1362 if (must_preserve_receiver_reg) {
1369 if (must_perfrom_prototype_check) {
1370 holder_reg = CheckPrototypes(interceptor_holder,
1372 Handle<JSObject>(lookup->holder()),
1380 if (lookup->type() ==
FIELD) {
1383 GenerateFastPropertyLoad(masm(),
r0, holder_reg,
1384 Handle<JSObject>(lookup->holder()),
1385 lookup->GetFieldIndex());
1391 Handle<AccessorInfo> callback(
1398 __ Move(scratch2, callback);
1400 if (!receiver.is(holder_reg)) {
1401 ASSERT(scratch1.is(holder_reg));
1402 __ Push(receiver, holder_reg);
1405 __ push(holder_reg);
1409 __ mov(scratch1, Operand(ExternalReference::isolate_address()));
1410 __ Push(scratch3, scratch1, scratch2, name_reg);
1412 ExternalReference ref =
1413 ExternalReference(IC_Utility(IC::kLoadCallbackProperty),
1415 __ TailCallExternalReference(ref, 6, 1);
1420 Register holder_reg = CheckPrototypes(
object, receiver, interceptor_holder,
1421 scratch1, scratch2, scratch3,
1423 PushInterceptorArguments(masm(), receiver, holder_reg,
1424 name_reg, interceptor_holder);
1426 ExternalReference ref =
1427 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForLoad),
1429 __ TailCallExternalReference(ref, 6, 1);
1434 void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) {
1436 __ cmp(
r2, Operand(name));
1442 void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject>
object,
1443 Handle<JSObject> holder,
1444 Handle<String> name,
1446 ASSERT(holder->IsGlobalObject());
1449 const int argc = arguments().immediate();
1455 __ JumpIfSmi(
r0, miss);
1456 CheckPrototypes(
object,
r0, holder,
r3,
r1,
r4, name, miss);
1460 void CallStubCompiler::GenerateLoadFunctionFromCell(
1461 Handle<JSGlobalPropertyCell> cell,
1462 Handle<JSFunction>
function,
1465 __ mov(
r3, Operand(cell));
1469 if (heap()->InNewSpace(*
function)) {
1475 __ JumpIfSmi(
r1, miss);
1480 __ Move(
r3, Handle<SharedFunctionInfo>(function->shared()));
1484 __ cmp(
r1, Operand(
function));
1490 void CallStubCompiler::GenerateMissBranch() {
1492 isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
1495 __ Jump(code, RelocInfo::CODE_TARGET);
1500 Handle<JSObject> holder,
1502 Handle<String> name) {
1509 GenerateNameCheck(name, &miss);
1511 const int argc = arguments().immediate();
1516 __ JumpIfSmi(
r0, &miss);
1519 Register reg = CheckPrototypes(
object,
r0, holder,
r1,
r3,
r4, name, &miss);
1520 GenerateFastPropertyLoad(masm(),
r1, reg, holder, index);
1522 GenerateCallFunction(masm(),
object, arguments(), &miss, extra_state_);
1526 GenerateMissBranch();
1529 return GetCode(
FIELD, name);
1533 Handle<Code> CallStubCompiler::CompileArrayPushCall(
1534 Handle<Object>
object,
1535 Handle<JSObject> holder,
1536 Handle<JSGlobalPropertyCell> cell,
1537 Handle<JSFunction>
function,
1538 Handle<String> name) {
1548 if (!object->IsJSArray() || !cell.is_null())
return Handle<Code>::null();
1551 GenerateNameCheck(name, &miss);
1553 Register receiver =
r1;
1555 const int argc = arguments().immediate();
1559 __ JumpIfSmi(receiver, &miss);
1562 CheckPrototypes(Handle<JSObject>::cast(
object), receiver, holder,
r3,
r0,
r4,
1574 Label attempt_to_grow_elements;
1576 Register elements =
r6;
1577 Register end_elements =
r5;
1582 __ CheckMap(elements,
1584 Heap::kFixedArrayMapRootIndex,
1600 __ b(
gt, &attempt_to_grow_elements);
1603 Label with_write_barrier;
1605 __ JumpIfNotSmi(
r4, &with_write_barrier);
1613 __ add(end_elements, elements,
1615 const int kEndElementsOffset =
1623 __ bind(&with_write_barrier);
1627 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
1628 Label fast_object, not_fast_object;
1629 __ CheckFastObjectElements(
r3,
r7, ¬_fast_object);
1630 __ jmp(&fast_object);
1632 __ bind(¬_fast_object);
1633 __ CheckFastSmiElements(
r3,
r7, &call_builtin);
1636 Label try_holey_map;
1642 __ mov(
r2, receiver);
1645 __ jmp(&fast_object);
1647 __ bind(&try_holey_map);
1653 __ mov(
r2, receiver);
1656 __ bind(&fast_object);
1658 __ CheckFastObjectElements(
r3,
r3, &call_builtin);
1667 __ add(end_elements, elements,
1671 __ RecordWrite(elements,
1681 __ bind(&attempt_to_grow_elements);
1685 if (!FLAG_inline_new) {
1686 __ b(&call_builtin);
1692 Label no_fast_elements_check;
1693 __ JumpIfSmi(
r2, &no_fast_elements_check);
1695 __ CheckFastObjectElements(
r7,
r7, &call_builtin);
1696 __ bind(&no_fast_elements_check);
1698 Isolate* isolate = masm()->isolate();
1699 ExternalReference new_space_allocation_top =
1700 ExternalReference::new_space_allocation_top_address(isolate);
1701 ExternalReference new_space_allocation_limit =
1702 ExternalReference::new_space_allocation_limit_address(isolate);
1704 const int kAllocationDelta = 4;
1706 __ add(end_elements, elements,
1708 __ add(end_elements, end_elements, Operand(kEndElementsOffset));
1709 __ mov(
r7, Operand(new_space_allocation_top));
1711 __ cmp(end_elements,
r3);
1712 __ b(
ne, &call_builtin);
1714 __ mov(
r9, Operand(new_space_allocation_limit));
1716 __ add(
r3,
r3, Operand(kAllocationDelta * kPointerSize));
1718 __ b(
hi, &call_builtin);
1726 __ LoadRoot(
r3, Heap::kTheHoleValueRootIndex);
1727 for (
int i = 1; i < kAllocationDelta; i++) {
1740 __ bind(&call_builtin);
1741 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush,
1749 GenerateMissBranch();
1752 return GetCode(
function);
1756 Handle<Code> CallStubCompiler::CompileArrayPopCall(
1757 Handle<Object>
object,
1758 Handle<JSObject> holder,
1759 Handle<JSGlobalPropertyCell> cell,
1760 Handle<JSFunction>
function,
1761 Handle<String> name) {
1771 if (!object->IsJSArray() || !cell.is_null())
return Handle<Code>::null();
1773 Label miss, return_undefined, call_builtin;
1774 Register receiver =
r1;
1775 Register elements =
r3;
1776 GenerateNameCheck(name, &miss);
1779 const int argc = arguments().immediate();
1782 __ JumpIfSmi(receiver, &miss);
1785 CheckPrototypes(Handle<JSObject>::cast(
object), receiver, holder, elements,
1786 r4,
r0, name, &miss);
1792 __ CheckMap(elements,
1794 Heap::kFixedArrayMapRootIndex,
1801 __ b(
lt, &return_undefined);
1804 __ LoadRoot(
r6, Heap::kTheHoleValueRootIndex);
1812 __ b(
eq, &call_builtin);
1822 __ bind(&return_undefined);
1823 __ LoadRoot(
r0, Heap::kUndefinedValueRootIndex);
1827 __ bind(&call_builtin);
1828 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop,
1835 GenerateMissBranch();
1838 return GetCode(
function);
1842 Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
1843 Handle<Object>
object,
1844 Handle<JSObject> holder,
1845 Handle<JSGlobalPropertyCell> cell,
1846 Handle<JSFunction>
function,
1847 Handle<String> name) {
1857 if (!object->IsString() || !cell.is_null())
return Handle<Code>::null();
1859 const int argc = arguments().immediate();
1862 Label index_out_of_range;
1863 Label* index_out_of_range_label = &index_out_of_range;
1868 index_out_of_range_label = &miss;
1870 GenerateNameCheck(name, &name_miss);
1873 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1877 ASSERT(!
object.is_identical_to(holder));
1878 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1881 Register receiver =
r1;
1882 Register index =
r4;
1883 Register result =
r0;
1888 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1891 StringCharCodeAtGenerator generator(receiver,
1896 index_out_of_range_label,
1898 generator.GenerateFast(masm());
1902 StubRuntimeCallHelper call_helper;
1903 generator.GenerateSlow(masm(), call_helper);
1905 if (index_out_of_range.is_linked()) {
1906 __ bind(&index_out_of_range);
1907 __ LoadRoot(
r0, Heap::kNanValueRootIndex);
1915 __ bind(&name_miss);
1916 GenerateMissBranch();
1919 return GetCode(
function);
1923 Handle<Code> CallStubCompiler::CompileStringCharAtCall(
1924 Handle<Object>
object,
1925 Handle<JSObject> holder,
1926 Handle<JSGlobalPropertyCell> cell,
1927 Handle<JSFunction>
function,
1928 Handle<String> name) {
1938 if (!object->IsString() || !cell.is_null())
return Handle<Code>::null();
1940 const int argc = arguments().immediate();
1943 Label index_out_of_range;
1944 Label* index_out_of_range_label = &index_out_of_range;
1948 index_out_of_range_label = &miss;
1950 GenerateNameCheck(name, &name_miss);
1953 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1957 ASSERT(!
object.is_identical_to(holder));
1958 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1961 Register receiver =
r0;
1962 Register index =
r4;
1963 Register scratch =
r3;
1964 Register result =
r0;
1969 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1972 StringCharAtGenerator generator(receiver,
1978 index_out_of_range_label,
1980 generator.GenerateFast(masm());
1984 StubRuntimeCallHelper call_helper;
1985 generator.GenerateSlow(masm(), call_helper);
1987 if (index_out_of_range.is_linked()) {
1988 __ bind(&index_out_of_range);
1989 __ LoadRoot(
r0, Heap::kEmptyStringRootIndex);
1997 __ bind(&name_miss);
1998 GenerateMissBranch();
2001 return GetCode(
function);
2005 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
2006 Handle<Object>
object,
2007 Handle<JSObject> holder,
2008 Handle<JSGlobalPropertyCell> cell,
2009 Handle<JSFunction>
function,
2010 Handle<String> name) {
2019 const int argc = arguments().immediate();
2023 if (!object->IsJSObject() || argc != 1)
return Handle<Code>::null();
2026 GenerateNameCheck(name, &miss);
2028 if (cell.is_null()) {
2032 __ JumpIfSmi(r1, &miss);
2034 CheckPrototypes(Handle<JSObject>::cast(
object), r1, holder,
r0, r3, r4,
2037 ASSERT(cell->value() == *
function);
2038 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2040 GenerateLoadFunctionFromCell(cell,
function, &miss);
2050 __ JumpIfNotSmi(code, &slow);
2055 StringCharFromCodeGenerator generator(code,
r0);
2056 generator.GenerateFast(masm());
2060 StubRuntimeCallHelper call_helper;
2061 generator.GenerateSlow(masm(), call_helper);
2071 GenerateMissBranch();
2074 return cell.is_null() ? GetCode(
function) : GetCode(
NORMAL, name);
2078 Handle<Code> CallStubCompiler::CompileMathFloorCall(
2079 Handle<Object>
object,
2080 Handle<JSObject> holder,
2081 Handle<JSGlobalPropertyCell> cell,
2082 Handle<JSFunction>
function,
2083 Handle<String> name) {
2096 CpuFeatures::Scope scope_vfp3(
VFP3);
2097 const int argc = arguments().immediate();
2100 if (!object->IsJSObject() || argc != 1)
return Handle<Code>::null();
2103 GenerateNameCheck(name, &miss);
2105 if (cell.is_null()) {
2108 __ JumpIfSmi(r1, &miss);
2109 CheckPrototypes(Handle<JSObject>::cast(
object), r1, holder,
r0, r3, r4,
2112 ASSERT(cell->value() == *
function);
2113 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2115 GenerateLoadFunctionFromCell(cell,
function, &miss);
2124 __ Drop(argc + 1,
eq);
2129 Label wont_fit_smi, no_vfp_exception, restore_fpscr_and_return;
2160 __ mov(
r6, Operand(
r6,
LSR, HeapNumber::kMantissaBitsInTopWord));
2165 __ b(&no_vfp_exception,
eq);
2171 >> HeapNumber::kMantissaBitsInTopWord),
SetCC);
2172 __ b(&restore_fpscr_and_return,
eq);
2177 __ b(&restore_fpscr_and_return,
ge);
2178 __ b(&wont_fit_smi);
2180 __ bind(&no_vfp_exception);
2184 __ add(r1,
r0, Operand(0x40000000),
SetCC);
2185 __ b(&wont_fit_smi,
mi);
2192 __ b(&restore_fpscr_and_return,
ne);
2199 __ bind(&restore_fpscr_and_return);
2205 __ bind(&wont_fit_smi);
2217 GenerateMissBranch();
2220 return cell.is_null() ? GetCode(
function) : GetCode(
NORMAL, name);
2224 Handle<Code> CallStubCompiler::CompileMathAbsCall(
2225 Handle<Object>
object,
2226 Handle<JSObject> holder,
2227 Handle<JSGlobalPropertyCell> cell,
2228 Handle<JSFunction>
function,
2229 Handle<String> name) {
2238 const int argc = arguments().immediate();
2241 if (!object->IsJSObject() || argc != 1)
return Handle<Code>::null();
2244 GenerateNameCheck(name, &miss);
2245 if (cell.is_null()) {
2248 __ JumpIfSmi(r1, &miss);
2249 CheckPrototypes(Handle<JSObject>::cast(
object), r1, holder,
r0, r3, r4,
2252 ASSERT(cell->value() == *
function);
2253 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2255 GenerateLoadFunctionFromCell(cell,
function, &miss);
2264 __ JumpIfNotSmi(
r0, ¬_smi);
2290 Label negative_sign;
2292 __ b(
ne, &negative_sign);
2298 __ bind(&negative_sign);
2301 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
2302 __ AllocateHeapNumber(
r0, r4,
r5,
r6, &slow);
2316 GenerateMissBranch();
2319 return cell.is_null() ? GetCode(
function) : GetCode(
NORMAL, name);
2323 Handle<Code> CallStubCompiler::CompileFastApiCall(
2324 const CallOptimization& optimization,
2325 Handle<Object>
object,
2326 Handle<JSObject> holder,
2327 Handle<JSGlobalPropertyCell> cell,
2328 Handle<JSFunction>
function,
2329 Handle<String> name) {
2330 Counters* counters = isolate()->counters();
2332 ASSERT(optimization.is_simple_api_call());
2335 if (object->IsGlobalObject())
return Handle<Code>::null();
2336 if (!cell.is_null())
return Handle<Code>::null();
2337 if (!object->IsJSObject())
return Handle<Code>::null();
2338 int depth = optimization.GetPrototypeDepthOfExpectedType(
2339 Handle<JSObject>::cast(
object), holder);
2342 Label miss, miss_before_stack_reserved;
2343 GenerateNameCheck(name, &miss_before_stack_reserved);
2346 const int argc = arguments().immediate();
2350 __ JumpIfSmi(r1, &miss_before_stack_reserved);
2352 __ IncrementCounter(counters->call_const(), 1,
r0,
r3);
2353 __ IncrementCounter(counters->call_const_fast_api(), 1,
r0,
r3);
2355 ReserveSpaceForFastApiCall(masm(),
r0);
2358 CheckPrototypes(Handle<JSObject>::cast(
object), r1, holder,
r0, r3, r4, name,
2361 GenerateFastApiDirectCall(masm(), optimization, argc);
2364 FreeSpaceForFastApiCall(masm());
2366 __ bind(&miss_before_stack_reserved);
2367 GenerateMissBranch();
2370 return GetCode(
function);
2375 Handle<JSObject> holder,
2376 Handle<JSFunction>
function,
2377 Handle<String> name,
2384 Handle<Code> code = CompileCustomCall(
object, holder,
2385 Handle<JSGlobalPropertyCell>::null(),
2388 if (!code.is_null())
return code;
2392 GenerateNameCheck(name, &miss);
2395 const int argc = arguments().immediate();
2400 __ JumpIfSmi(r1, &miss);
2408 __ IncrementCounter(masm()->isolate()->counters()->call_const(),
2412 CheckPrototypes(Handle<JSObject>::cast(
object), r1, holder,
r0, r3, r4,
2417 if (object->IsGlobalObject()) {
2424 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2429 GenerateDirectLoadGlobalFunctionPrototype(
2442 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2445 __ JumpIfSmi(r1, &fast);
2450 GenerateDirectLoadGlobalFunctionPrototype(
2463 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2466 __ LoadRoot(
ip, Heap::kTrueValueRootIndex);
2469 __ LoadRoot(
ip, Heap::kFalseValueRootIndex);
2474 GenerateDirectLoadGlobalFunctionPrototype(
2491 function, arguments(),
JUMP_FUNCTION, NullCallWrapper(), call_kind);
2495 GenerateMissBranch();
2498 return GetCode(
function);
2503 Handle<JSObject> holder,
2504 Handle<String> name) {
2510 GenerateNameCheck(name, &miss);
2513 const int argc = arguments().immediate();
2514 LookupResult lookup(isolate());
2515 LookupPostInterceptor(holder, name, &lookup);
2520 CallInterceptorCompiler compiler(
this, arguments(),
r2, extra_state_);
2521 compiler.Compile(masm(),
object, holder, name, &lookup, r1, r3, r4,
r0,
2529 GenerateCallFunction(masm(),
object, arguments(), &miss, extra_state_);
2533 GenerateMissBranch();
2541 Handle<JSObject>
object,
2542 Handle<GlobalObject> holder,
2543 Handle<JSGlobalPropertyCell> cell,
2544 Handle<JSFunction>
function,
2545 Handle<String> name) {
2551 Handle<Code> code = CompileCustomCall(
object, holder, cell,
function, name);
2553 if (!code.is_null())
return code;
2557 GenerateNameCheck(name, &miss);
2560 const int argc = arguments().immediate();
2561 GenerateGlobalReceiverCheck(
object, holder, name, &miss);
2562 GenerateLoadFunctionFromCell(cell,
function, &miss);
2566 if (object->IsGlobalObject()) {
2575 Counters* counters = masm()->isolate()->counters();
2576 __ IncrementCounter(counters->call_global_inline(), 1,
r3,
r4);
2577 ParameterCount expected(function->shared()->formal_parameter_count());
2586 NullCallWrapper(), call_kind);
2590 __ IncrementCounter(counters->call_global_inline_miss(), 1,
r1,
r3);
2591 GenerateMissBranch();
2594 return GetCode(
NORMAL, name);
2600 Handle<Map> transition,
2601 Handle<String> name) {
2610 GenerateStoreField(masm(),
2618 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2619 __ Jump(ic, RelocInfo::CODE_TARGET);
2627 Handle<JSObject>
object,
2628 Handle<AccessorInfo> callback,
2629 Handle<String> name) {
2639 __ CheckMap(r1, r3, Handle<Map>(object->map()), &miss,
2643 if (object->IsJSGlobalProxy()) {
2644 __ CheckAccessGlobalProxy(r1, r3, &miss);
2649 ASSERT(object->IsJSGlobalProxy() || !
object->IsAccessCheckNeeded());
2652 __ mov(
ip, Operand(callback));
2656 ExternalReference store_callback_property =
2657 ExternalReference(IC_Utility(IC::kStoreCallbackProperty),
2659 __ TailCallExternalReference(store_callback_property, 4, 1);
2663 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2664 __ Jump(ic, RelocInfo::CODE_TARGET);
2672 Handle<JSObject> receiver,
2673 Handle<JSFunction> setter,
2674 Handle<String> name) {
2684 __ CheckMap(r1, r3, Handle<Map>(receiver->map()), &miss,
DO_SMI_CHECK,
2695 ParameterCount actual(1);
2708 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2709 __ Jump(ic, RelocInfo::CODE_TARGET);
2717 Handle<JSObject> receiver,
2718 Handle<String> name) {
2728 __ CheckMap(r1, r3, Handle<Map>(receiver->map()), &miss,
2732 if (receiver->IsJSGlobalProxy()) {
2733 __ CheckAccessGlobalProxy(r1, r3, &miss);
2738 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
2746 ExternalReference store_ic_property =
2747 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty),
2749 __ TailCallExternalReference(store_ic_property, 4, 1);
2753 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2754 __ Jump(ic, RelocInfo::CODE_TARGET);
2762 Handle<GlobalObject>
object,
2763 Handle<JSGlobalPropertyCell> cell,
2764 Handle<String> name) {
2775 __ cmp(r3, Operand(Handle<Map>(object->map())));
2782 __ mov(r4, Operand(cell));
2783 __ LoadRoot(
r5, Heap::kTheHoleValueRootIndex);
2792 Counters* counters = masm()->isolate()->counters();
2793 __ IncrementCounter(counters->named_store_global_inline(), 1,
r4,
r3);
2798 __ IncrementCounter(counters->named_store_global_inline_miss(), 1,
r4,
r3);
2799 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2800 __ Jump(ic, RelocInfo::CODE_TARGET);
2803 return GetCode(
NORMAL, name);
2808 Handle<JSObject>
object,
2809 Handle<JSObject> last) {
2817 __ JumpIfSmi(
r0, &miss);
2820 CheckPrototypes(
object,
r0, last, r3, r1, r4, name, &miss);
2824 if (last->IsGlobalObject()) {
2825 GenerateCheckPropertyCell(
2826 masm(), Handle<GlobalObject>::cast(last), name, r1, &miss);
2831 __ LoadRoot(
r0, Heap::kUndefinedValueRootIndex);
2838 return GetCode(
NONEXISTENT, factory()->empty_string());
2843 Handle<JSObject> holder,
2845 Handle<String> name) {
2853 GenerateLoadField(
object, holder,
r0, r3, r1, r4, index, name, &miss);
2858 return GetCode(
FIELD, name);
2863 Handle<String> name,
2864 Handle<JSObject>
object,
2865 Handle<JSObject> holder,
2866 Handle<AccessorInfo> callback) {
2873 GenerateLoadCallback(
object, holder,
r0,
r2, r3, r1, r4, callback, name,
2884 Handle<String> name,
2885 Handle<JSObject> receiver,
2886 Handle<JSObject> holder,
2887 Handle<JSFunction> getter) {
2896 __ JumpIfSmi(
r0, &miss);
2897 CheckPrototypes(receiver,
r0, holder, r3, r4, r1, name, &miss);
2904 ParameterCount actual(0);
2922 Handle<JSObject> holder,
2923 Handle<JSFunction> value,
2924 Handle<String> name) {
2932 GenerateLoadConstant(
object, holder,
r0, r3, r1, r4, value, name, &miss);
2942 Handle<JSObject> holder,
2943 Handle<String> name) {
2951 LookupResult lookup(isolate());
2952 LookupPostInterceptor(holder, name, &lookup);
2953 GenerateLoadInterceptor(
object, holder, &lookup,
r0,
r2, r3, r1, r4, name,
2964 Handle<JSObject>
object,
2965 Handle<GlobalObject> holder,
2966 Handle<JSGlobalPropertyCell> cell,
2967 Handle<String> name,
2968 bool is_dont_delete) {
2977 __ JumpIfSmi(
r0, &miss);
2978 CheckPrototypes(
object,
r0, holder, r3, r4, r1, name, &miss);
2981 __ mov(r3, Operand(cell));
2985 if (!is_dont_delete) {
2986 __ LoadRoot(
ip, Heap::kTheHoleValueRootIndex);
2992 Counters* counters = masm()->isolate()->counters();
2993 __ IncrementCounter(counters->named_load_global_stub(), 1,
r1,
r3);
2997 __ IncrementCounter(counters->named_load_global_stub_miss(), 1,
r1,
r3);
3001 return GetCode(
NORMAL, name);
3006 Handle<JSObject> receiver,
3007 Handle<JSObject> holder,
3017 __ cmp(
r0, Operand(name));
3020 GenerateLoadField(receiver, holder, r1,
r2, r3, r4, index, name, &miss);
3024 return GetCode(
FIELD, name);
3029 Handle<String> name,
3030 Handle<JSObject> receiver,
3031 Handle<JSObject> holder,
3032 Handle<AccessorInfo> callback) {
3041 __ cmp(
r0, Operand(name));
3044 GenerateLoadCallback(receiver, holder, r1,
r0,
r2, r3, r4, callback, name,
3054 Handle<String> name,
3055 Handle<JSObject> receiver,
3056 Handle<JSObject> holder,
3057 Handle<JSFunction> value) {
3066 __ cmp(
r0, Operand(name));
3069 GenerateLoadConstant(receiver, holder, r1,
r2, r3, r4, value, name, &miss);
3079 Handle<JSObject> receiver,
3080 Handle<JSObject> holder,
3081 Handle<String> name) {
3090 __ cmp(
r0, Operand(name));
3093 LookupResult lookup(isolate());
3094 LookupPostInterceptor(holder, name, &lookup);
3095 GenerateLoadInterceptor(receiver, holder, &lookup, r1,
r0,
r2, r3, r4, name,
3105 Handle<String> name) {
3114 __ cmp(
r0, Operand(name));
3117 GenerateLoadArrayLength(masm(), r1,
r2, &miss);
3126 Handle<String> name) {
3134 Counters* counters = masm()->isolate()->counters();
3135 __ IncrementCounter(counters->keyed_load_string_length(), 1,
r2,
r3);
3138 __ cmp(
r0, Operand(name));
3141 GenerateLoadStringLength(masm(), r1,
r2, r3, &miss,
true);
3143 __ DecrementCounter(counters->keyed_load_string_length(), 1,
r2,
r3);
3152 Handle<String> name) {
3160 Counters* counters = masm()->isolate()->counters();
3161 __ IncrementCounter(counters->keyed_load_function_prototype(), 1,
r2,
r3);
3164 __ cmp(
r0, Operand(name));
3167 GenerateLoadFunctionPrototype(masm(), r1,
r2, r3, &miss);
3169 __ DecrementCounter(counters->keyed_load_function_prototype(), 1,
r2,
r3);
3177 Handle<Map> receiver_map) {
3183 ElementsKind elements_kind = receiver_map->elements_kind();
3184 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
3188 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3189 __ Jump(ic, RelocInfo::CODE_TARGET);
3192 return GetCode(
NORMAL, factory()->empty_string());
3205 __ JumpIfSmi(r1, &miss);
3207 int receiver_count = receiver_maps->length();
3209 for (
int current = 0; current < receiver_count; ++current) {
3210 __ mov(
ip, Operand(receiver_maps->at(current)));
3212 __ Jump(handler_ics->at(current), RelocInfo::CODE_TARGET,
eq);
3216 Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss();
3217 __ Jump(miss_ic, RelocInfo::CODE_TARGET,
al);
3226 Handle<Map> transition,
3227 Handle<String> name) {
3236 Counters* counters = masm()->isolate()->counters();
3237 __ IncrementCounter(counters->keyed_store_field(), 1,
r3,
r4);
3240 __ cmp(r1, Operand(name));
3245 GenerateStoreField(masm(),
3254 __ DecrementCounter(counters->keyed_store_field(), 1,
r3,
r4);
3255 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
3256 __ Jump(ic, RelocInfo::CODE_TARGET);
3264 Handle<Map> receiver_map) {
3272 ElementsKind elements_kind = receiver_map->elements_kind();
3273 bool is_js_array = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
3275 KeyedStoreElementStub(is_js_array, elements_kind, grow_mode_).GetCode();
3279 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
3280 __ Jump(ic, RelocInfo::CODE_TARGET);
3283 return GetCode(
NORMAL, factory()->empty_string());
3299 __ JumpIfSmi(
r2, &miss);
3301 int receiver_count = receiver_maps->length();
3303 for (
int i = 0; i < receiver_count; ++i) {
3304 __ mov(
ip, Operand(receiver_maps->at(i)));
3306 if (transitioned_maps->at(i).is_null()) {
3307 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET,
eq);
3310 __ b(
ne, &next_map);
3311 __ mov(r3, Operand(transitioned_maps->at(i)));
3312 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET,
al);
3318 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss();
3319 __ Jump(miss_ic, RelocInfo::CODE_TARGET,
al);
3327 Handle<JSFunction>
function) {
3334 Label generic_stub_call;
3337 __ LoadRoot(
r7, Heap::kUndefinedValueRootIndex);
3339 #ifdef ENABLE_DEBUGGER_SUPPORT
3346 __ b(
ne, &generic_stub_call);
3353 __ JumpIfSmi(
r2, &generic_stub_call);
3355 __ b(
ne, &generic_stub_call);
3364 __ Check(
ne,
"Function constructed by construct stub.");
3383 __ LoadRoot(
r6, Heap::kEmptyFixedArrayRootIndex);
3405 Handle<SharedFunctionInfo> shared(function->shared());
3406 for (
int i = 0; i < shared->this_property_assignments_count(); i++) {
3407 if (shared->IsThisPropertyAssignmentArgument(i)) {
3408 Label not_passed, next;
3410 int arg_number = shared->GetThisPropertyAssignmentArgument(i);
3411 __ cmp(
r0, Operand(arg_number));
3412 __ b(
le, ¬_passed);
3417 __ bind(¬_passed);
3423 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i));
3424 __ mov(
r2, Operand(constant));
3430 ASSERT(function->has_initial_map());
3431 for (
int i = shared->this_property_assignments_count();
3432 i <
function->initial_map()->inobject_properties();
3448 __ add(
sp,
sp, Operand(kPointerSize));
3449 Counters* counters = masm()->isolate()->counters();
3450 __ IncrementCounter(counters->constructed_objects(), 1,
r1,
r2);
3451 __ IncrementCounter(counters->constructed_objects_stub(), 1,
r1,
r2);
3456 __ bind(&generic_stub_call);
3457 Handle<Code> code = masm()->isolate()->builtins()->JSConstructStubGeneric();
3458 __ Jump(code, RelocInfo::CODE_TARGET);
3466 #define __ ACCESS_MASM(masm)
3470 MacroAssembler* masm) {
3476 Label slow, miss_force_generic;
3479 Register receiver =
r1;
3481 __ JumpIfNotSmi(key, &miss_force_generic);
3484 __ LoadFromNumberDictionary(&slow, r4, key,
r0,
r2, r3,
r5);
3488 __ IncrementCounter(
3489 masm->isolate()->counters()->keyed_load_external_array_slow(),
3497 Handle<Code> slow_ic =
3498 masm->isolate()->builtins()->KeyedLoadIC_Slow();
3499 __ Jump(slow_ic, RelocInfo::CODE_TARGET);
3502 __ bind(&miss_force_generic);
3510 Handle<Code> miss_ic =
3511 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3512 __ Jump(miss_ic, RelocInfo::CODE_TARGET);
3516 static bool IsElementTypeSigned(
ElementsKind elements_kind) {
3517 switch (elements_kind) {
3546 static void GenerateSmiKeyCheck(MacroAssembler* masm,
3550 DwVfpRegister double_scratch0,
3553 CpuFeatures::Scope scope(
VFP3);
3558 __ JumpIfSmi(key, &key_ok);
3561 Heap::kHeapNumberMapRootIndex,
3567 double_scratch0.low(),
3573 __ vmov(scratch0, double_scratch0.low());
3574 __ TrySmiTag(scratch0, fail, scratch1);
3575 __ mov(key, scratch0);
3579 __ JumpIfNotSmi(key, fail);
3585 MacroAssembler* masm,
3592 Label miss_force_generic, slow, failed_allocation;
3595 Register receiver =
r1;
3601 GenerateSmiKeyCheck(masm, key, r4,
r5,
d1, &miss_force_generic);
3610 __ b(
hs, &miss_force_generic);
3619 Register value =
r2;
3620 switch (elements_kind) {
3640 CpuFeatures::Scope scope(
VFP3);
3641 __ add(
r2, r3, Operand(key,
LSL, 1));
3649 CpuFeatures::Scope scope(
VFP3);
3650 __ add(
r2, r3, Operand(key,
LSL, 2));
3653 __ add(r4, r3, Operand(key,
LSL, 2));
3685 __ cmp(value, Operand(0xC0000000));
3695 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3696 __ AllocateHeapNumber(
r5, r3, r4,
r6, &slow);
3701 CpuFeatures::Scope scope(
VFP3);
3729 CpuFeatures::Scope scope(
VFP3);
3730 Label box_int, done;
3731 __ tst(value, Operand(0xC0000000));
3742 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3743 __ AllocateHeapNumber(
r2, r3, r4,
r6, &slow);
3753 Label box_int_0, box_int_1, done;
3754 __ tst(value, Operand(0x80000000));
3755 __ b(
ne, &box_int_0);
3756 __ tst(value, Operand(0x40000000));
3757 __ b(
ne, &box_int_1);
3762 Register hiword = value;
3763 Register loword =
r3;
3765 __ bind(&box_int_0);
3767 GenerateUInt2Double(masm, hiword, loword, r4, 0);
3770 __ bind(&box_int_1);
3772 GenerateUInt2Double(masm, hiword, loword, r4, 1);
3780 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3781 __ AllocateHeapNumber(r4,
r5,
r7,
r6, &slow);
3793 CpuFeatures::Scope scope(
VFP3);
3797 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3798 __ AllocateHeapNumber(
r2, r3, r4,
r6, &slow);
3809 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3810 __ AllocateHeapNumber(r3, r4,
r5,
r6, &slow);
3825 Label exponent_rebiased;
3826 __ teq(r1, Operand(0x00));
3827 __ b(
eq, &exponent_rebiased);
3829 __ teq(r1, Operand(0xff));
3831 __ b(
eq, &exponent_rebiased);
3838 __ bind(&exponent_rebiased);
3841 __ orr(
r2,
r2, Operand(r1,
LSL, HeapNumber::kMantissaBitsInTopWord));
3844 static const int kMantissaShiftForHiWord =
3847 static const int kMantissaShiftForLoWord =
3850 __ orr(
r2,
r2, Operand(
r0,
LSR, kMantissaShiftForHiWord));
3851 __ mov(
r0, Operand(
r0,
LSL, kMantissaShiftForLoWord));
3861 CpuFeatures::Scope scope(
VFP3);
3865 __ LoadRoot(
r6, Heap::kHeapNumberMapRootIndex);
3866 __ AllocateHeapNumber(
r2, r3, r4,
r6, &slow);
3876 __ LoadRoot(
r7, Heap::kHeapNumberMapRootIndex);
3877 __ AllocateHeapNumber(r4,
r5,
r6,
r7, &slow);
3893 __ IncrementCounter(
3894 masm->isolate()->counters()->keyed_load_external_array_slow(),
3905 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
3907 __ bind(&miss_force_generic);
3909 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3910 __ Jump(stub, RelocInfo::CODE_TARGET);
3915 MacroAssembler* masm,
3923 Label slow, check_heap_number, miss_force_generic;
3926 Register value =
r0;
3928 Register receiver =
r2;
3935 GenerateSmiKeyCheck(masm, key, r4,
r5,
d1, &miss_force_generic);
3943 __ b(
hs, &miss_force_generic);
3950 __ JumpIfNotSmi(value, &slow);
3952 __ JumpIfNotSmi(value, &check_heap_number);
3954 __ SmiUntag(
r5, value);
3959 switch (elements_kind) {
3962 __ Usat(
r5, 8, Operand(
r5));
3979 __ SmiUntag(r4, key);
3980 StoreIntAsFloat(masm, r3, r4,
r5,
r6,
r7,
r9);
3983 __ add(r3, r3, Operand(key,
LSL, 2));
3992 masm,
r5, destination,
3996 CpuFeatures::Scope scope(
VFP3);
4020 __ bind(&check_heap_number);
4032 CpuFeatures::Scope scope(
VFP3);
4039 __ add(
r5, r3, Operand(key,
LSL, 1));
4045 __ add(
r5, r3, Operand(key,
LSL, 2));
4054 switch (elements_kind) {
4092 Label done, nan_or_infinity_or_zero;
4093 static const int kMantissaInHiWordShift =
4096 static const int kMantissaInLoWordShift =
4103 __ b(
eq, &nan_or_infinity_or_zero);
4107 __ b(
eq, &nan_or_infinity_or_zero);
4126 __ orr(
r7,
r7, Operand(
r5,
LSL, kMantissaInHiWordShift));
4127 __ orr(
r7,
r7, Operand(
r6,
LSR, kMantissaInLoWordShift));
4128 __ orr(
r5,
r7, Operand(
r9,
LSL, kBinary32ExponentShift));
4136 __ bind(&nan_or_infinity_or_zero);
4140 __ orr(
r9,
r9, Operand(
r5,
LSL, kMantissaInHiWordShift));
4141 __ orr(
r5,
r9, Operand(
r6,
LSR, kMantissaInLoWordShift));
4144 __ add(
r7, r3, Operand(key,
LSL, 2));
4150 bool is_signed_type = IsElementTypeSigned(elements_kind);
4152 int32_t min_value = is_signed_type ? 0x80000000 : 0x00000000;
4175 __ cmp(
r9, Operand(meaningfull_bits - 1));
4181 __ orr(
r5,
r5, Operand(1u << HeapNumber::kMantissaBitsInTopWord));
4183 __ rsb(
r9,
r9, Operand(HeapNumber::kMantissaBitsInTopWord),
SetCC);
4189 __ rsb(
r9,
r9, Operand(meaningfull_bits));
4197 switch (elements_kind) {
4230 __ IncrementCounter(
4231 masm->isolate()->counters()->keyed_load_external_array_slow(),
4239 Handle<Code> slow_ic =
4240 masm->isolate()->builtins()->KeyedStoreIC_Slow();
4241 __ Jump(slow_ic, RelocInfo::CODE_TARGET);
4244 __ bind(&miss_force_generic);
4252 Handle<Code> miss_ic =
4253 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4254 __ Jump(miss_ic, RelocInfo::CODE_TARGET);
4264 Label miss_force_generic;
4270 GenerateSmiKeyCheck(masm,
r0, r4,
r5,
d1, &miss_force_generic);
4274 __ AssertFastElements(
r2);
4278 __ cmp(
r0, Operand(r3));
4279 __ b(
hs, &miss_force_generic);
4286 __ LoadRoot(
ip, Heap::kTheHoleValueRootIndex);
4288 __ b(
eq, &miss_force_generic);
4292 __ bind(&miss_force_generic);
4294 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
4295 __ Jump(stub, RelocInfo::CODE_TARGET);
4300 MacroAssembler* masm) {
4306 Label miss_force_generic, slow_allocate_heapnumber;
4308 Register key_reg =
r0;
4309 Register receiver_reg =
r1;
4310 Register elements_reg =
r2;
4311 Register heap_number_reg =
r2;
4312 Register indexed_double_offset =
r3;
4313 Register scratch =
r4;
4314 Register scratch2 =
r5;
4315 Register scratch3 =
r6;
4316 Register heap_number_map =
r7;
4322 GenerateSmiKeyCheck(masm, key_reg, r4,
r5,
d1, &miss_force_generic);
4325 __ ldr(elements_reg,
4330 __ cmp(key_reg, Operand(scratch));
4331 __ b(
hs, &miss_force_generic);
4334 __ add(indexed_double_offset, elements_reg,
4336 uint32_t upper_32_offset = FixedArray::kHeaderSize +
sizeof(
kHoleNanLower32);
4339 __ b(&miss_force_generic,
eq);
4342 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
4343 __ AllocateHeapNumber(heap_number_reg, scratch2, scratch3,
4344 heap_number_map, &slow_allocate_heapnumber);
4351 FixedArray::kHeaderSize));
4355 __ mov(
r0, heap_number_reg);
4358 __ bind(&slow_allocate_heapnumber);
4359 Handle<Code> slow_ic =
4360 masm->isolate()->builtins()->KeyedLoadIC_Slow();
4361 __ Jump(slow_ic, RelocInfo::CODE_TARGET);
4363 __ bind(&miss_force_generic);
4364 Handle<Code> miss_ic =
4365 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
4366 __ Jump(miss_ic, RelocInfo::CODE_TARGET);
4371 MacroAssembler* masm,
4383 Label miss_force_generic, transition_elements_kind, grow, slow;
4384 Label finish_store, check_capacity;
4386 Register value_reg =
r0;
4387 Register key_reg =
r1;
4388 Register receiver_reg =
r2;
4389 Register scratch =
r4;
4390 Register elements_reg =
r3;
4391 Register length_reg =
r5;
4392 Register scratch2 =
r6;
4398 GenerateSmiKeyCheck(masm, key_reg, r4,
r5,
d1, &miss_force_generic);
4401 __ JumpIfNotSmi(value_reg, &transition_elements_kind);
4405 __ ldr(elements_reg,
4413 __ cmp(key_reg, scratch);
4417 __ b(
hs, &miss_force_generic);
4421 __ CheckMap(elements_reg,
4423 Heap::kFixedArrayMapRootIndex,
4424 &miss_force_generic,
4427 __ bind(&finish_store);
4447 __ mov(receiver_reg, value_reg);
4448 __ RecordWrite(elements_reg,
4458 __ bind(&miss_force_generic);
4460 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4461 __ Jump(ic, RelocInfo::CODE_TARGET);
4463 __ bind(&transition_elements_kind);
4464 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4465 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4473 __ b(
ne, &miss_force_generic);
4479 __ ldr(elements_reg,
4481 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex);
4482 __ b(
ne, &check_capacity);
4485 __ AllocateInNewSpace(size, elements_reg, scratch, scratch2, &slow,
4488 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex);
4492 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
4501 __ str(elements_reg,
4512 __ bind(&check_capacity);
4514 __ CheckMap(elements_reg,
4516 Heap::kFixedCOWArrayMapRootIndex,
4517 &miss_force_generic,
4521 __ cmp(length_reg, scratch);
4527 __ jmp(&finish_store);
4530 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
4531 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4537 MacroAssembler* masm,
4549 Label miss_force_generic, transition_elements_kind, grow, slow;
4550 Label finish_store, check_capacity;
4552 Register value_reg =
r0;
4553 Register key_reg =
r1;
4554 Register receiver_reg =
r2;
4555 Register elements_reg =
r3;
4556 Register scratch1 =
r4;
4557 Register scratch2 =
r5;
4558 Register scratch3 =
r6;
4559 Register scratch4 =
r7;
4560 Register length_reg =
r7;
4566 GenerateSmiKeyCheck(masm, key_reg, r4,
r5,
d1, &miss_force_generic);
4568 __ ldr(elements_reg,
4580 __ cmp(key_reg, scratch1);
4584 __ b(
hs, &miss_force_generic);
4587 __ bind(&finish_store);
4588 __ StoreNumberToDoubleElements(value_reg,
4596 &transition_elements_kind);
4600 __ bind(&miss_force_generic);
4602 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4603 __ Jump(ic, RelocInfo::CODE_TARGET);
4605 __ bind(&transition_elements_kind);
4606 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4607 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4615 __ b(
ne, &miss_force_generic);
4619 __ JumpIfSmi(value_reg, &value_is_smi);
4621 __ CompareRoot(scratch1, Heap::kHeapNumberMapRootIndex);
4622 __ b(
ne, &transition_elements_kind);
4623 __ bind(&value_is_smi);
4629 __ ldr(elements_reg,
4631 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex);
4632 __ b(
ne, &check_capacity);
4635 __ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow,
4640 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex);
4643 Operand(
Smi::FromInt(JSArray::kPreallocatedArrayElements)));
4648 __ str(elements_reg,
4657 __ ldr(elements_reg,
4659 __ jmp(&finish_store);
4661 __ bind(&check_capacity);
4665 __ cmp(length_reg, scratch1);
4671 __ jmp(&finish_store);
4674 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
4675 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4684 #endif // V8_TARGET_ARCH_ARM
static const int kBitFieldOffset
Handle< Code > CompileLoadFunctionPrototype(Handle< String > name)
Handle< Code > CompileLoadCallback(Handle< String > name, Handle< JSObject > object, Handle< JSObject > holder, Handle< AccessorInfo > callback)
const intptr_t kSmiTagMask
static const int kNotFound
static const int kCodeEntryOffset
Handle< Code > CompileStoreField(Handle< JSObject > object, int index, Handle< Map > transition, Handle< String > name)
static const int kPrototypeOrInitialMapOffset
static int SlotOffset(int index)
static const int kDataOffset
const int kBinary32ExponentShift
Handle< Code > CompileLoadNonexistent(Handle< String > name, Handle< JSObject > object, Handle< JSObject > last)
const int kDoubleSizeLog2
Handle< Code > CompileStoreElement(Handle< Map > receiver_map)
void GenerateProbe(MacroAssembler *masm, Code::Flags flags, Register receiver, Register name, Register scratch, Register extra, Register extra2=no_reg, Register extra3=no_reg)
static const uint32_t kExponentMask
static const int kFlagsOffset
const uint32_t kBinary32MantissaMask
const int kBinary32MaxExponent
static Smi * FromInt(int value)
bool IsFastObjectElementsKind(ElementsKind kind)
#define LOG(isolate, Call)
static void GenerateStoreExternalArray(MacroAssembler *masm, ElementsKind elements_kind)
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
Handle< Code > CompileStoreViaSetter(Handle< JSObject > receiver, Handle< JSFunction > setter, Handle< String > name)
static const int kGlobalReceiverOffset
static void GenerateLoadFastDoubleElement(MacroAssembler *masm)
static PropertyType ExtractTypeFromFlags(Flags flags)
const int kBinary32MantissaBits
static const int kExponentBias
static bool IsSupported(CpuFeature f)
static const int kExternalPointerOffset
static const int kHasNamedInterceptor
static const int kIsAccessCheckNeeded
List< Handle< Map > > MapHandleList
#define ASSERT(condition)
Handle< Code > CompileStoreCallback(Handle< JSObject > object, Handle< AccessorInfo > callback, Handle< String > name)
const int kPointerSizeLog2
static const int kInstanceSizeOffset
static const int kDebugInfoOffset
static const int kGlobalContextOffset
static const int kContextOffset
Handle< Code > CompileLoadField(Handle< JSObject > object, Handle< JSObject > holder, int index, Handle< String > name)
Handle< Code > CompileStoreInterceptor(Handle< JSObject > object, Handle< String > name)
static void GenerateNegativeLookup(MacroAssembler *masm, Label *miss, Label *done, Register receiver, Register properties, Handle< String > name, Register scratch0)
Handle< Code > CompileStoreField(Handle< JSObject > object, int index, Handle< Map > transition, Handle< String > name)
static const int kHashFieldOffset
const uint32_t kVFPFlushToZeroMask
Handle< Code > CompileLoadInterceptor(Handle< JSObject > object, Handle< JSObject > holder, Handle< String > name)
STATIC_ASSERT((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
static const int kLengthOffset
Handle< Code > CompileCallGlobal(Handle< JSObject > object, Handle< GlobalObject > holder, Handle< JSGlobalPropertyCell > cell, Handle< JSFunction > function, Handle< String > name)
static const int kExponentShift
Handle< Code > CompileLoadField(Handle< String > name, Handle< JSObject > object, Handle< JSObject > holder, int index)
static const int kValueOffset
const uint32_t kHoleNanUpper32
Handle< Code > CompileStoreGlobal(Handle< GlobalObject > object, Handle< JSGlobalPropertyCell > holder, Handle< String > name)
Handle< Code > CompileLoadViaGetter(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > getter)
Handle< Code > CompileLoadConstant(Handle< JSObject > object, Handle< JSObject > holder, Handle< JSFunction > value, Handle< String > name)
Handle< Code > CompileLoadConstant(Handle< String > name, Handle< JSObject > object, Handle< JSObject > holder, Handle< JSFunction > value)
Handle< Code > CompileCallField(Handle< JSObject > object, Handle< JSObject > holder, int index, Handle< String > name)
static void GenerateStoreFastElement(MacroAssembler *masm, bool is_js_array, ElementsKind element_kind, KeyedAccessGrowMode grow_mode)
Handle< Code > CompileLoadStringLength(Handle< String > name)
const uint32_t kHoleNanLower32
static bool decode(uint32_t value)
static const int kPropertiesOffset
const int kBinary32MinExponent
Handle< Code > CompileLoadGlobal(Handle< JSObject > object, Handle< GlobalObject > holder, Handle< JSGlobalPropertyCell > cell, Handle< String > name, bool is_dont_delete)
bool IsFastSmiElementsKind(ElementsKind kind)
const uint32_t kVFPExceptionMask
static void GenerateMapChangeElementsTransition(MacroAssembler *masm)
const int kBinary32ExponentBias
static const int kDataOffset
static int SizeFor(int length)
static const int kElementsOffset
const uint32_t kStringTag
static void GenerateLoadDictionaryElement(MacroAssembler *masm)
static void GenerateLoadExternalArray(MacroAssembler *masm, ElementsKind elements_kind)
static const int kLengthOffset
static int SizeFor(int length)
static const int kHeaderSize
static const int kMapOffset
static const int kMantissaBitsInTopWord
const uint32_t kIsNotStringMask
List< Handle< Code > > CodeHandleList
static const int kLengthOffset
static void ConvertIntToDouble(MacroAssembler *masm, Register int_scratch, Destination destination, DwVfpRegister double_dst, Register dst1, Register dst2, Register scratch2, SwVfpRegister single_scratch)
Handle< Code > CompileCallInterceptor(Handle< JSObject > object, Handle< JSObject > holder, Handle< String > name)
MemOperand FieldMemOperand(Register object, int offset)
static const int kDataOffset
static const int kContextOffset
static void GenerateLoadFastElement(MacroAssembler *masm)
static const uint32_t kSignMask
static void GenerateStoreFastDoubleElement(MacroAssembler *masm, bool is_js_array, KeyedAccessGrowMode grow_mode)
static const int kHeaderSize
static Handle< T > null()
#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
Handle< Code > CompileLoadArrayLength(Handle< String > name)
static const uint32_t kMantissaMask
Handle< Code > CompileCallConstant(Handle< Object > object, Handle< JSObject > holder, Handle< JSFunction > function, Handle< String > name, CheckType check)
static AccessorInfo * cast(Object *obj)
const uint32_t kBinary32ExponentMask
const uint32_t kBinary32SignMask
const int kHeapObjectTagSize
static const int kSizeInBytes
static Handle< JSGlobalPropertyCell > EnsurePropertyCell(Handle< GlobalObject > global, Handle< String > name)
static bool HasCustomCallGenerator(Handle< JSFunction > function)
static const int kPreallocatedArrayElements
static const int kPrototypeOffset
static const int kFlagsNotUsedInLookup
const int kInvalidProtoDepth
const uint32_t kVFPRoundingModeMask
static const int kValueOffset
Handle< Code > CompileLoadCallback(Handle< String > name, Handle< JSObject > object, Handle< JSObject > holder, Handle< AccessorInfo > callback)
Handle< Code > CompileLoadPolymorphic(MapHandleList *receiver_maps, CodeHandleList *handler_ics)
Handle< Code > CompileLoadInterceptor(Handle< JSObject > object, Handle< JSObject > holder, Handle< String > name)
Handle< Code > CompileStorePolymorphic(MapHandleList *receiver_maps, CodeHandleList *handler_stubs, MapHandleList *transitioned_maps)
static const int kSharedFunctionInfoOffset
static const int kMantissaBits
void check(i::Vector< const char > string)
static const int kExponentOffset
static const int kValueOffset
Handle< Code > CompileLoadElement(Handle< Map > receiver_map)
Handle< Code > CompileConstructStub(Handle< JSFunction > function)
static JSObject * cast(Object *obj)
static const int kInstanceTypeOffset
static const int kMantissaOffset
static JSFunction * cast(Object *obj)