30 #if defined(V8_TARGET_ARCH_IA32)
39 #define __ ACCESS_MASM(masm)
42 static void ProbeTable(Isolate* isolate,
51 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
52 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
53 ExternalReference map_offset(isolate->stub_cache()->map_reference(table));
58 __ lea(offset, Operand(offset, offset,
times_2, 0));
60 if (extra.is_valid()) {
62 __ mov(extra, Operand::StaticArray(offset,
times_1, value_offset));
65 __ cmp(name, Operand::StaticArray(offset,
times_1, key_offset));
69 __ mov(offset, Operand::StaticArray(offset,
times_1, map_offset));
76 __ cmp(offset, flags);
97 __ cmp(name, Operand::StaticArray(offset,
times_1, key_offset));
101 __ mov(offset, Operand::StaticArray(offset,
times_1, map_offset));
106 __ mov(offset, Operand(
esp, 0));
109 __ mov(offset, Operand::StaticArray(offset,
times_1, value_offset));
114 __ cmp(offset, flags);
127 __ mov(offset, Operand::StaticArray(offset,
times_1, value_offset));
145 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
152 Counters* counters = masm->isolate()->counters();
153 __ IncrementCounter(counters->negative_lookups(), 1);
154 __ IncrementCounter(counters->negative_lookups_miss(), 1);
158 const int kInterceptorOrAccessCheckNeededMask =
163 kInterceptorOrAccessCheckNeededMask);
171 Register properties =
r0;
176 Immediate(masm->isolate()->factory()->hash_table_map()));
187 __ DecrementCounter(counters->negative_lookups_miss(), 1);
203 ASSERT(
sizeof(Entry) == 12);
209 ASSERT(!scratch.is(receiver));
210 ASSERT(!scratch.is(name));
211 ASSERT(!extra.is(receiver));
213 ASSERT(!extra.is(scratch));
220 Register offset = scratch;
223 Counters* counters = masm->isolate()->counters();
224 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1);
227 __ JumpIfSmi(receiver, &miss);
232 __ xor_(offset, flags);
241 ProbeTable(
isolate(), masm, flags,
kPrimary, name, receiver, offset, extra);
246 __ xor_(offset, flags);
248 __ sub(offset, name);
249 __ add(offset, Immediate(flags));
259 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
263 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
265 Register prototype) {
266 __ LoadGlobalFunction(index, prototype);
267 __ LoadGlobalFunctionInitialMap(prototype, prototype);
273 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
274 MacroAssembler* masm,
280 masm->isolate()->global_object());
283 Handle<JSFunction>
function(
286 __ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
292 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
297 __ JumpIfSmi(receiver, miss_label);
311 static void GenerateStringCheck(MacroAssembler* masm,
315 Label* non_string_object) {
317 __ JumpIfSmi(receiver, smi);
328 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
333 bool support_wrappers) {
338 GenerateStringCheck(masm, receiver, scratch1, miss,
339 support_wrappers ? &check_wrapper : miss);
345 if (support_wrappers) {
347 __ bind(&check_wrapper);
354 GenerateStringCheck(masm, scratch2, scratch1, miss, miss);
361 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
366 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
367 __ mov(
eax, scratch1);
375 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
378 Handle<JSObject> holder,
381 index -= holder->map()->inobject_properties();
384 int offset = holder->map()->instance_size() + (index *
kPointerSize);
395 static void PushInterceptorArguments(MacroAssembler* masm,
399 Handle<JSObject> holder_obj) {
401 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
402 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
403 Register scratch = name;
404 __ mov(scratch, Immediate(interceptor));
409 __ push(Immediate(reinterpret_cast<int>(masm->isolate())));
413 static void CompileCallLoadPropertyWithInterceptor(
414 MacroAssembler* masm,
418 Handle<JSObject> holder_obj) {
419 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
420 __ CallExternalReference(
421 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
428 static const int kFastApiCallArguments = 4;
435 static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
441 for (
int i = 0; i < kFastApiCallArguments; i++) {
449 static void FreeSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
465 static void GenerateFastApiCall(MacroAssembler* masm,
466 const CallOptimization& optimization,
483 Handle<JSFunction>
function = optimization.constant_function();
484 __ LoadHeapObject(
edi,
function);
489 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
490 Handle<Object> call_data(api_call_info->data());
491 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
492 __ mov(
ecx, api_call_info);
499 Immediate(reinterpret_cast<int>(masm->isolate())));
504 const int kApiArgc = 1;
508 const int kApiStackSpace = 4;
510 __ PrepareCallApiFunction(kApiArgc + kApiStackSpace);
524 Address function_address = v8::ToCData<Address>(api_call_info->callback());
525 __ CallApiFunctionAndReturn(function_address,
526 argc + kFastApiCallArguments + 1);
532 CallInterceptorCompiler(StubCompiler* stub_compiler,
533 const ParameterCount& arguments,
536 : stub_compiler_(stub_compiler),
537 arguments_(arguments),
539 extra_state_(extra_state) {}
541 void Compile(MacroAssembler* masm,
542 Handle<JSObject>
object,
543 Handle<JSObject> holder,
545 LookupResult* lookup,
551 ASSERT(holder->HasNamedInterceptor());
552 ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
555 __ JumpIfSmi(receiver, miss);
557 CallOptimization optimization(lookup);
558 if (optimization.is_constant_call()) {
559 CompileCacheable(masm,
object, receiver, scratch1, scratch2, scratch3,
560 holder, lookup, name, optimization, miss);
562 CompileRegular(masm,
object, receiver, scratch1, scratch2, scratch3,
568 void CompileCacheable(MacroAssembler* masm,
569 Handle<JSObject>
object,
574 Handle<JSObject> interceptor_holder,
575 LookupResult* lookup,
577 const CallOptimization& optimization,
579 ASSERT(optimization.is_constant_call());
580 ASSERT(!lookup->holder()->IsGlobalObject());
584 bool can_do_fast_api_call =
false;
585 if (optimization.is_simple_api_call() &&
586 !lookup->holder()->IsGlobalObject()) {
587 depth1 = optimization.GetPrototypeDepthOfExpectedType(
588 object, interceptor_holder);
590 depth2 = optimization.GetPrototypeDepthOfExpectedType(
591 interceptor_holder, Handle<JSObject>(lookup->holder()));
593 can_do_fast_api_call =
597 Counters* counters = masm->isolate()->counters();
598 __ IncrementCounter(counters->call_const_interceptor(), 1);
600 if (can_do_fast_api_call) {
601 __ IncrementCounter(counters->call_const_interceptor_fast_api(), 1);
602 ReserveSpaceForFastApiCall(masm, scratch1);
608 Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
610 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
611 scratch1, scratch2, scratch3,
616 Label regular_invoke;
617 LoadWithInterceptor(masm, receiver, holder, interceptor_holder,
625 if (*interceptor_holder != lookup->holder()) {
626 stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
627 Handle<JSObject>(lookup->holder()),
628 scratch1, scratch2, scratch3,
639 if (can_do_fast_api_call) {
640 GenerateFastApiCall(masm, optimization, arguments_.immediate());
645 __ InvokeFunction(optimization.constant_function(), arguments_,
650 if (can_do_fast_api_call) {
651 __ bind(&miss_cleanup);
652 FreeSpaceForFastApiCall(masm, scratch1);
657 __ bind(®ular_invoke);
658 if (can_do_fast_api_call) {
659 FreeSpaceForFastApiCall(masm, scratch1);
663 void CompileRegular(MacroAssembler* masm,
664 Handle<JSObject>
object,
670 Handle<JSObject> interceptor_holder,
673 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
674 scratch1, scratch2, scratch3,
681 PushInterceptorArguments(masm, receiver, holder, name_, interceptor_holder);
683 __ CallExternalReference(
684 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
694 void LoadWithInterceptor(MacroAssembler* masm,
697 Handle<JSObject> holder_obj,
698 Label* interceptor_succeeded) {
704 CompileCallLoadPropertyWithInterceptor(masm,
715 __ cmp(
eax, masm->isolate()->factory()->no_interceptor_result_sentinel());
719 StubCompiler* stub_compiler_;
720 const ParameterCount& arguments_;
726 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm,
Code::Kind kind) {
727 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
728 Handle<Code>
code = (kind == Code::LOAD_IC)
729 ? masm->isolate()->builtins()->LoadIC_Miss()
730 : masm->isolate()->builtins()->KeyedLoadIC_Miss();
731 __ jmp(code, RelocInfo::CODE_TARGET);
735 void StubCompiler::GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm) {
737 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
738 __ jmp(code, RelocInfo::CODE_TARGET);
744 void StubCompiler::GenerateStoreField(MacroAssembler* masm,
745 Handle<JSObject>
object,
747 Handle<Map> transition,
749 Register receiver_reg,
754 LookupResult lookup(masm->isolate());
755 object->Lookup(*name, &lookup);
756 if (lookup.IsFound() && (lookup.IsReadOnly() || !lookup.IsCacheable())) {
767 __ CheckMap(receiver_reg, Handle<Map>(object->map()),
771 if (object->IsJSGlobalProxy()) {
772 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
776 if (!transition.is_null() &&
object->GetPrototype()->IsJSObject()) {
778 if (lookup.IsFound()) {
779 holder = lookup.holder();
785 }
while (holder->GetPrototype()->IsJSObject());
789 Label miss_pop, done_check;
790 CheckPrototypes(
object, receiver_reg, Handle<JSObject>(holder), name_reg,
791 scratch1, scratch2, name, &miss_pop);
796 __ bind(&done_check);
802 ASSERT(object->IsJSGlobalProxy() || !
object->IsAccessCheckNeeded());
805 if (!transition.is_null() && (
object->map()->unused_property_fields() == 0)) {
809 __ push(receiver_reg);
810 __ push(Immediate(transition));
813 __ TailCallExternalReference(
814 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
821 if (!transition.is_null()) {
823 __ mov(scratch1, Immediate(transition));
828 __ RecordWriteField(receiver_reg,
840 index -=
object->map()->inobject_properties();
844 int offset =
object->map()->instance_size() + (index *
kPointerSize);
849 __ mov(name_reg,
eax);
850 __ RecordWriteField(receiver_reg,
864 __ mov(name_reg,
eax);
865 __ RecordWriteField(scratch1,
880 static void GenerateCheckPropertyCell(MacroAssembler* masm,
881 Handle<GlobalObject> global,
885 Handle<JSGlobalPropertyCell> cell =
887 ASSERT(cell->value()->IsTheHole());
888 Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value();
890 __ mov(scratch, Immediate(cell));
892 Immediate(the_hole));
894 __ cmp(Operand::Cell(cell), Immediate(the_hole));
902 static void GenerateCheckPropertyCells(MacroAssembler* masm,
903 Handle<JSObject>
object,
904 Handle<JSObject> holder,
908 Handle<JSObject> current = object;
909 while (!current.is_identical_to(holder)) {
910 if (current->IsGlobalObject()) {
911 GenerateCheckPropertyCell(masm,
912 Handle<GlobalObject>::cast(current),
917 current = Handle<JSObject>(
JSObject::cast(current->GetPrototype()));
922 #define __ ACCESS_MASM(masm())
925 Register StubCompiler::CheckPrototypes(Handle<JSObject>
object,
927 Handle<JSObject> holder,
935 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
936 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
937 && !scratch2.is(scratch1));
940 Register reg = object_reg;
941 Handle<JSObject> current = object;
944 if (save_at_depth == depth) {
950 while (!current.is_identical_to(holder)) {
955 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
957 Handle<JSObject> prototype(
JSObject::cast(current->GetPrototype()));
958 if (!current->HasFastProperties() &&
959 !current->IsJSGlobalObject() &&
960 !current->IsJSGlobalProxy()) {
961 if (!name->IsSymbol()) {
962 name = factory()->LookupSymbol(name);
964 ASSERT(current->property_dictionary()->FindEntry(*name) ==
967 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
974 bool in_new_space = heap()->InNewSpace(*prototype);
975 Handle<Map> current_map(current->map());
986 if (current->IsJSGlobalProxy()) {
987 __ CheckAccessGlobalProxy(reg, scratch2, miss);
997 __ mov(reg, prototype);
1001 if (save_at_depth == depth) {
1006 current = prototype;
1008 ASSERT(current.is_identical_to(holder));
1011 LOG(isolate(), IntEvent(
"check-maps-depth", depth + 1));
1014 __ CheckMap(reg, Handle<Map>(holder->map()),
1018 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
1019 if (holder->IsJSGlobalProxy()) {
1020 __ CheckAccessGlobalProxy(reg, scratch1, miss);
1026 GenerateCheckPropertyCells(masm(),
object, holder, name, scratch1, miss);
1033 void StubCompiler::GenerateLoadField(Handle<JSObject>
object,
1034 Handle<JSObject> holder,
1040 Handle<String> name,
1043 __ JumpIfSmi(receiver, miss);
1046 Register reg = CheckPrototypes(
1047 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1050 GenerateFastPropertyLoad(masm(),
eax, reg, holder, index);
1055 void StubCompiler::GenerateDictionaryLoadCallback(Register receiver,
1060 Handle<AccessorInfo> callback,
1061 Handle<String> name,
1063 ASSERT(!receiver.is(scratch2));
1064 ASSERT(!receiver.is(scratch3));
1065 Register dictionary = scratch1;
1066 bool must_preserve_dictionary_reg = receiver.is(dictionary);
1069 if (must_preserve_dictionary_reg) {
1070 __ push(dictionary);
1075 Label probe_done, pop_and_miss;
1083 __ bind(&pop_and_miss);
1084 if (must_preserve_dictionary_reg) {
1088 __ bind(&probe_done);
1092 Register index = scratch2;
1093 const int kElementsStartOffset =
1096 const int kValueOffset = kElementsStartOffset +
kPointerSize;
1099 if (must_preserve_dictionary_reg) {
1102 __ cmp(scratch3, callback);
1107 void StubCompiler::GenerateLoadCallback(Handle<JSObject>
object,
1108 Handle<JSObject> holder,
1115 Handle<AccessorInfo> callback,
1116 Handle<String> name,
1119 __ JumpIfSmi(receiver, miss);
1122 Register reg = CheckPrototypes(
object, receiver, holder, scratch1,
1123 scratch2, scratch3, name, miss);
1125 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
1126 GenerateDictionaryLoadCallback(
1127 reg, name_reg, scratch1, scratch2, scratch3, callback, name, miss);
1131 ASSERT(!scratch3.is(reg));
1135 __ mov(scratch2,
esp);
1136 ASSERT(!scratch2.is(reg));
1139 if (isolate()->heap()->InNewSpace(callback->data())) {
1140 __ mov(scratch1, Immediate(callback));
1143 __ push(Immediate(Handle<Object>(callback->data())));
1145 __ push(Immediate(reinterpret_cast<int>(isolate())));
1158 const int kStackSpace = 6;
1159 const int kApiArgc = 2;
1161 __ PrepareCallApiFunction(kApiArgc);
1163 __ add(
ebx, Immediate(kPointerSize));
1170 Address getter_address = v8::ToCData<Address>(callback->getter());
1171 __ CallApiFunctionAndReturn(getter_address, kStackSpace);
1175 void StubCompiler::GenerateLoadConstant(Handle<JSObject>
object,
1176 Handle<JSObject> holder,
1181 Handle<JSFunction> value,
1182 Handle<String> name,
1185 __ JumpIfSmi(receiver, miss);
1189 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1192 __ LoadHeapObject(
eax, value);
1197 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject>
object,
1198 Handle<JSObject> interceptor_holder,
1199 LookupResult* lookup,
1205 Handle<String> name,
1207 ASSERT(interceptor_holder->HasNamedInterceptor());
1208 ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
1211 __ JumpIfSmi(receiver, miss);
1216 bool compile_followup_inline =
false;
1217 if (lookup->IsFound() && lookup->IsCacheable()) {
1218 if (lookup->IsField()) {
1219 compile_followup_inline =
true;
1220 }
else if (lookup->type() ==
CALLBACKS &&
1221 lookup->GetCallbackObject()->IsAccessorInfo()) {
1223 compile_followup_inline = callback->getter() !=
NULL &&
1224 callback->IsCompatibleReceiver(*
object);
1228 if (compile_followup_inline) {
1232 Register holder_reg = CheckPrototypes(
object, receiver, interceptor_holder,
1233 scratch1, scratch2, scratch3,
1235 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
1241 bool must_perfrom_prototype_check = *interceptor_holder != lookup->holder();
1242 bool must_preserve_receiver_reg = !receiver.is(holder_reg) &&
1243 (lookup->type() ==
CALLBACKS || must_perfrom_prototype_check);
1250 if (must_preserve_receiver_reg) {
1253 __ push(holder_reg);
1259 CompileCallLoadPropertyWithInterceptor(masm(),
1263 interceptor_holder);
1267 Label interceptor_failed;
1268 __ cmp(
eax, factory()->no_interceptor_result_sentinel());
1269 __ j(
equal, &interceptor_failed);
1270 frame_scope.GenerateLeaveFrame();
1274 __ bind(&interceptor_failed);
1275 if (FLAG_debug_code) {
1276 __ mov(receiver, Immediate(BitCast<int32_t>(
kZapValue)));
1277 __ mov(holder_reg, Immediate(BitCast<int32_t>(
kZapValue)));
1278 __ mov(name_reg, Immediate(BitCast<int32_t>(
kZapValue)));
1283 if (must_preserve_receiver_reg) {
1292 if (must_perfrom_prototype_check) {
1293 holder_reg = CheckPrototypes(interceptor_holder,
1295 Handle<JSObject>(lookup->holder()),
1303 if (lookup->IsField()) {
1306 GenerateFastPropertyLoad(masm(),
eax, holder_reg,
1307 Handle<JSObject>(lookup->holder()),
1308 lookup->GetFieldIndex());
1314 Handle<AccessorInfo> callback(
1323 __ push(holder_reg);
1324 __ mov(holder_reg, Immediate(callback));
1326 __ push(Immediate(reinterpret_cast<int>(isolate())));
1327 __ push(holder_reg);
1331 ExternalReference ref =
1332 ExternalReference(IC_Utility(IC::kLoadCallbackProperty),
1334 __ TailCallExternalReference(ref, 6, 1);
1339 Register holder_reg =
1340 CheckPrototypes(
object, receiver, interceptor_holder,
1341 scratch1, scratch2, scratch3, name, miss);
1343 PushInterceptorArguments(masm(), receiver, holder_reg,
1344 name_reg, interceptor_holder);
1347 ExternalReference ref =
1348 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForLoad),
1350 __ TailCallExternalReference(ref, 6, 1);
1355 void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) {
1356 if (kind_ == Code::KEYED_CALL_IC) {
1357 __ cmp(
ecx, Immediate(name));
1363 void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject>
object,
1364 Handle<JSObject> holder,
1365 Handle<String> name,
1367 ASSERT(holder->IsGlobalObject());
1370 const int argc = arguments().immediate();
1373 __ mov(
edx, Operand(
esp, (argc + 1) * kPointerSize));
1377 __ JumpIfSmi(
edx, miss);
1378 CheckPrototypes(
object,
edx, holder,
ebx,
eax,
edi, name, miss);
1382 void CallStubCompiler::GenerateLoadFunctionFromCell(
1383 Handle<JSGlobalPropertyCell> cell,
1384 Handle<JSFunction>
function,
1388 __ mov(
edi, Immediate(cell));
1391 __ mov(
edi, Operand::Cell(cell));
1395 if (isolate()->heap()->InNewSpace(*
function)) {
1401 __ JumpIfSmi(
edi, miss);
1407 Immediate(Handle<SharedFunctionInfo>(function->shared())));
1409 __ cmp(
edi, Immediate(
function));
1415 void CallStubCompiler::GenerateMissBranch() {
1417 isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
1420 __ jmp(code, RelocInfo::CODE_TARGET);
1425 Handle<JSObject> holder,
1427 Handle<String> name) {
1437 GenerateNameCheck(name, &miss);
1440 const int argc = arguments().immediate();
1441 __ mov(
edx, Operand(
esp, (argc + 1) * kPointerSize));
1444 __ JumpIfSmi(
edx, &miss);
1447 Register reg = CheckPrototypes(
object,
edx, holder,
ebx,
eax,
edi,
1450 GenerateFastPropertyLoad(masm(),
edi, reg, holder, index);
1453 __ JumpIfSmi(
edi, &miss);
1459 if (object->IsGlobalObject()) {
1461 __ mov(Operand(
esp, (argc + 1) * kPointerSize),
edx);
1469 NullCallWrapper(), call_kind);
1473 GenerateMissBranch();
1480 Handle<Code> CallStubCompiler::CompileArrayPushCall(
1481 Handle<Object>
object,
1482 Handle<JSObject> holder,
1483 Handle<JSGlobalPropertyCell> cell,
1484 Handle<JSFunction>
function,
1485 Handle<String> name) {
1495 if (!object->IsJSArray() || !cell.is_null()) {
1501 GenerateNameCheck(name, &miss);
1504 const int argc = arguments().immediate();
1505 __ mov(
edx, Operand(
esp, (argc + 1) * kPointerSize));
1508 __ JumpIfSmi(
edx, &miss);
1510 CheckPrototypes(Handle<JSObject>::cast(
object),
edx, holder,
ebx,
eax,
edi,
1516 __ ret((argc + 1) * kPointerSize);
1521 Label attempt_to_grow_elements, with_write_barrier;
1528 Immediate(factory()->fixed_array_map()));
1542 __ j(
greater, &attempt_to_grow_elements);
1545 __ mov(
ecx, Operand(
esp, argc * kPointerSize));
1546 __ JumpIfNotSmi(
ecx, &with_write_barrier);
1555 FixedArray::kHeaderSize - argc * kPointerSize),
1558 __ ret((argc + 1) * kPointerSize);
1560 __ bind(&with_write_barrier);
1564 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
1565 Label fast_object, not_fast_object;
1566 __ CheckFastObjectElements(
ebx, ¬_fast_object, Label::kNear);
1567 __ jmp(&fast_object);
1569 __ bind(¬_fast_object);
1570 __ CheckFastSmiElements(
ebx, &call_builtin);
1574 Label try_holey_map;
1585 __ jmp(&fast_object);
1587 __ bind(&try_holey_map);
1597 __ bind(&fast_object);
1599 __ CheckFastObjectElements(
ebx, &call_builtin);
1608 FixedArray::kHeaderSize - argc * kPointerSize));
1614 __ ret((argc + 1) * kPointerSize);
1616 __ bind(&attempt_to_grow_elements);
1617 if (!FLAG_inline_new) {
1618 __ jmp(&call_builtin);
1621 __ mov(
ebx, Operand(
esp, argc * kPointerSize));
1624 Label no_fast_elements_check;
1625 __ JumpIfSmi(
ebx, &no_fast_elements_check);
1627 __ CheckFastObjectElements(
ecx, &call_builtin, Label::kFar);
1628 __ bind(&no_fast_elements_check);
1634 ExternalReference new_space_allocation_top =
1635 ExternalReference::new_space_allocation_top_address(isolate());
1636 ExternalReference new_space_allocation_limit =
1637 ExternalReference::new_space_allocation_limit_address(isolate());
1639 const int kAllocationDelta = 4;
1641 __ mov(
ecx, Operand::StaticVariable(new_space_allocation_top));
1646 FixedArray::kHeaderSize - argc * kPointerSize));
1649 __ add(
ecx, Immediate(kAllocationDelta * kPointerSize));
1650 __ cmp(
ecx, Operand::StaticVariable(new_space_allocation_limit));
1654 __ mov(Operand::StaticVariable(new_space_allocation_top),
ecx);
1659 for (
int i = 1; i < kAllocationDelta; i++) {
1660 __ mov(Operand(
edx, i * kPointerSize),
1661 Immediate(factory()->the_hole_value()));
1672 __ mov(
edx, Operand(
esp, (argc + 1) * kPointerSize));
1684 __ ret((argc + 1) * kPointerSize);
1687 __ bind(&call_builtin);
1688 __ TailCallExternalReference(
1689 ExternalReference(Builtins::c_ArrayPush, isolate()),
1695 GenerateMissBranch();
1698 return GetCode(
function);
1702 Handle<Code> CallStubCompiler::CompileArrayPopCall(
1703 Handle<Object>
object,
1704 Handle<JSObject> holder,
1705 Handle<JSGlobalPropertyCell> cell,
1706 Handle<JSFunction>
function,
1707 Handle<String> name) {
1717 if (!object->IsJSArray() || !cell.is_null()) {
1721 Label miss, return_undefined, call_builtin;
1723 GenerateNameCheck(name, &miss);
1726 const int argc = arguments().immediate();
1727 __ mov(
edx, Operand(
esp, (argc + 1) * kPointerSize));
1730 __ JumpIfSmi(
edx, &miss);
1731 CheckPrototypes(Handle<JSObject>::cast(
object),
edx, holder,
ebx,
eax,
edi,
1739 Immediate(factory()->fixed_array_map()));
1752 FixedArray::kHeaderSize));
1753 __ cmp(
eax, Immediate(factory()->the_hole_value()));
1762 FixedArray::kHeaderSize),
1763 Immediate(factory()->the_hole_value()));
1764 __ ret((argc + 1) * kPointerSize);
1766 __ bind(&return_undefined);
1767 __ mov(
eax, Immediate(factory()->undefined_value()));
1768 __ ret((argc + 1) * kPointerSize);
1770 __ bind(&call_builtin);
1771 __ TailCallExternalReference(
1772 ExternalReference(Builtins::c_ArrayPop, isolate()),
1777 GenerateMissBranch();
1780 return GetCode(
function);
1784 Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
1785 Handle<Object>
object,
1786 Handle<JSObject> holder,
1787 Handle<JSGlobalPropertyCell> cell,
1788 Handle<JSFunction>
function,
1789 Handle<String> name) {
1799 if (!object->IsString() || !cell.is_null()) {
1803 const int argc = arguments().immediate();
1807 Label index_out_of_range;
1808 Label* index_out_of_range_label = &index_out_of_range;
1810 if (kind_ == Code::CALL_IC &&
1813 index_out_of_range_label = &miss;
1816 GenerateNameCheck(name, &name_miss);
1819 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1823 ASSERT(!
object.is_identical_to(holder));
1824 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1827 Register receiver =
ebx;
1828 Register index =
edi;
1829 Register result =
eax;
1830 __ mov(receiver, Operand(
esp, (argc + 1) * kPointerSize));
1832 __ mov(index, Operand(
esp, (argc - 0) * kPointerSize));
1834 __ Set(index, Immediate(factory()->undefined_value()));
1837 StringCharCodeAtGenerator
generator(receiver,
1842 index_out_of_range_label,
1845 __ ret((argc + 1) * kPointerSize);
1847 StubRuntimeCallHelper call_helper;
1848 generator.GenerateSlow(masm(), call_helper);
1850 if (index_out_of_range.is_linked()) {
1851 __ bind(&index_out_of_range);
1852 __ Set(
eax, Immediate(factory()->nan_value()));
1853 __ ret((argc + 1) * kPointerSize);
1858 __ Set(
ecx, Immediate(name));
1859 __ bind(&name_miss);
1860 GenerateMissBranch();
1863 return GetCode(
function);
1867 Handle<Code> CallStubCompiler::CompileStringCharAtCall(
1868 Handle<Object>
object,
1869 Handle<JSObject> holder,
1870 Handle<JSGlobalPropertyCell> cell,
1871 Handle<JSFunction>
function,
1872 Handle<String> name) {
1882 if (!object->IsString() || !cell.is_null()) {
1886 const int argc = arguments().immediate();
1890 Label index_out_of_range;
1891 Label* index_out_of_range_label = &index_out_of_range;
1893 if (kind_ == Code::CALL_IC &&
1896 index_out_of_range_label = &miss;
1899 GenerateNameCheck(name, &name_miss);
1902 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1906 ASSERT(!
object.is_identical_to(holder));
1907 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1910 Register receiver =
eax;
1911 Register index =
edi;
1912 Register scratch =
edx;
1913 Register result =
eax;
1914 __ mov(receiver, Operand(
esp, (argc + 1) * kPointerSize));
1916 __ mov(index, Operand(
esp, (argc - 0) * kPointerSize));
1918 __ Set(index, Immediate(factory()->undefined_value()));
1921 StringCharAtGenerator
generator(receiver,
1927 index_out_of_range_label,
1930 __ ret((argc + 1) * kPointerSize);
1932 StubRuntimeCallHelper call_helper;
1933 generator.GenerateSlow(masm(), call_helper);
1935 if (index_out_of_range.is_linked()) {
1936 __ bind(&index_out_of_range);
1937 __ Set(
eax, Immediate(factory()->empty_string()));
1938 __ ret((argc + 1) * kPointerSize);
1943 __ Set(
ecx, Immediate(name));
1944 __ bind(&name_miss);
1945 GenerateMissBranch();
1948 return GetCode(
function);
1952 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
1953 Handle<Object>
object,
1954 Handle<JSObject> holder,
1955 Handle<JSGlobalPropertyCell> cell,
1956 Handle<JSFunction>
function,
1957 Handle<String> name) {
1966 const int argc = arguments().immediate();
1970 if (!object->IsJSObject() || argc != 1) {
1975 GenerateNameCheck(name, &miss);
1977 if (cell.is_null()) {
1978 __ mov(edx, Operand(
esp, 2 * kPointerSize));
1980 __ JumpIfSmi(edx, &miss);
1981 CheckPrototypes(Handle<JSObject>::cast(
object), edx, holder, ebx,
eax, edi,
1984 ASSERT(cell->value() == *
function);
1985 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
1987 GenerateLoadFunctionFromCell(cell,
function, &miss);
1991 Register code =
ebx;
1992 __ mov(code, Operand(
esp, 1 * kPointerSize));
1997 __ JumpIfNotSmi(code, &slow);
2004 __ ret(2 * kPointerSize);
2006 StubRuntimeCallHelper call_helper;
2007 generator.GenerateSlow(masm(), call_helper);
2016 NullCallWrapper(), call_kind);
2020 GenerateMissBranch();
2023 return cell.is_null() ? GetCode(
function) : GetCode(Code::
NORMAL, name);
2027 Handle<Code> CallStubCompiler::CompileMathFloorCall(
2028 Handle<Object>
object,
2029 Handle<JSObject> holder,
2030 Handle<JSGlobalPropertyCell> cell,
2031 Handle<JSFunction>
function,
2032 Handle<String> name) {
2045 CpuFeatures::Scope use_sse2(
SSE2);
2047 const int argc = arguments().immediate();
2051 if (!object->IsJSObject() || argc != 1) {
2056 GenerateNameCheck(name, &miss);
2058 if (cell.is_null()) {
2059 __ mov(edx, Operand(
esp, 2 * kPointerSize));
2062 __ JumpIfSmi(edx, &miss);
2064 CheckPrototypes(Handle<JSObject>::cast(
object), edx, holder, ebx,
eax, edi,
2067 ASSERT(cell->value() == *
function);
2068 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2070 GenerateLoadFunctionFromCell(cell,
function, &miss);
2074 __ mov(
eax, Operand(
esp, 1 * kPointerSize));
2079 __ JumpIfSmi(
eax, &smi);
2097 Label wont_fit_into_smi;
2098 __ test(
eax, Immediate(0xc0000000));
2104 __ ret(2 * kPointerSize);
2107 Label already_round;
2108 __ bind(&wont_fit_into_smi);
2128 __ LoadPowerOf2(
xmm1, ebx, 0);
2133 __ AllocateHeapNumber(
eax, ebx, edx, &slow);
2135 __ ret(2 * kPointerSize);
2138 __ bind(&already_round);
2139 __ mov(
eax, Operand(
esp, 1 * kPointerSize));
2140 __ ret(2 * kPointerSize);
2150 GenerateMissBranch();
2153 return cell.is_null() ? GetCode(
function) : GetCode(Code::
NORMAL, name);
2157 Handle<Code> CallStubCompiler::CompileMathAbsCall(
2158 Handle<Object>
object,
2159 Handle<JSObject> holder,
2160 Handle<JSGlobalPropertyCell> cell,
2161 Handle<JSFunction>
function,
2162 Handle<String> name) {
2171 const int argc = arguments().immediate();
2175 if (!object->IsJSObject() || argc != 1) {
2180 GenerateNameCheck(name, &miss);
2182 if (cell.is_null()) {
2183 __ mov(edx, Operand(
esp, 2 * kPointerSize));
2186 __ JumpIfSmi(edx, &miss);
2188 CheckPrototypes(Handle<JSObject>::cast(
object), edx, holder, ebx,
eax, edi,
2191 ASSERT(cell->value() == *
function);
2192 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2194 GenerateLoadFunctionFromCell(cell,
function, &miss);
2198 __ mov(
eax, Operand(
esp, 1 * kPointerSize));
2203 __ JumpIfNotSmi(
eax, ¬_smi);
2222 __ ret(2 * kPointerSize);
2232 Label negative_sign;
2235 __ ret(2 * kPointerSize);
2239 __ bind(&negative_sign);
2242 __ AllocateHeapNumber(
eax, edi, edx, &slow);
2245 __ ret(2 * kPointerSize);
2255 GenerateMissBranch();
2258 return cell.is_null() ? GetCode(
function) : GetCode(Code::
NORMAL, name);
2262 Handle<Code> CallStubCompiler::CompileFastApiCall(
2263 const CallOptimization& optimization,
2264 Handle<Object>
object,
2265 Handle<JSObject> holder,
2266 Handle<JSGlobalPropertyCell> cell,
2267 Handle<JSFunction>
function,
2268 Handle<String> name) {
2269 ASSERT(optimization.is_simple_api_call());
2272 if (object->IsGlobalObject())
return Handle<Code>::null();
2273 if (!cell.is_null())
return Handle<Code>::null();
2274 if (!object->IsJSObject())
return Handle<Code>::null();
2275 int depth = optimization.GetPrototypeDepthOfExpectedType(
2276 Handle<JSObject>::cast(
object), holder);
2279 Label miss, miss_before_stack_reserved;
2281 GenerateNameCheck(name, &miss_before_stack_reserved);
2284 const int argc = arguments().immediate();
2285 __ mov(edx, Operand(
esp, (argc + 1) * kPointerSize));
2288 __ JumpIfSmi(edx, &miss_before_stack_reserved);
2290 Counters* counters = isolate()->counters();
2291 __ IncrementCounter(counters->call_const(), 1);
2292 __ IncrementCounter(counters->call_const_fast_api(), 1);
2296 __ sub(
esp, Immediate(kFastApiCallArguments * kPointerSize));
2299 CheckPrototypes(Handle<JSObject>::cast(
object), edx, holder, ebx,
eax, edi,
2300 name, depth, &miss);
2303 __ mov(
eax, Operand(
esp, 4 * kPointerSize));
2304 __ mov(Operand(
esp, 0 * kPointerSize),
eax);
2308 GenerateFastApiCall(masm(), optimization, argc);
2311 __ add(
esp, Immediate(kFastApiCallArguments * kPointerSize));
2313 __ bind(&miss_before_stack_reserved);
2314 GenerateMissBranch();
2317 return GetCode(
function);
2322 Handle<JSObject> holder,
2323 Handle<JSFunction>
function,
2324 Handle<String> name,
2335 Handle<Code> code = CompileCustomCall(
object, holder,
2336 Handle<JSGlobalPropertyCell>::null(),
2339 if (!code.is_null())
return code;
2343 GenerateNameCheck(name, &miss);
2346 const int argc = arguments().immediate();
2347 __ mov(edx, Operand(
esp, (argc + 1) * kPointerSize));
2351 __ JumpIfSmi(edx, &miss);
2359 __ IncrementCounter(isolate()->counters()->call_const(), 1);
2362 CheckPrototypes(Handle<JSObject>::cast(
object), edx, holder, ebx,
eax,
2367 if (object->IsGlobalObject()) {
2369 __ mov(Operand(
esp, (argc + 1) * kPointerSize), edx);
2374 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2379 GenerateDirectLoadGlobalFunctionPrototype(
2392 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2395 __ JumpIfSmi(edx, &fast);
2400 GenerateDirectLoadGlobalFunctionPrototype(
2413 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2416 __ cmp(edx, factory()->true_value());
2418 __ cmp(edx, factory()->false_value());
2422 GenerateDirectLoadGlobalFunctionPrototype(
2439 NullCallWrapper(), call_kind);
2443 GenerateMissBranch();
2446 return GetCode(
function);
2451 Handle<JSObject> holder,
2452 Handle<String> name) {
2462 GenerateNameCheck(name, &miss);
2465 const int argc = arguments().immediate();
2467 LookupResult lookup(isolate());
2468 LookupPostInterceptor(holder, name, &lookup);
2471 __ mov(edx, Operand(
esp, (argc + 1) * kPointerSize));
2473 CallInterceptorCompiler compiler(
this, arguments(),
ecx, extra_state_);
2474 compiler.Compile(masm(),
object, holder, name, &lookup, edx, ebx, edi,
eax,
2478 __ mov(edx, Operand(
esp, (argc + 1) * kPointerSize));
2481 __ JumpIfSmi(
eax, &miss);
2487 if (object->IsGlobalObject()) {
2489 __ mov(Operand(
esp, (argc + 1) * kPointerSize), edx);
2498 NullCallWrapper(), call_kind);
2502 GenerateMissBranch();
2510 Handle<JSObject>
object,
2511 Handle<GlobalObject> holder,
2512 Handle<JSGlobalPropertyCell> cell,
2513 Handle<JSFunction>
function,
2514 Handle<String> name) {
2524 Handle<Code> code = CompileCustomCall(
object, holder, cell,
function, name);
2526 if (!code.is_null())
return code;
2530 GenerateNameCheck(name, &miss);
2533 const int argc = arguments().immediate();
2534 GenerateGlobalReceiverCheck(
object, holder, name, &miss);
2535 GenerateLoadFunctionFromCell(cell,
function, &miss);
2538 if (object->IsGlobalObject()) {
2540 __ mov(Operand(
esp, (argc + 1) * kPointerSize), edx);
2547 Counters* counters = isolate()->counters();
2548 __ IncrementCounter(counters->call_global_inline(), 1);
2549 ParameterCount expected(function->shared()->formal_parameter_count());
2558 NullCallWrapper(), call_kind);
2562 __ IncrementCounter(counters->call_global_inline_miss(), 1);
2563 GenerateMissBranch();
2572 Handle<Map> transition,
2573 Handle<String> name) {
2583 GenerateStoreField(masm(),
2592 __ mov(
ecx, Immediate(name));
2593 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2594 __ jmp(ic, RelocInfo::CODE_TARGET);
2597 return GetCode(transition.is_null()
2604 Handle<String> name,
2605 Handle<JSObject> receiver,
2606 Handle<JSObject> holder,
2607 Handle<AccessorInfo> callback) {
2617 __ JumpIfSmi(edx, &miss);
2618 CheckPrototypes(receiver, edx, holder, ebx,
eax, edi, name, &miss);
2622 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
2626 __ push(Immediate(callback));
2632 ExternalReference store_callback_property =
2633 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
2634 __ TailCallExternalReference(store_callback_property, 4, 1);
2639 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2640 __ jmp(ic, RelocInfo::CODE_TARGET);
2648 #define __ ACCESS_MASM(masm)
2652 MacroAssembler* masm,
2653 Handle<JSFunction> setter) {
2666 if (!setter.is_null()) {
2670 ParameterCount actual(1);
2676 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2690 #define __ ACCESS_MASM(masm())
2694 Handle<String> name,
2695 Handle<JSObject> receiver,
2696 Handle<JSObject> holder,
2697 Handle<JSFunction> setter) {
2708 __ JumpIfSmi(edx, &miss);
2709 CheckPrototypes(receiver, edx, holder, ebx,
ecx, edi, name, &miss);
2716 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2717 __ jmp(ic, RelocInfo::CODE_TARGET);
2725 Handle<JSObject> receiver,
2726 Handle<String> name) {
2736 __ CheckMap(edx, Handle<Map>(receiver->map()),
2740 if (receiver->IsJSGlobalProxy()) {
2741 __ CheckAccessGlobalProxy(edx, ebx, &miss);
2746 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
2756 ExternalReference store_ic_property =
2757 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate());
2758 __ TailCallExternalReference(store_ic_property, 4, 1);
2762 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2763 __ jmp(ic, RelocInfo::CODE_TARGET);
2771 Handle<GlobalObject>
object,
2772 Handle<JSGlobalPropertyCell> cell,
2773 Handle<String> name) {
2784 Immediate(Handle<Map>(object->map())));
2788 __ mov(ebx, Immediate(cell));
2795 __ cmp(cell_operand, factory()->the_hole_value());
2799 __ mov(cell_operand,
eax);
2803 Counters* counters = isolate()->counters();
2804 __ IncrementCounter(counters->named_store_global_inline(), 1);
2809 __ IncrementCounter(counters->named_store_global_inline_miss(), 1);
2810 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2811 __ jmp(ic, RelocInfo::CODE_TARGET);
2820 Handle<Map> transition,
2821 Handle<String> name) {
2830 Counters* counters = isolate()->counters();
2831 __ IncrementCounter(counters->keyed_store_field(), 1);
2834 __ cmp(
ecx, Immediate(name));
2838 GenerateStoreField(masm(),
2848 __ DecrementCounter(counters->keyed_store_field(), 1);
2849 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2850 __ jmp(ic, RelocInfo::CODE_TARGET);
2853 return GetCode(transition.is_null()
2860 Handle<Map> receiver_map) {
2867 ElementsKind elements_kind = receiver_map->elements_kind();
2868 bool is_jsarray = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
2870 KeyedStoreElementStub(is_jsarray, elements_kind, grow_mode_).GetCode();
2874 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2875 __ jmp(ic, RelocInfo::CODE_TARGET);
2878 return GetCode(
Code::NORMAL, factory()->empty_string());
2893 __ JumpIfSmi(edx, &miss, Label::kNear);
2896 for (
int i = 0; i < receiver_maps->length(); ++i) {
2897 __ cmp(edi, receiver_maps->at(i));
2898 if (transitioned_maps->at(i).is_null()) {
2899 __ j(
equal, handler_stubs->at(i));
2903 __ mov(ebx, Immediate(transitioned_maps->at(i)));
2904 __ jmp(handler_stubs->at(i), RelocInfo::CODE_TARGET);
2909 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss();
2910 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
2918 Handle<JSObject>
object,
2919 Handle<JSObject> last) {
2928 __ JumpIfSmi(edx, &miss);
2930 ASSERT(last->IsGlobalObject() || last->HasFastProperties());
2935 CheckPrototypes(
object, edx, last, ebx,
eax, edi, name, &miss);
2939 if (last->IsGlobalObject()) {
2940 GenerateCheckPropertyCell(
2941 masm(), Handle<GlobalObject>::cast(last), name,
eax, &miss);
2946 __ mov(
eax, isolate()->factory()->undefined_value());
2950 GenerateLoadMiss(masm(), Code::LOAD_IC);
2958 Handle<JSObject> holder,
2960 Handle<String> name) {
2968 GenerateLoadField(
object, holder, edx, ebx,
eax, edi, index, name, &miss);
2970 GenerateLoadMiss(masm(), Code::LOAD_IC);
2978 Handle<String> name,
2979 Handle<JSObject>
object,
2980 Handle<JSObject> holder,
2981 Handle<AccessorInfo> callback) {
2989 GenerateLoadCallback(
object, holder, edx,
ecx, ebx,
eax, edi,
no_reg,
2990 callback, name, &miss);
2992 GenerateLoadMiss(masm(), Code::LOAD_IC);
3000 #define __ ACCESS_MASM(masm)
3004 Handle<JSFunction> getter) {
3013 if (!getter.is_null()) {
3016 ParameterCount actual(0);
3022 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
3033 #define __ ACCESS_MASM(masm())
3037 Handle<String> name,
3038 Handle<JSObject> receiver,
3039 Handle<JSObject> holder,
3040 Handle<JSFunction> getter) {
3049 __ JumpIfSmi(edx, &miss);
3050 CheckPrototypes(receiver, edx, holder, ebx,
eax, edi, name, &miss);
3055 GenerateLoadMiss(masm(), Code::LOAD_IC);
3063 Handle<JSObject> holder,
3064 Handle<JSFunction> value,
3065 Handle<String> name) {
3073 GenerateLoadConstant(
object, holder, edx, ebx,
eax, edi, value, name, &miss);
3075 GenerateLoadMiss(masm(), Code::LOAD_IC);
3083 Handle<JSObject> holder,
3084 Handle<String> name) {
3092 LookupResult lookup(isolate());
3093 LookupPostInterceptor(holder, name, &lookup);
3097 GenerateLoadInterceptor(receiver, holder, &lookup, edx,
ecx,
eax, ebx, edi,
3101 GenerateLoadMiss(masm(), Code::LOAD_IC);
3109 Handle<JSObject>
object,
3110 Handle<GlobalObject> holder,
3111 Handle<JSGlobalPropertyCell> cell,
3112 Handle<String> name,
3113 bool is_dont_delete) {
3122 __ JumpIfSmi(edx, &miss);
3123 CheckPrototypes(
object, edx, holder, ebx,
eax, edi, name, &miss);
3127 __ mov(ebx, Immediate(cell));
3130 __ mov(ebx, Operand::Cell(cell));
3134 if (!is_dont_delete) {
3135 __ cmp(ebx, factory()->the_hole_value());
3137 }
else if (FLAG_debug_code) {
3138 __ cmp(ebx, factory()->the_hole_value());
3139 __ Check(
not_equal,
"DontDelete cells can't contain the hole");
3142 Counters* counters = isolate()->counters();
3143 __ IncrementCounter(counters->named_load_global_stub(), 1);
3148 __ IncrementCounter(counters->named_load_global_stub_miss(), 1);
3149 GenerateLoadMiss(masm(), Code::LOAD_IC);
3157 Handle<JSObject> receiver,
3158 Handle<JSObject> holder,
3167 Counters* counters = isolate()->counters();
3168 __ IncrementCounter(counters->keyed_load_field(), 1);
3171 __ cmp(
ecx, Immediate(name));
3174 GenerateLoadField(receiver, holder, edx, ebx,
eax, edi, index, name, &miss);
3177 __ DecrementCounter(counters->keyed_load_field(), 1);
3178 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3186 Handle<String> name,
3187 Handle<JSObject> receiver,
3188 Handle<JSObject> holder,
3189 Handle<AccessorInfo> callback) {
3197 Counters* counters = isolate()->counters();
3198 __ IncrementCounter(counters->keyed_load_callback(), 1);
3201 __ cmp(
ecx, Immediate(name));
3204 GenerateLoadCallback(receiver, holder, edx,
ecx, ebx,
eax, edi,
no_reg,
3205 callback, name, &miss);
3208 __ DecrementCounter(counters->keyed_load_callback(), 1);
3209 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3217 Handle<String> name,
3218 Handle<JSObject> receiver,
3219 Handle<JSObject> holder,
3220 Handle<JSFunction> value) {
3228 Counters* counters = isolate()->counters();
3229 __ IncrementCounter(counters->keyed_load_constant_function(), 1);
3232 __ cmp(
ecx, Immediate(name));
3235 GenerateLoadConstant(
3236 receiver, holder, edx, ebx,
eax, edi, value, name, &miss);
3238 __ DecrementCounter(counters->keyed_load_constant_function(), 1);
3239 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3247 Handle<JSObject> receiver,
3248 Handle<JSObject> holder,
3249 Handle<String> name) {
3257 Counters* counters = isolate()->counters();
3258 __ IncrementCounter(counters->keyed_load_interceptor(), 1);
3261 __ cmp(
ecx, Immediate(name));
3264 LookupResult lookup(isolate());
3265 LookupPostInterceptor(holder, name, &lookup);
3266 GenerateLoadInterceptor(receiver, holder, &lookup, edx,
ecx,
eax, ebx, edi,
3269 __ DecrementCounter(counters->keyed_load_interceptor(), 1);
3270 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3278 Handle<String> name) {
3286 Counters* counters = isolate()->counters();
3287 __ IncrementCounter(counters->keyed_load_array_length(), 1);
3290 __ cmp(
ecx, Immediate(name));
3293 GenerateLoadArrayLength(masm(), edx,
eax, &miss);
3295 __ DecrementCounter(counters->keyed_load_array_length(), 1);
3296 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3304 Handle<String> name) {
3312 Counters* counters = isolate()->counters();
3313 __ IncrementCounter(counters->keyed_load_string_length(), 1);
3316 __ cmp(
ecx, Immediate(name));
3319 GenerateLoadStringLength(masm(), edx,
eax, ebx, &miss,
true);
3321 __ DecrementCounter(counters->keyed_load_string_length(), 1);
3322 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3330 Handle<String> name) {
3338 Counters* counters = isolate()->counters();
3339 __ IncrementCounter(counters->keyed_load_function_prototype(), 1);
3342 __ cmp(
ecx, Immediate(name));
3345 GenerateLoadFunctionPrototype(masm(), edx,
eax, ebx, &miss);
3347 __ DecrementCounter(counters->keyed_load_function_prototype(), 1);
3348 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3356 Handle<Map> receiver_map) {
3363 ElementsKind elements_kind = receiver_map->elements_kind();
3364 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
3368 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3371 return GetCode(
Code::NORMAL, factory()->empty_string());
3384 __ JumpIfSmi(edx, &miss);
3386 Register map_reg =
ebx;
3388 int receiver_count = receiver_maps->length();
3389 for (
int current = 0; current < receiver_count; ++current) {
3390 __ cmp(map_reg, receiver_maps->at(current));
3391 __ j(
equal, handler_ics->at(current));
3395 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3405 Handle<JSFunction>
function) {
3412 Label generic_stub_call;
3413 #ifdef ENABLE_DEBUGGER_SUPPORT
3419 __ cmp(ebx, factory()->undefined_value());
3426 __ JumpIfSmi(ebx, &generic_stub_call);
3435 __ Assert(
not_equal,
"Function constructed by construct stub.");
3451 __ mov(ebx, factory()->empty_fixed_array());
3468 __ mov(edi, factory()->undefined_value());
3476 Handle<SharedFunctionInfo> shared(function->shared());
3477 for (
int i = 0; i < shared->this_property_assignments_count(); i++) {
3478 if (shared->IsThisPropertyAssignmentArgument(i)) {
3482 int arg_number = shared->GetThisPropertyAssignmentArgument(i);
3484 __ cmp(
eax, arg_number);
3486 CpuFeatures::Scope use_cmov(
CMOV);
3487 __ cmov(
above, ebx, Operand(
ecx, arg_number * -kPointerSize));
3491 __ mov(ebx, Operand(
ecx, arg_number * -kPointerSize));
3492 __ bind(¬_passed);
3495 __ mov(Operand(edx, i * kPointerSize), ebx);
3498 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i));
3499 __ mov(Operand(edx, i * kPointerSize), Immediate(constant));
3504 ASSERT(function->has_initial_map());
3505 for (
int i = shared->this_property_assignments_count();
3506 i <
function->initial_map()->inobject_properties();
3508 __ mov(Operand(edx, i * kPointerSize), edi);
3520 Counters* counters = isolate()->counters();
3521 __ IncrementCounter(counters->constructed_objects(), 1);
3522 __ IncrementCounter(counters->constructed_objects_stub(), 1);
3527 __ bind(&generic_stub_call);
3528 Handle<Code> code = isolate()->builtins()->JSConstructStubGeneric();
3529 __ jmp(code, RelocInfo::CODE_TARGET);
3537 #define __ ACCESS_MASM(masm)
3541 MacroAssembler* masm) {
3547 Label slow, miss_force_generic;
3551 __ JumpIfNotSmi(
ecx, &miss_force_generic);
3559 __ LoadFromNumberDictionary(&slow,
eax,
ecx, ebx, edx, edi,
eax);
3573 Handle<Code> slow_ic =
3574 masm->isolate()->builtins()->KeyedLoadIC_Slow();
3575 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3577 __ bind(&miss_force_generic);
3584 Handle<Code> miss_force_generic_ic =
3585 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3586 __ jmp(miss_force_generic_ic, RelocInfo::CODE_TARGET);
3590 static void GenerateSmiKeyCheck(MacroAssembler* masm,
3593 XMMRegister xmm_scratch0,
3594 XMMRegister xmm_scratch1,
3599 CpuFeatures::Scope use_sse2(
SSE2);
3601 __ JumpIfSmi(key, &key_ok);
3603 Immediate(Handle<Map>(masm->isolate()->heap()->heap_number_map())));
3606 __ cvttsd2si(scratch, Operand(xmm_scratch0));
3607 __ cvtsi2sd(xmm_scratch1, scratch);
3608 __ ucomisd(xmm_scratch1, xmm_scratch0);
3612 __ cmp(scratch, 0xc0000000);
3615 __ mov(key, scratch);
3618 __ JumpIfNotSmi(key, fail);
3624 MacroAssembler* masm,
3631 Label miss_force_generic, failed_allocation, slow;
3637 GenerateSmiKeyCheck(masm,
ecx,
eax,
xmm0,
xmm1, &miss_force_generic);
3646 switch (elements_kind) {
3689 __ cmp(
eax, 0xc0000000);
3696 __ test(
eax, Immediate(0xc0000000));
3709 __ fild_s(Operand(
esp, 0));
3716 __ push(Immediate(0));
3718 __ fild_d(Operand(
esp, 0));
3723 __ AllocateHeapNumber(
eax, ebx, edi, &failed_allocation);
3731 __ AllocateHeapNumber(
eax, ebx, edi, &failed_allocation);
3742 __ bind(&failed_allocation);
3748 Counters* counters = masm->isolate()->counters();
3749 __ IncrementCounter(counters->keyed_load_external_array_slow(), 1);
3757 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Slow();
3758 __ jmp(ic, RelocInfo::CODE_TARGET);
3767 __ bind(&miss_force_generic);
3768 Handle<Code> miss_ic =
3769 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3770 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3775 MacroAssembler* masm,
3783 Label miss_force_generic, slow, check_heap_number;
3789 GenerateSmiKeyCheck(masm,
ecx, ebx,
xmm0,
xmm1, &miss_force_generic);
3804 __ JumpIfNotSmi(
eax, &slow);
3806 __ JumpIfNotSmi(
eax, &check_heap_number);
3814 switch (elements_kind) {
3837 __ fild_s(Operand(
esp, 0));
3853 __ bind(&check_heap_number);
3859 Immediate(masm->isolate()->factory()->heap_number_map()));
3887 CpuFeatures::Scope scope(
SSE3);
3892 __ sub(
esp, Immediate(2 * kPointerSize));
3893 __ fisttp_d(Operand(
esp, 0));
3899 __ cmp(Operand(
esp, kPointerSize), Immediate(0x80000000u));
3901 __ cmp(Operand(
esp, 0), Immediate(0));
3903 __ add(
esp, Immediate(2 * kPointerSize));
3908 __ add(
esp, Immediate(kPointerSize));
3912 CpuFeatures::Scope scope(
SSE2);
3914 __ cmp(ebx, 0x80000000u);
3917 switch (elements_kind) {
3946 Counters* counters = masm->isolate()->counters();
3947 __ IncrementCounter(counters->keyed_store_external_array_slow(), 1);
3956 Handle<Code> ic = masm->isolate()->builtins()->KeyedStoreIC_Slow();
3957 __ jmp(ic, RelocInfo::CODE_TARGET);
3966 __ bind(&miss_force_generic);
3967 Handle<Code> miss_ic =
3968 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3969 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3979 Label miss_force_generic;
3985 GenerateSmiKeyCheck(masm,
ecx,
eax,
xmm0,
xmm1, &miss_force_generic);
3989 __ AssertFastElements(
eax);
3998 __ cmp(ebx, masm->isolate()->factory()->the_hole_value());
3999 __ j(
equal, &miss_force_generic);
4003 __ bind(&miss_force_generic);
4004 Handle<Code> miss_ic =
4005 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
4006 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
4011 MacroAssembler* masm) {
4017 Label miss_force_generic, slow_allocate_heapnumber;
4023 GenerateSmiKeyCheck(masm,
ecx,
eax,
xmm0,
xmm1, &miss_force_generic);
4027 __ AssertFastElements(
eax);
4036 __ j(
equal, &miss_force_generic);
4040 CpuFeatures::Scope use_sse2(
SSE2);
4046 __ AllocateHeapNumber(
eax, ebx, edi, &slow_allocate_heapnumber);
4049 CpuFeatures::Scope use_sse2(
SSE2);
4056 __ bind(&slow_allocate_heapnumber);
4062 Handle<Code> slow_ic =
4063 masm->isolate()->builtins()->KeyedLoadIC_Slow();
4064 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
4066 __ bind(&miss_force_generic);
4067 Handle<Code> miss_ic =
4068 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
4069 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
4074 MacroAssembler* masm,
4084 Label miss_force_generic, grow, slow, transition_elements_kind;
4085 Label check_capacity, prepare_slow, finish_store, commit_backing_store;
4091 GenerateSmiKeyCheck(masm,
ecx, ebx,
xmm0,
xmm1, &miss_force_generic);
4094 __ JumpIfNotSmi(
eax, &transition_elements_kind);
4114 Immediate(masm->isolate()->factory()->fixed_array_map()));
4117 __ bind(&finish_store);
4124 FixedArray::kHeaderSize),
eax);
4133 FixedArray::kHeaderSize));
4144 __ bind(&miss_force_generic);
4145 Handle<Code> ic_force_generic =
4146 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4147 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
4150 __ bind(&transition_elements_kind);
4151 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4152 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
4166 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array()));
4170 __ AllocateInNewSpace(size, edi, ebx,
ecx, &prepare_slow,
TAG_OBJECT);
4179 Immediate(masm->isolate()->factory()->fixed_array_map()));
4182 __ mov(ebx, Immediate(masm->isolate()->factory()->the_hole_value()));
4200 __ bind(&check_capacity);
4202 Immediate(masm->isolate()->factory()->fixed_cow_array_map()));
4203 __ j(
equal, &miss_force_generic);
4216 __ jmp(&finish_store);
4218 __ bind(&prepare_slow);
4220 __ mov(
ecx, Immediate(0));
4223 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
4224 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4230 MacroAssembler* masm,
4239 Label miss_force_generic, transition_elements_kind, grow, slow;
4240 Label check_capacity, prepare_slow, finish_store, commit_backing_store;
4246 GenerateSmiKeyCheck(masm,
ecx, ebx,
xmm0,
xmm1, &miss_force_generic);
4250 __ AssertFastElements(edi);
4266 __ bind(&finish_store);
4267 __ StoreNumberToDoubleElements(
eax, edi,
ecx, edx,
xmm0,
4268 &transition_elements_kind,
true);
4272 __ bind(&miss_force_generic);
4273 Handle<Code> ic_force_generic =
4274 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4275 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
4278 __ bind(&transition_elements_kind);
4279 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4280 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
4293 __ JumpIfSmi(
eax, &value_is_smi);
4295 Immediate(Handle<Map>(masm->isolate()->heap()->heap_number_map())));
4297 __ bind(&value_is_smi);
4302 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array()));
4306 __ AllocateInNewSpace(size, edi, ebx,
ecx, &prepare_slow,
TAG_OBJECT);
4309 __ mov(
ecx, Immediate(0));
4318 Immediate(masm->isolate()->factory()->fixed_double_array_map()));
4320 Immediate(
Smi::FromInt(JSArray::kPreallocatedArrayElements)));
4331 __ jmp(&finish_store);
4333 __ bind(&check_capacity);
4345 __ jmp(&finish_store);
4347 __ bind(&prepare_slow);
4349 __ mov(
ecx, Immediate(0));
4352 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
4353 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4362 #endif // V8_TARGET_ARCH_IA32
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)
static const int kNotFound
static void GenerateStoreViaSetter(MacroAssembler *masm, Handle< JSFunction > setter)
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 kElementsStartIndex
static const int kDataOffset
Handle< Code > CompileLoadNonexistent(Handle< String > name, Handle< JSObject > object, Handle< JSObject > last)
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 int kFlagsOffset
static Smi * FromInt(int value)
bool IsFastObjectElementsKind(ElementsKind kind)
#define LOG(isolate, Call)
static void GenerateStoreExternalArray(MacroAssembler *masm, ElementsKind elements_kind)
static const int kGlobalReceiverOffset
static void GenerateLoadFastDoubleElement(MacroAssembler *masm)
static StubType ExtractTypeFromFlags(Flags flags)
static bool IsSupported(CpuFeature f)
static const int kExternalPointerOffset
static const int kHasNamedInterceptor
static const int kIsAccessCheckNeeded
List< Handle< Map > > MapHandleList
#define ASSERT(condition)
const int kPointerSizeLog2
static const int kInstanceSizeOffset
static const int kDebugInfoOffset
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 kNotStringTag
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)
Handle< Code > CompileLoadField(Handle< String > name, Handle< JSObject > object, Handle< JSObject > holder, int index)
static const int kValueOffset
static void GenerateLoadViaGetter(MacroAssembler *masm, Handle< JSFunction > getter)
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)
Operand FieldOperand(Register object, int offset)
const uint32_t kHoleNanLower32
static bool decode(uint32_t value)
static const int kPropertiesOffset
Handle< Code > CompileLoadGlobal(Handle< JSObject > object, Handle< GlobalObject > holder, Handle< JSGlobalPropertyCell > cell, Handle< String > name, bool is_dont_delete)
Handle< Code > CompileStoreCallback(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< AccessorInfo > callback)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random generator(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer
bool IsFastSmiElementsKind(ElementsKind kind)
static void GenerateMapChangeElementsTransition(MacroAssembler *masm)
static const int kDataOffset
static int SizeFor(int length)
static const int kElementsOffset
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
List< Handle< Code > > CodeHandleList
static const int kLengthOffset
static void GeneratePositiveLookup(MacroAssembler *masm, Label *miss, Label *done, Register elements, Register name, Register r0, Register r1)
Handle< Code > CompileCallInterceptor(Handle< JSObject > object, Handle< JSObject > holder, Handle< String > name)
static const int kDataOffset
static const int kContextOffset
static void GenerateLoadFastElement(MacroAssembler *masm)
static const uint32_t kSignMask
Operand ApiParameterOperand(int index)
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)
Handle< Code > CompileLoadArrayLength(Handle< String > name)
Handle< Code > CompileCallConstant(Handle< Object > object, Handle< JSObject > holder, Handle< JSFunction > function, Handle< String > name, CheckType check)
static AccessorInfo * cast(Object *obj)
static const int kHeaderSize
const int kHeapObjectTagSize
static Handle< JSGlobalPropertyCell > EnsurePropertyCell(Handle< GlobalObject > global, Handle< String > name)
static bool HasCustomCallGenerator(Handle< JSFunction > function)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static const int kPreallocatedArrayElements
static const int kPrototypeOffset
static const int kFlagsNotUsedInLookup
const int kInvalidProtoDepth
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
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
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
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)
Handle< Code > CompileStoreViaSetter(Handle< String > name, Handle< JSObject > receiver, Handle< JSObject > holder, Handle< JSFunction > setter)
static JSObject * cast(Object *obj)
static const int kInstanceTypeOffset
static const int kMantissaOffset
static JSFunction * cast(Object *obj)