30 #if defined(V8_TARGET_ARCH_X64)
39 #define __ ACCESS_MASM(masm)
42 static void ProbeTable(Isolate* isolate,
59 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
60 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
64 __ lea(offset, Operand(offset, offset,
times_2, 0));
90 __ cmpl(offset, Immediate(flags));
114 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
121 Counters* counters = masm->isolate()->counters();
122 __ IncrementCounter(counters->negative_lookups(), 1);
123 __ IncrementCounter(counters->negative_lookups_miss(), 1);
127 const int kInterceptorOrAccessCheckNeededMask =
132 Immediate(kInterceptorOrAccessCheckNeededMask));
140 Register properties =
r0;
145 Heap::kHashTableMapRootIndex);
156 __ DecrementCounter(counters->negative_lookups_miss(), 1);
168 Isolate* isolate = masm->isolate();
175 ASSERT(
sizeof(Entry) == 24);
181 ASSERT(!scratch.is(receiver));
182 ASSERT(!scratch.is(name));
189 Counters* counters = masm->isolate()->counters();
190 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1);
193 __ JumpIfSmi(receiver, &miss);
199 __ xor_(scratch, Immediate(flags));
205 ProbeTable(isolate, masm, flags,
kPrimary, receiver, name, scratch);
210 __ xor_(scratch, Immediate(flags));
212 __ subl(scratch, name);
213 __ addl(scratch, Immediate(flags));
217 ProbeTable(isolate, masm, flags,
kSecondary, receiver, name, scratch);
222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
226 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
228 Register prototype) {
245 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
246 MacroAssembler* masm,
250 Isolate* isolate = masm->isolate();
252 __ Move(prototype, isolate->global_object());
257 Handle<JSFunction>
function(
260 __ Move(prototype, Handle<Map>(function->initial_map()));
266 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
271 __ JumpIfSmi(receiver, miss_label);
285 static void GenerateStringCheck(MacroAssembler* masm,
289 Label* non_string_object) {
291 __ JumpIfSmi(receiver, smi);
302 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
307 bool support_wrappers) {
312 GenerateStringCheck(masm, receiver, scratch1, miss,
313 support_wrappers ? &check_wrapper : miss);
319 if (support_wrappers) {
321 __ bind(&check_wrapper);
328 GenerateStringCheck(masm, scratch2, scratch1, miss, miss);
335 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
340 __ TryGetFunctionPrototype(receiver, result, miss_label);
341 if (!result.is(
rax))
__ movq(
rax, result);
349 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
352 Handle<JSObject> holder,
355 index -= holder->map()->inobject_properties();
358 int offset = holder->map()->instance_size() + (index *
kPointerSize);
369 static void PushInterceptorArguments(MacroAssembler* masm,
373 Handle<JSObject> holder_obj) {
375 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
376 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
382 __ PushAddress(ExternalReference::isolate_address());
386 static void CompileCallLoadPropertyWithInterceptor(
387 MacroAssembler* masm,
391 Handle<JSObject> holder_obj) {
392 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
394 ExternalReference ref =
395 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly),
398 __ LoadAddress(
rbx, ref);
406 static const int kFastApiCallArguments = 4;
413 static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
418 __ movq(scratch, Operand(
rsp, 0));
420 __ movq(Operand(
rsp, 0), scratch);
422 for (
int i = 1; i <= kFastApiCallArguments; i++) {
429 static void FreeSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
438 __ movq(scratch, Operand(
rsp, 0));
445 static void GenerateFastApiCall(MacroAssembler* masm,
446 const CallOptimization& optimization,
463 Handle<JSFunction>
function = optimization.constant_function();
464 __ LoadHeapObject(
rdi,
function);
469 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
470 Handle<Object> call_data(api_call_info->data());
471 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
472 __ Move(
rcx, api_call_info);
484 #if defined(__MINGW64__)
485 Register arguments_arg =
rcx;
486 #elif defined(_WIN64)
488 Register arguments_arg =
rdx;
490 Register arguments_arg =
rdi;
495 const int kApiStackSpace = 4;
497 __ PrepareCallApiFunction(kApiStackSpace);
510 Address function_address = v8::ToCData<Address>(api_call_info->callback());
511 __ CallApiFunctionAndReturn(function_address,
512 argc + kFastApiCallArguments + 1);
518 CallInterceptorCompiler(StubCompiler* stub_compiler,
519 const ParameterCount& arguments,
522 : stub_compiler_(stub_compiler),
523 arguments_(arguments),
525 extra_ic_state_(extra_ic_state) {}
527 void Compile(MacroAssembler* masm,
528 Handle<JSObject>
object,
529 Handle<JSObject> holder,
531 LookupResult* lookup,
537 ASSERT(holder->HasNamedInterceptor());
538 ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined());
541 __ JumpIfSmi(receiver, miss);
543 CallOptimization optimization(lookup);
544 if (optimization.is_constant_call()) {
545 CompileCacheable(masm,
object, receiver, scratch1, scratch2, scratch3,
546 holder, lookup, name, optimization, miss);
548 CompileRegular(masm,
object, receiver, scratch1, scratch2, scratch3,
554 void CompileCacheable(MacroAssembler* masm,
555 Handle<JSObject>
object,
560 Handle<JSObject> interceptor_holder,
561 LookupResult* lookup,
563 const CallOptimization& optimization,
565 ASSERT(optimization.is_constant_call());
566 ASSERT(!lookup->holder()->IsGlobalObject());
570 bool can_do_fast_api_call =
false;
571 if (optimization.is_simple_api_call() &&
572 !lookup->holder()->IsGlobalObject()) {
573 depth1 = optimization.GetPrototypeDepthOfExpectedType(
574 object, interceptor_holder);
576 depth2 = optimization.GetPrototypeDepthOfExpectedType(
577 interceptor_holder, Handle<JSObject>(lookup->holder()));
579 can_do_fast_api_call =
583 Counters* counters = masm->isolate()->counters();
584 __ IncrementCounter(counters->call_const_interceptor(), 1);
586 if (can_do_fast_api_call) {
587 __ IncrementCounter(counters->call_const_interceptor_fast_api(), 1);
588 ReserveSpaceForFastApiCall(masm, scratch1);
594 Label* miss = can_do_fast_api_call ? &miss_cleanup : miss_label;
596 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
597 scratch1, scratch2, scratch3,
602 Label regular_invoke;
603 LoadWithInterceptor(masm, receiver, holder, interceptor_holder,
611 if (*interceptor_holder != lookup->holder()) {
612 stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
613 Handle<JSObject>(lookup->holder()),
614 scratch1, scratch2, scratch3,
625 if (can_do_fast_api_call) {
626 GenerateFastApiCall(masm, optimization, arguments_.immediate());
631 __ InvokeFunction(optimization.constant_function(), arguments_,
636 if (can_do_fast_api_call) {
637 __ bind(&miss_cleanup);
638 FreeSpaceForFastApiCall(masm, scratch1);
643 __ bind(®ular_invoke);
644 if (can_do_fast_api_call) {
645 FreeSpaceForFastApiCall(masm, scratch1);
649 void CompileRegular(MacroAssembler* masm,
650 Handle<JSObject>
object,
656 Handle<JSObject> interceptor_holder,
659 stub_compiler_->CheckPrototypes(
object, receiver, interceptor_holder,
660 scratch1, scratch2, scratch3,
667 PushInterceptorArguments(masm, receiver, holder, name_, interceptor_holder);
669 __ CallExternalReference(
670 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
680 void LoadWithInterceptor(MacroAssembler* masm,
683 Handle<JSObject> holder_obj,
684 Label* interceptor_succeeded) {
690 CompileCallLoadPropertyWithInterceptor(masm,
701 __ CompareRoot(
rax, Heap::kNoInterceptorResultSentinelRootIndex);
705 StubCompiler* stub_compiler_;
706 const ParameterCount& arguments_;
712 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm,
Code::Kind kind) {
713 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC);
714 Handle<Code>
code = (kind == Code::LOAD_IC)
715 ? masm->isolate()->builtins()->LoadIC_Miss()
716 : masm->isolate()->builtins()->KeyedLoadIC_Miss();
717 __ Jump(code, RelocInfo::CODE_TARGET);
721 void StubCompiler::GenerateKeyedLoadMissForceGeneric(MacroAssembler* masm) {
723 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
724 __ Jump(code, RelocInfo::CODE_TARGET);
730 void StubCompiler::GenerateStoreField(MacroAssembler* masm,
731 Handle<JSObject>
object,
733 Handle<Map> transition,
735 Register receiver_reg,
740 LookupResult lookup(masm->isolate());
741 object->Lookup(*name, &lookup);
742 if (lookup.IsFound() && (lookup.IsReadOnly() || !lookup.IsCacheable())) {
753 __ CheckMap(receiver_reg, Handle<Map>(object->map()),
757 if (object->IsJSGlobalProxy()) {
758 __ CheckAccessGlobalProxy(receiver_reg, scratch1, miss_label);
762 if (!transition.is_null() &&
object->GetPrototype()->IsJSObject()) {
764 if (lookup.IsFound()) {
765 holder = lookup.holder();
771 }
while (holder->GetPrototype()->IsJSObject());
775 Label miss_pop, done_check;
776 CheckPrototypes(
object, receiver_reg, Handle<JSObject>(holder), name_reg,
777 scratch1, scratch2, name, &miss_pop);
782 __ bind(&done_check);
788 ASSERT(object->IsJSGlobalProxy() || !
object->IsAccessCheckNeeded());
791 if (!transition.is_null() && (
object->map()->unused_property_fields() == 0)) {
795 __ push(receiver_reg);
799 __ TailCallExternalReference(
800 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
807 if (!transition.is_null()) {
809 __ Move(scratch1, transition);
814 __ RecordWriteField(receiver_reg,
826 index -=
object->map()->inobject_properties();
830 int offset =
object->map()->instance_size() + (index *
kPointerSize);
835 __ movq(name_reg,
rax);
847 __ movq(name_reg,
rax);
860 static void GenerateCheckPropertyCell(MacroAssembler* masm,
861 Handle<GlobalObject> global,
865 Handle<JSGlobalPropertyCell> cell =
867 ASSERT(cell->value()->IsTheHole());
868 __ Move(scratch, cell);
870 masm->isolate()->factory()->the_hole_value());
877 static void GenerateCheckPropertyCells(MacroAssembler* masm,
878 Handle<JSObject>
object,
879 Handle<JSObject> holder,
883 Handle<JSObject> current = object;
884 while (!current.is_identical_to(holder)) {
885 if (current->IsGlobalObject()) {
886 GenerateCheckPropertyCell(masm,
887 Handle<GlobalObject>::cast(current),
892 current = Handle<JSObject>(
JSObject::cast(current->GetPrototype()));
897 #define __ ACCESS_MASM((masm()))
900 Register StubCompiler::CheckPrototypes(Handle<JSObject>
object,
902 Handle<JSObject> holder,
910 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
911 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
912 && !scratch2.is(scratch1));
917 Register reg = object_reg;
920 if (save_at_depth == depth) {
926 Handle<JSObject> current = object;
927 while (!current.is_identical_to(holder)) {
932 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
934 Handle<JSObject> prototype(
JSObject::cast(current->GetPrototype()));
935 if (!current->HasFastProperties() &&
936 !current->IsJSGlobalObject() &&
937 !current->IsJSGlobalProxy()) {
938 if (!name->IsSymbol()) {
939 name = factory()->LookupSymbol(name);
941 ASSERT(current->property_dictionary()->FindEntry(*name) ==
944 GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
951 bool in_new_space = heap()->InNewSpace(*prototype);
952 Handle<Map> current_map(current->map());
957 __ CheckMap(reg, Handle<Map>(current_map),
963 if (current->IsJSGlobalProxy()) {
964 __ CheckAccessGlobalProxy(reg, scratch2, miss);
974 __ Move(reg, prototype);
978 if (save_at_depth == depth) {
985 ASSERT(current.is_identical_to(holder));
988 LOG(isolate(), IntEvent(
"check-maps-depth", depth + 1));
991 __ CheckMap(reg, Handle<Map>(holder->map()),
995 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded());
996 if (current->IsJSGlobalProxy()) {
997 __ CheckAccessGlobalProxy(reg, scratch1, miss);
1003 GenerateCheckPropertyCells(masm(),
object, holder, name, scratch1, miss);
1010 void StubCompiler::GenerateLoadField(Handle<JSObject>
object,
1011 Handle<JSObject> holder,
1017 Handle<String> name,
1020 __ JumpIfSmi(receiver, miss);
1023 Register reg = CheckPrototypes(
1024 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1027 GenerateFastPropertyLoad(masm(),
rax, reg, holder, index);
1032 void StubCompiler::GenerateDictionaryLoadCallback(Register receiver,
1037 Handle<AccessorInfo> callback,
1038 Handle<String> name,
1040 ASSERT(!receiver.is(scratch1));
1041 ASSERT(!receiver.is(scratch2));
1042 ASSERT(!receiver.is(scratch3));
1045 Register dictionary = scratch1;
1057 __ bind(&probe_done);
1061 Register index = scratch3;
1062 const int kElementsStartOffset =
1065 const int kValueOffset = kElementsStartOffset +
kPointerSize;
1069 __ movq(scratch3, callback, RelocInfo::EMBEDDED_OBJECT);
1070 __ cmpq(scratch2, scratch3);
1075 void StubCompiler::GenerateLoadCallback(Handle<JSObject>
object,
1076 Handle<JSObject> holder,
1083 Handle<AccessorInfo> callback,
1084 Handle<String> name,
1087 __ JumpIfSmi(receiver, miss);
1090 Register reg = CheckPrototypes(
object, receiver, holder, scratch1,
1091 scratch2, scratch3, name, miss);
1093 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
1094 GenerateDictionaryLoadCallback(
1095 reg, name_reg, scratch2, scratch3, scratch4, callback, name, miss);
1099 ASSERT(!scratch2.is(reg));
1104 if (heap()->InNewSpace(callback->data())) {
1105 __ Move(scratch1, callback);
1108 __ Push(Handle<Object>(callback->data()));
1110 __ PushAddress(ExternalReference::isolate_address());
1115 #if defined(__MINGW64__)
1116 Register accessor_info_arg =
rdx;
1117 Register name_arg =
rcx;
1118 #elif defined(_WIN64)
1120 Register accessor_info_arg =
r8;
1121 Register name_arg =
rdx;
1123 Register accessor_info_arg =
rsi;
1124 Register name_arg =
rdi;
1127 ASSERT(!name_arg.is(scratch2));
1128 __ movq(name_arg,
rsp);
1132 const int kStackSpace = 5;
1135 const int kArgStackSpace = 1;
1137 __ PrepareCallApiFunction(kArgStackSpace);
1138 __ lea(
rax, Operand(name_arg, 4 * kPointerSize));
1147 Address getter_address = v8::ToCData<Address>(callback->getter());
1148 __ CallApiFunctionAndReturn(getter_address, kStackSpace);
1152 void StubCompiler::GenerateLoadConstant(Handle<JSObject>
object,
1153 Handle<JSObject> holder,
1158 Handle<JSFunction> value,
1159 Handle<String> name,
1162 __ JumpIfSmi(receiver, miss);
1166 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1169 __ LoadHeapObject(
rax, value);
1174 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject>
object,
1175 Handle<JSObject> interceptor_holder,
1176 LookupResult* lookup,
1182 Handle<String> name,
1184 ASSERT(interceptor_holder->HasNamedInterceptor());
1185 ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined());
1188 __ JumpIfSmi(receiver, miss);
1193 bool compile_followup_inline =
false;
1194 if (lookup->IsFound() && lookup->IsCacheable()) {
1195 if (lookup->IsField()) {
1196 compile_followup_inline =
true;
1197 }
else if (lookup->type() ==
CALLBACKS &&
1198 lookup->GetCallbackObject()->IsAccessorInfo()) {
1200 compile_followup_inline = callback->getter() !=
NULL &&
1201 callback->IsCompatibleReceiver(*
object);
1205 if (compile_followup_inline) {
1209 Register holder_reg = CheckPrototypes(
object, receiver, interceptor_holder,
1210 scratch1, scratch2, scratch3,
1212 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1));
1218 bool must_perfrom_prototype_check = *interceptor_holder != lookup->holder();
1219 bool must_preserve_receiver_reg = !receiver.is(holder_reg) &&
1220 (lookup->type() ==
CALLBACKS || must_perfrom_prototype_check);
1227 if (must_preserve_receiver_reg) {
1230 __ push(holder_reg);
1236 CompileCallLoadPropertyWithInterceptor(masm(),
1240 interceptor_holder);
1244 Label interceptor_failed;
1245 __ CompareRoot(
rax, Heap::kNoInterceptorResultSentinelRootIndex);
1246 __ j(
equal, &interceptor_failed);
1247 frame_scope.GenerateLeaveFrame();
1250 __ bind(&interceptor_failed);
1253 if (must_preserve_receiver_reg) {
1262 if (must_perfrom_prototype_check) {
1263 holder_reg = CheckPrototypes(interceptor_holder,
1265 Handle<JSObject>(lookup->holder()),
1273 if (lookup->IsField()) {
1276 GenerateFastPropertyLoad(masm(),
rax, holder_reg,
1277 Handle<JSObject>(lookup->holder()),
1278 lookup->GetFieldIndex());
1284 Handle<AccessorInfo> callback(
1293 __ push(holder_reg);
1294 __ Move(holder_reg, callback);
1296 __ PushAddress(ExternalReference::isolate_address());
1297 __ push(holder_reg);
1301 ExternalReference ref =
1302 ExternalReference(IC_Utility(IC::kLoadCallbackProperty),
1304 __ TailCallExternalReference(ref, 6, 1);
1309 Register holder_reg = CheckPrototypes(
object, receiver, interceptor_holder,
1310 scratch1, scratch2, scratch3,
1313 PushInterceptorArguments(masm(), receiver, holder_reg,
1314 name_reg, interceptor_holder);
1317 ExternalReference ref = ExternalReference(
1318 IC_Utility(IC::kLoadPropertyWithInterceptorForLoad), isolate());
1319 __ TailCallExternalReference(ref, 6, 1);
1324 void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) {
1325 if (kind_ == Code::KEYED_CALL_IC) {
1332 void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject>
object,
1333 Handle<JSObject> holder,
1334 Handle<String> name,
1336 ASSERT(holder->IsGlobalObject());
1339 const int argc = arguments().immediate();
1342 __ movq(
rdx, Operand(
rsp, (argc + 1) * kPointerSize));
1346 __ JumpIfSmi(
rdx, miss);
1347 CheckPrototypes(
object,
rdx, holder,
rbx,
rax,
rdi, name, miss);
1351 void CallStubCompiler::GenerateLoadFunctionFromCell(
1352 Handle<JSGlobalPropertyCell> cell,
1353 Handle<JSFunction>
function,
1360 if (heap()->InNewSpace(*
function)) {
1366 __ JumpIfSmi(
rdi, miss);
1371 __ Move(
rax, Handle<SharedFunctionInfo>(function->shared()));
1374 __ Cmp(
rdi,
function);
1380 void CallStubCompiler::GenerateMissBranch() {
1382 isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
1385 __ Jump(code, RelocInfo::CODE_TARGET);
1390 Handle<JSObject> holder,
1392 Handle<String> name) {
1404 GenerateNameCheck(name, &miss);
1407 const int argc = arguments().immediate();
1408 __ movq(
rdx, Operand(
rsp, (argc + 1) * kPointerSize));
1411 __ JumpIfSmi(
rdx, &miss);
1414 Register reg = CheckPrototypes(
object,
rdx, holder,
rbx,
rax,
rdi,
1417 GenerateFastPropertyLoad(masm(),
rdi, reg, holder, index);
1420 __ JumpIfSmi(
rdi, &miss);
1426 if (object->IsGlobalObject()) {
1428 __ movq(Operand(
rsp, (argc + 1) * kPointerSize),
rdx);
1436 NullCallWrapper(), call_kind);
1440 GenerateMissBranch();
1447 Handle<Code> CallStubCompiler::CompileArrayPushCall(
1448 Handle<Object>
object,
1449 Handle<JSObject> holder,
1450 Handle<JSGlobalPropertyCell> cell,
1451 Handle<JSFunction>
function,
1452 Handle<String> name) {
1462 if (!object->IsJSArray() || !cell.is_null())
return Handle<Code>::null();
1465 GenerateNameCheck(name, &miss);
1468 const int argc = arguments().immediate();
1469 __ movq(
rdx, Operand(
rsp, (argc + 1) * kPointerSize));
1472 __ JumpIfSmi(
rdx, &miss);
1474 CheckPrototypes(Handle<JSObject>::cast(
object),
rdx, holder,
rbx,
rax,
rdi,
1480 __ ret((argc + 1) * kPointerSize);
1485 Label attempt_to_grow_elements, with_write_barrier;
1492 factory()->fixed_array_map());
1498 __ addl(
rax, Immediate(argc));
1505 __ j(
greater, &attempt_to_grow_elements);
1508 __ movq(
rcx, Operand(
rsp, argc * kPointerSize));
1509 __ JumpIfNotSmi(
rcx, &with_write_barrier);
1518 FixedArray::kHeaderSize - argc * kPointerSize),
1522 __ ret((argc + 1) * kPointerSize);
1524 __ bind(&with_write_barrier);
1528 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
1529 Label fast_object, not_fast_object;
1530 __ CheckFastObjectElements(
rbx, ¬_fast_object, Label::kNear);
1531 __ jmp(&fast_object);
1533 __ bind(¬_fast_object);
1534 __ CheckFastSmiElements(
rbx, &call_builtin);
1538 Label try_holey_map;
1549 __ jmp(&fast_object);
1551 __ bind(&try_holey_map);
1560 __ bind(&fast_object);
1562 __ CheckFastObjectElements(
rbx, &call_builtin);
1571 FixedArray::kHeaderSize - argc * kPointerSize));
1578 __ ret((argc + 1) * kPointerSize);
1580 __ bind(&attempt_to_grow_elements);
1581 if (!FLAG_inline_new) {
1582 __ jmp(&call_builtin);
1585 __ movq(
rbx, Operand(
rsp, argc * kPointerSize));
1588 Label no_fast_elements_check;
1589 __ JumpIfSmi(
rbx, &no_fast_elements_check);
1591 __ CheckFastObjectElements(
rcx, &call_builtin, Label::kFar);
1592 __ bind(&no_fast_elements_check);
1594 ExternalReference new_space_allocation_top =
1595 ExternalReference::new_space_allocation_top_address(isolate());
1596 ExternalReference new_space_allocation_limit =
1597 ExternalReference::new_space_allocation_limit_address(isolate());
1599 const int kAllocationDelta = 4;
1606 FixedArray::kHeaderSize - argc * kPointerSize));
1609 __ addq(
rcx, Immediate(kAllocationDelta * kPointerSize));
1610 Operand limit_operand =
1611 masm()->ExternalOperand(new_space_allocation_limit);
1612 __ cmpq(
rcx, limit_operand);
1616 __ Store(new_space_allocation_top,
rcx);
1622 for (
int i = 1; i < kAllocationDelta; i++) {
1634 __ movq(
rdx, Operand(
rsp, (argc + 1) * kPointerSize));
1644 __ ret((argc + 1) * kPointerSize);
1647 __ bind(&call_builtin);
1648 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush,
1655 GenerateMissBranch();
1658 return GetCode(
function);
1662 Handle<Code> CallStubCompiler::CompileArrayPopCall(
1663 Handle<Object>
object,
1664 Handle<JSObject> holder,
1665 Handle<JSGlobalPropertyCell> cell,
1666 Handle<JSFunction>
function,
1667 Handle<String> name) {
1677 if (!object->IsJSArray() || !cell.is_null())
return Handle<Code>::null();
1679 Label miss, return_undefined, call_builtin;
1680 GenerateNameCheck(name, &miss);
1683 const int argc = arguments().immediate();
1684 __ movq(
rdx, Operand(
rsp, (argc + 1) * kPointerSize));
1687 __ JumpIfSmi(
rdx, &miss);
1689 CheckPrototypes(Handle<JSObject>::cast(
object),
rdx, holder,
rbx,
rax,
rdi,
1697 Heap::kFixedArrayMapRootIndex);
1702 __ subl(
rcx, Immediate(1));
1706 __ LoadRoot(
r9, Heap::kTheHoleValueRootIndex);
1709 FixedArray::kHeaderSize));
1721 FixedArray::kHeaderSize),
1723 __ ret((argc + 1) * kPointerSize);
1725 __ bind(&return_undefined);
1726 __ LoadRoot(
rax, Heap::kUndefinedValueRootIndex);
1727 __ ret((argc + 1) * kPointerSize);
1729 __ bind(&call_builtin);
1730 __ TailCallExternalReference(
1731 ExternalReference(Builtins::c_ArrayPop, isolate()),
1736 GenerateMissBranch();
1739 return GetCode(
function);
1743 Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
1744 Handle<Object>
object,
1745 Handle<JSObject> holder,
1746 Handle<JSGlobalPropertyCell> cell,
1747 Handle<JSFunction>
function,
1748 Handle<String> name) {
1758 if (!object->IsString() || !cell.is_null())
return Handle<Code>::null();
1760 const int argc = arguments().immediate();
1764 Label index_out_of_range;
1765 Label* index_out_of_range_label = &index_out_of_range;
1766 if (kind_ == Code::CALL_IC &&
1769 index_out_of_range_label = &miss;
1771 GenerateNameCheck(name, &name_miss);
1774 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1778 ASSERT(!
object.is_identical_to(holder));
1779 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1782 Register receiver =
rbx;
1783 Register index =
rdi;
1784 Register result =
rax;
1785 __ movq(receiver, Operand(
rsp, (argc + 1) * kPointerSize));
1787 __ movq(index, Operand(
rsp, (argc - 0) * kPointerSize));
1789 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1792 StringCharCodeAtGenerator
generator(receiver,
1797 index_out_of_range_label,
1800 __ ret((argc + 1) * kPointerSize);
1802 StubRuntimeCallHelper call_helper;
1803 generator.GenerateSlow(masm(), call_helper);
1805 if (index_out_of_range.is_linked()) {
1806 __ bind(&index_out_of_range);
1807 __ LoadRoot(
rax, Heap::kNanValueRootIndex);
1808 __ ret((argc + 1) * kPointerSize);
1814 __ bind(&name_miss);
1815 GenerateMissBranch();
1818 return GetCode(
function);
1822 Handle<Code> CallStubCompiler::CompileStringCharAtCall(
1823 Handle<Object>
object,
1824 Handle<JSObject> holder,
1825 Handle<JSGlobalPropertyCell> cell,
1826 Handle<JSFunction>
function,
1827 Handle<String> name) {
1837 if (!object->IsString() || !cell.is_null())
return Handle<Code>::null();
1839 const int argc = arguments().immediate();
1842 Label index_out_of_range;
1843 Label* index_out_of_range_label = &index_out_of_range;
1844 if (kind_ == Code::CALL_IC &&
1847 index_out_of_range_label = &miss;
1849 GenerateNameCheck(name, &name_miss);
1852 GenerateDirectLoadGlobalFunctionPrototype(masm(),
1856 ASSERT(!
object.is_identical_to(holder));
1857 CheckPrototypes(Handle<JSObject>(
JSObject::cast(object->GetPrototype())),
1860 Register receiver =
rax;
1861 Register index =
rdi;
1862 Register scratch =
rdx;
1863 Register result =
rax;
1864 __ movq(receiver, Operand(
rsp, (argc + 1) * kPointerSize));
1866 __ movq(index, Operand(
rsp, (argc - 0) * kPointerSize));
1868 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1871 StringCharAtGenerator
generator(receiver,
1877 index_out_of_range_label,
1880 __ ret((argc + 1) * kPointerSize);
1882 StubRuntimeCallHelper call_helper;
1883 generator.GenerateSlow(masm(), call_helper);
1885 if (index_out_of_range.is_linked()) {
1886 __ bind(&index_out_of_range);
1887 __ LoadRoot(
rax, Heap::kEmptyStringRootIndex);
1888 __ ret((argc + 1) * kPointerSize);
1893 __ bind(&name_miss);
1894 GenerateMissBranch();
1897 return GetCode(
function);
1901 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
1902 Handle<Object>
object,
1903 Handle<JSObject> holder,
1904 Handle<JSGlobalPropertyCell> cell,
1905 Handle<JSFunction>
function,
1906 Handle<String> name) {
1917 const int argc = arguments().immediate();
1918 if (!object->IsJSObject() || argc != 1)
return Handle<Code>::null();
1921 GenerateNameCheck(name, &miss);
1923 if (cell.is_null()) {
1924 __ movq(rdx, Operand(
rsp, 2 * kPointerSize));
1925 __ JumpIfSmi(rdx, &miss);
1926 CheckPrototypes(Handle<JSObject>::cast(
object), rdx, holder, rbx,
rax, rdi,
1929 ASSERT(cell->value() == *
function);
1930 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
1932 GenerateLoadFunctionFromCell(cell,
function, &miss);
1936 Register code =
rbx;
1937 __ movq(code, Operand(
rsp, 1 * kPointerSize));
1941 __ JumpIfNotSmi(code, &slow);
1948 __ ret(2 * kPointerSize);
1950 StubRuntimeCallHelper call_helper;
1951 generator.GenerateSlow(masm(), call_helper);
1960 NullCallWrapper(), call_kind);
1964 GenerateMissBranch();
1967 return cell.is_null() ? GetCode(
function) : GetCode(Code::
NORMAL, name);
1971 Handle<Code> CallStubCompiler::CompileMathFloorCall(
1972 Handle<Object>
object,
1973 Handle<JSObject> holder,
1974 Handle<JSGlobalPropertyCell> cell,
1975 Handle<JSFunction>
function,
1976 Handle<String> name) {
1982 Handle<Code> CallStubCompiler::CompileMathAbsCall(
1983 Handle<Object>
object,
1984 Handle<JSObject> holder,
1985 Handle<JSGlobalPropertyCell> cell,
1986 Handle<JSFunction>
function,
1987 Handle<String> name) {
1998 const int argc = arguments().immediate();
1999 if (!object->IsJSObject() || argc != 1)
return Handle<Code>::null();
2002 GenerateNameCheck(name, &miss);
2004 if (cell.is_null()) {
2005 __ movq(rdx, Operand(
rsp, 2 * kPointerSize));
2006 __ JumpIfSmi(rdx, &miss);
2007 CheckPrototypes(Handle<JSObject>::cast(
object), rdx, holder, rbx,
rax, rdi,
2010 ASSERT(cell->value() == *
function);
2011 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(
object), holder, name,
2013 GenerateLoadFunctionFromCell(cell,
function, &miss);
2016 __ movq(
rax, Operand(
rsp, 1 * kPointerSize));
2021 __ JumpIfNotSmi(
rax, ¬_smi);
2042 __ ret(2 * kPointerSize);
2051 Label negative_sign;
2052 const int sign_mask_shift =
2058 __ ret(2 * kPointerSize);
2062 __ bind(&negative_sign);
2064 __ AllocateHeapNumber(
rax, rdx, &slow);
2066 __ ret(2 * kPointerSize);
2075 NullCallWrapper(), call_kind);
2079 GenerateMissBranch();
2082 return cell.is_null() ? GetCode(
function) : GetCode(Code::
NORMAL, name);
2086 Handle<Code> CallStubCompiler::CompileFastApiCall(
2087 const CallOptimization& optimization,
2088 Handle<Object>
object,
2089 Handle<JSObject> holder,
2090 Handle<JSGlobalPropertyCell> cell,
2091 Handle<JSFunction>
function,
2092 Handle<String> name) {
2093 ASSERT(optimization.is_simple_api_call());
2096 if (object->IsGlobalObject())
return Handle<Code>::null();
2097 if (!cell.is_null())
return Handle<Code>::null();
2098 if (!object->IsJSObject())
return Handle<Code>::null();
2099 int depth = optimization.GetPrototypeDepthOfExpectedType(
2100 Handle<JSObject>::cast(
object), holder);
2103 Label miss, miss_before_stack_reserved;
2104 GenerateNameCheck(name, &miss_before_stack_reserved);
2107 const int argc = arguments().immediate();
2108 __ movq(rdx, Operand(
rsp, (argc + 1) * kPointerSize));
2111 __ JumpIfSmi(rdx, &miss_before_stack_reserved);
2113 Counters* counters = isolate()->counters();
2114 __ IncrementCounter(counters->call_const(), 1);
2115 __ IncrementCounter(counters->call_const_fast_api(), 1);
2119 __ subq(
rsp, Immediate(kFastApiCallArguments * kPointerSize));
2122 CheckPrototypes(Handle<JSObject>::cast(
object), rdx, holder, rbx,
rax, rdi,
2123 name, depth, &miss);
2126 __ movq(
rax, Operand(
rsp, 4 * kPointerSize));
2127 __ movq(Operand(
rsp, 0 * kPointerSize),
rax);
2129 GenerateFastApiCall(masm(), optimization, argc);
2132 __ addq(
rsp, Immediate(kFastApiCallArguments * kPointerSize));
2134 __ bind(&miss_before_stack_reserved);
2135 GenerateMissBranch();
2138 return GetCode(
function);
2143 Handle<JSObject> holder,
2144 Handle<JSFunction>
function,
2145 Handle<String> name,
2158 Handle<Code> code = CompileCustomCall(
object, holder,
2159 Handle<JSGlobalPropertyCell>::null(),
2162 if (!code.is_null())
return code;
2166 GenerateNameCheck(name, &miss);
2169 const int argc = arguments().immediate();
2170 __ movq(rdx, Operand(
rsp, (argc + 1) * kPointerSize));
2174 __ JumpIfSmi(rdx, &miss);
2181 Counters* counters = isolate()->counters();
2184 __ IncrementCounter(counters->call_const(), 1);
2187 CheckPrototypes(Handle<JSObject>::cast(
object), rdx, holder, rbx,
rax,
2192 if (object->IsGlobalObject()) {
2194 __ movq(Operand(
rsp, (argc + 1) * kPointerSize), rdx);
2199 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2204 GenerateDirectLoadGlobalFunctionPrototype(
2217 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2220 __ JumpIfSmi(rdx, &fast);
2225 GenerateDirectLoadGlobalFunctionPrototype(
2238 if (function->IsBuiltin() || !
function->shared()->is_classic_mode()) {
2241 __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
2243 __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
2247 GenerateDirectLoadGlobalFunctionPrototype(
2264 NullCallWrapper(), call_kind);
2268 GenerateMissBranch();
2271 return GetCode(
function);
2276 Handle<JSObject> holder,
2277 Handle<String> name) {
2288 GenerateNameCheck(name, &miss);
2291 const int argc = arguments().immediate();
2293 LookupResult lookup(isolate());
2294 LookupPostInterceptor(holder, name, &lookup);
2297 __ movq(rdx, Operand(
rsp, (argc + 1) * kPointerSize));
2299 CallInterceptorCompiler compiler(
this, arguments(),
rcx, extra_state_);
2300 compiler.Compile(masm(),
object, holder, name, &lookup, rdx, rbx, rdi,
rax,
2304 __ movq(rdx, Operand(
rsp, (argc + 1) * kPointerSize));
2307 __ JumpIfSmi(
rax, &miss);
2313 if (object->IsGlobalObject()) {
2315 __ movq(Operand(
rsp, (argc + 1) * kPointerSize), rdx);
2324 NullCallWrapper(), call_kind);
2328 GenerateMissBranch();
2336 Handle<JSObject>
object,
2337 Handle<GlobalObject> holder,
2338 Handle<JSGlobalPropertyCell> cell,
2339 Handle<JSFunction>
function,
2340 Handle<String> name) {
2352 Handle<Code> code = CompileCustomCall(
object, holder, cell,
function, name);
2354 if (!code.is_null())
return code;
2358 GenerateNameCheck(name, &miss);
2361 const int argc = arguments().immediate();
2362 GenerateGlobalReceiverCheck(
object, holder, name, &miss);
2363 GenerateLoadFunctionFromCell(cell,
function, &miss);
2366 if (object->IsGlobalObject()) {
2368 __ movq(Operand(
rsp, (argc + 1) * kPointerSize), rdx);
2375 Counters* counters = isolate()->counters();
2376 __ IncrementCounter(counters->call_global_inline(), 1);
2377 ParameterCount expected(function->shared()->formal_parameter_count());
2386 NullCallWrapper(), call_kind);
2390 __ IncrementCounter(counters->call_global_inline_miss(), 1);
2391 GenerateMissBranch();
2400 Handle<Map> transition,
2401 Handle<String> name) {
2411 GenerateStoreField(masm(),
2421 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2422 __ Jump(ic, RelocInfo::CODE_TARGET);
2425 return GetCode(transition.is_null()
2432 Handle<String> name,
2433 Handle<JSObject> receiver,
2434 Handle<JSObject> holder,
2435 Handle<AccessorInfo> callback) {
2444 __ JumpIfSmi(rdx, &miss);
2445 CheckPrototypes(receiver, rdx, holder, rbx,
r8, rdi, name, &miss);
2448 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
2458 ExternalReference store_callback_property =
2459 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
2460 __ TailCallExternalReference(store_callback_property, 4, 1);
2464 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2465 __ Jump(ic, RelocInfo::CODE_TARGET);
2473 #define __ ACCESS_MASM(masm)
2477 MacroAssembler* masm,
2478 Handle<JSFunction> setter) {
2491 if (!setter.is_null()) {
2495 ParameterCount actual(1);
2501 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2515 #define __ ACCESS_MASM(masm())
2519 Handle<String> name,
2520 Handle<JSObject> receiver,
2521 Handle<JSObject> holder,
2522 Handle<JSFunction> setter) {
2532 __ JumpIfSmi(rdx, &miss);
2533 CheckPrototypes(receiver, rdx, holder, rbx,
r8, rdi, name, &miss);
2538 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2539 __ Jump(ic, RelocInfo::CODE_TARGET);
2547 Handle<JSObject> receiver,
2548 Handle<String> name) {
2558 __ CheckMap(rdx, Handle<Map>(receiver->map()), &miss,
2562 if (receiver->IsJSGlobalProxy()) {
2563 __ CheckAccessGlobalProxy(rdx, rbx, &miss);
2568 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded());
2578 ExternalReference store_ic_property =
2579 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate());
2580 __ TailCallExternalReference(store_ic_property, 4, 1);
2584 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2585 __ Jump(ic, RelocInfo::CODE_TARGET);
2593 Handle<GlobalObject>
object,
2594 Handle<JSGlobalPropertyCell> cell,
2595 Handle<String> name) {
2606 Handle<Map>(object->map()));
2617 __ CompareRoot(cell_operand, Heap::kTheHoleValueRootIndex);
2621 __ movq(cell_operand,
rax);
2625 Counters* counters = isolate()->counters();
2626 __ IncrementCounter(counters->named_store_global_inline(), 1);
2631 __ IncrementCounter(counters->named_store_global_inline_miss(), 1);
2632 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2633 __ Jump(ic, RelocInfo::CODE_TARGET);
2642 Handle<Map> transition,
2643 Handle<String> name) {
2652 Counters* counters = isolate()->counters();
2653 __ IncrementCounter(counters->keyed_store_field(), 1);
2660 GenerateStoreField(masm(),
2670 __ DecrementCounter(counters->keyed_store_field(), 1);
2671 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2672 __ Jump(ic, RelocInfo::CODE_TARGET);
2675 return GetCode(transition.is_null()
2682 Handle<Map> receiver_map) {
2690 ElementsKind elements_kind = receiver_map->elements_kind();
2691 bool is_js_array = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
2693 KeyedStoreElementStub(is_js_array, elements_kind, grow_mode_).GetCode();
2697 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2698 __ jmp(ic, RelocInfo::CODE_TARGET);
2701 return GetCode(
Code::NORMAL, factory()->empty_string());
2716 __ JumpIfSmi(rdx, &miss, Label::kNear);
2719 int receiver_count = receiver_maps->length();
2720 for (
int i = 0; i < receiver_count; ++i) {
2722 __ Cmp(rdi, receiver_maps->at(i));
2723 if (transitioned_maps->at(i).is_null()) {
2724 __ j(
equal, handler_stubs->at(i), RelocInfo::CODE_TARGET);
2728 __ movq(rbx, transitioned_maps->at(i), RelocInfo::EMBEDDED_OBJECT);
2729 __ jmp(handler_stubs->at(i), RelocInfo::CODE_TARGET);
2735 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2736 __ jmp(ic, RelocInfo::CODE_TARGET);
2744 Handle<JSObject>
object,
2745 Handle<JSObject> last) {
2754 __ JumpIfSmi(
rax, &miss);
2759 CheckPrototypes(
object,
rax, last, rbx, rdx, rdi, name, &miss);
2763 if (last->IsGlobalObject()) {
2764 GenerateCheckPropertyCell(
2765 masm(), Handle<GlobalObject>::cast(last), name, rdx, &miss);
2770 __ LoadRoot(
rax, Heap::kUndefinedValueRootIndex);
2774 GenerateLoadMiss(masm(), Code::LOAD_IC);
2782 Handle<JSObject> holder,
2784 Handle<String> name) {
2792 GenerateLoadField(
object, holder,
rax, rbx, rdx, rdi, index, name, &miss);
2794 GenerateLoadMiss(masm(), Code::LOAD_IC);
2802 Handle<String> name,
2803 Handle<JSObject>
object,
2804 Handle<JSObject> holder,
2805 Handle<AccessorInfo> callback) {
2812 GenerateLoadCallback(
object, holder,
rax,
rcx, rdx, rbx, rdi,
r8, callback,
2815 GenerateLoadMiss(masm(), Code::LOAD_IC);
2823 #define __ ACCESS_MASM(masm)
2827 Handle<JSFunction> getter) {
2836 if (!getter.is_null()) {
2839 ParameterCount actual(0);
2845 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
2856 #define __ ACCESS_MASM(masm())
2860 Handle<String> name,
2861 Handle<JSObject> receiver,
2862 Handle<JSObject> holder,
2863 Handle<JSFunction> getter) {
2872 __ JumpIfSmi(
rax, &miss);
2873 CheckPrototypes(receiver,
rax, holder, rbx, rdx, rdi, name, &miss);
2878 GenerateLoadMiss(masm(), Code::LOAD_IC);
2886 Handle<JSObject> holder,
2887 Handle<JSFunction> value,
2888 Handle<String> name) {
2896 GenerateLoadConstant(
object, holder,
rax, rbx, rdx, rdi, value, name, &miss);
2898 GenerateLoadMiss(masm(), Code::LOAD_IC);
2906 Handle<JSObject> holder,
2907 Handle<String> name) {
2914 LookupResult lookup(isolate());
2915 LookupPostInterceptor(holder, name, &lookup);
2919 GenerateLoadInterceptor(receiver, holder, &lookup,
rax,
rcx, rdx, rbx, rdi,
2922 GenerateLoadMiss(masm(), Code::LOAD_IC);
2930 Handle<JSObject>
object,
2931 Handle<GlobalObject> holder,
2932 Handle<JSGlobalPropertyCell> cell,
2933 Handle<String> name,
2934 bool is_dont_delete) {
2943 __ JumpIfSmi(
rax, &miss);
2944 CheckPrototypes(
object,
rax, holder, rbx, rdx, rdi, name, &miss);
2951 if (!is_dont_delete) {
2952 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
2954 }
else if (FLAG_debug_code) {
2955 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
2956 __ Check(
not_equal,
"DontDelete cells can't contain the hole");
2959 Counters* counters = isolate()->counters();
2960 __ IncrementCounter(counters->named_load_global_stub(), 1);
2965 __ IncrementCounter(counters->named_load_global_stub_miss(), 1);
2966 GenerateLoadMiss(masm(), Code::LOAD_IC);
2974 Handle<JSObject> receiver,
2975 Handle<JSObject> holder,
2984 Counters* counters = isolate()->counters();
2985 __ IncrementCounter(counters->keyed_load_field(), 1);
2991 GenerateLoadField(receiver, holder, rdx, rbx,
rcx, rdi, index, name, &miss);
2994 __ DecrementCounter(counters->keyed_load_field(), 1);
2995 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3003 Handle<String> name,
3004 Handle<JSObject> receiver,
3005 Handle<JSObject> holder,
3006 Handle<AccessorInfo> callback) {
3013 Counters* counters = isolate()->counters();
3014 __ IncrementCounter(counters->keyed_load_callback(), 1);
3020 GenerateLoadCallback(receiver, holder, rdx,
rax, rbx,
rcx, rdi,
r8, callback,
3023 __ DecrementCounter(counters->keyed_load_callback(), 1);
3024 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3032 Handle<String> name,
3033 Handle<JSObject> receiver,
3034 Handle<JSObject> holder,
3035 Handle<JSFunction> value) {
3043 Counters* counters = isolate()->counters();
3044 __ IncrementCounter(counters->keyed_load_constant_function(), 1);
3050 GenerateLoadConstant(receiver, holder, rdx, rbx,
rcx, rdi,
3051 value, name, &miss);
3053 __ DecrementCounter(counters->keyed_load_constant_function(), 1);
3054 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3062 Handle<JSObject> receiver,
3063 Handle<JSObject> holder,
3064 Handle<String> name) {
3071 Counters* counters = isolate()->counters();
3072 __ IncrementCounter(counters->keyed_load_interceptor(), 1);
3078 LookupResult lookup(isolate());
3079 LookupPostInterceptor(holder, name, &lookup);
3080 GenerateLoadInterceptor(receiver, holder, &lookup, rdx,
rax,
rcx, rbx, rdi,
3083 __ DecrementCounter(counters->keyed_load_interceptor(), 1);
3084 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3092 Handle<String> name) {
3100 Counters* counters = isolate()->counters();
3101 __ IncrementCounter(counters->keyed_load_array_length(), 1);
3107 GenerateLoadArrayLength(masm(), rdx,
rcx, &miss);
3109 __ DecrementCounter(counters->keyed_load_array_length(), 1);
3110 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3118 Handle<String> name) {
3126 Counters* counters = isolate()->counters();
3127 __ IncrementCounter(counters->keyed_load_string_length(), 1);
3133 GenerateLoadStringLength(masm(), rdx,
rcx, rbx, &miss,
true);
3135 __ DecrementCounter(counters->keyed_load_string_length(), 1);
3136 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3144 Handle<String> name) {
3152 Counters* counters = isolate()->counters();
3153 __ IncrementCounter(counters->keyed_load_function_prototype(), 1);
3159 GenerateLoadFunctionPrototype(masm(), rdx,
rcx, rbx, &miss);
3161 __ DecrementCounter(counters->keyed_load_function_prototype(), 1);
3162 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3170 Handle<Map> receiver_map) {
3176 ElementsKind elements_kind = receiver_map->elements_kind();
3177 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode();
3181 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3182 __ jmp(ic, RelocInfo::CODE_TARGET);
3185 return GetCode(
Code::NORMAL, factory()->empty_string());
3198 __ JumpIfSmi(rdx, &miss);
3200 Register map_reg =
rbx;
3202 int receiver_count = receiver_maps->length();
3203 for (
int current = 0; current < receiver_count; ++current) {
3205 __ Cmp(map_reg, receiver_maps->at(current));
3206 __ j(
equal, handler_ics->at(current), RelocInfo::CODE_TARGET);
3210 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3220 Handle<JSFunction>
function) {
3227 Label generic_stub_call;
3230 __ Move(
r8, factory()->undefined_value());
3232 #ifdef ENABLE_DEBUGGER_SUPPORT
3246 __ JumpIfSmi(rbx, &generic_stub_call);
3255 __ Assert(
not_equal,
"Function constructed by construct stub.");
3270 __ Move(rbx, factory()->empty_fixed_array());
3289 Handle<SharedFunctionInfo> shared(function->shared());
3290 for (
int i = 0; i < shared->this_property_assignments_count(); i++) {
3291 if (shared->IsThisPropertyAssignmentArgument(i)) {
3295 int arg_number = shared->GetThisPropertyAssignmentArgument(i);
3297 __ cmpq(
rax, Immediate(arg_number));
3298 __ cmovq(
above, rbx, Operand(
rcx, arg_number * -kPointerSize));
3300 __ movq(Operand(
r9, i * kPointerSize), rbx);
3303 Handle<Object> constant(shared->GetThisPropertyAssignmentConstant(i));
3304 __ Move(Operand(
r9, i * kPointerSize), constant);
3309 ASSERT(function->has_initial_map());
3310 for (
int i = shared->this_property_assignments_count();
3311 i <
function->initial_map()->inobject_properties();
3313 __ movq(Operand(
r9, i * kPointerSize),
r8);
3329 Counters* counters = isolate()->counters();
3330 __ IncrementCounter(counters->constructed_objects(), 1);
3331 __ IncrementCounter(counters->constructed_objects_stub(), 1);
3336 __ bind(&generic_stub_call);
3337 Handle<Code> code = isolate()->builtins()->JSConstructStubGeneric();
3338 __ Jump(code, RelocInfo::CODE_TARGET);
3346 #define __ ACCESS_MASM(masm)
3350 MacroAssembler* masm) {
3356 Label slow, miss_force_generic;
3361 __ JumpIfNotSmi(
rax, &miss_force_generic);
3362 __ SmiToInteger32(rbx,
rax);
3370 __ LoadFromNumberDictionary(&slow,
rcx,
rax, rbx,
r9, rdi,
rax);
3379 Handle<Code> slow_ic =
3380 masm->isolate()->builtins()->KeyedLoadIC_Slow();
3381 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3383 __ bind(&miss_force_generic);
3389 Handle<Code> miss_ic =
3390 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3391 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3395 static void GenerateSmiKeyCheck(MacroAssembler* masm,
3398 XMMRegister xmm_scratch0,
3399 XMMRegister xmm_scratch1,
3404 __ JumpIfSmi(key, &key_ok);
3406 masm->isolate()->factory()->heap_number_map(),
3410 __ cvttsd2si(scratch, xmm_scratch0);
3411 __ cvtlsi2sd(xmm_scratch1, scratch);
3412 __ ucomisd(xmm_scratch1, xmm_scratch0);
3415 __ Integer32ToSmi(key, scratch);
3421 MacroAssembler* masm,
3428 Label slow, miss_force_generic;
3434 GenerateSmiKeyCheck(masm,
rax,
rcx,
xmm0,
xmm1, &miss_force_generic);
3449 switch (elements_kind) {
3494 __ JumpIfUIntNotValidSmiValue(
rcx, &box_int, Label::kNear);
3507 __ AllocateHeapNumber(
rcx, rbx, &slow);
3516 __ AllocateHeapNumber(
rcx, rbx, &slow);
3528 Counters* counters = masm->isolate()->counters();
3529 __ IncrementCounter(counters->keyed_load_external_array_slow(), 1);
3537 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Slow();
3538 __ jmp(ic, RelocInfo::CODE_TARGET);
3541 __ bind(&miss_force_generic);
3548 Handle<Code> miss_ic =
3549 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3550 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3555 MacroAssembler* masm,
3563 Label slow, miss_force_generic;
3569 GenerateSmiKeyCheck(masm,
rcx, rbx,
xmm0,
xmm1, &miss_force_generic);
3573 __ SmiToInteger32(rdi,
rcx);
3585 Label check_heap_number;
3588 __ JumpIfNotSmi(
rax, &slow);
3590 __ JumpIfNotSmi(
rax, &check_heap_number, Label::kNear);
3593 __ SmiToInteger32(rdx,
rax);
3596 switch (elements_kind) {
3600 __ testl(rdx, Immediate(0xFFFFFF00));
3601 __ j(
zero, &done, Label::kNear);
3606 __ movb(Operand(rbx, rdi,
times_1, 0), rdx);
3610 __ movb(Operand(rbx, rdi,
times_1, 0), rdx);
3614 __ movw(Operand(rbx, rdi,
times_2, 0), rdx);
3618 __ movl(Operand(rbx, rdi,
times_4, 0), rdx);
3645 __ bind(&check_heap_number);
3683 switch (elements_kind) {
3724 Handle<Code> ic = masm->isolate()->builtins()->KeyedStoreIC_Slow();
3725 __ jmp(ic, RelocInfo::CODE_TARGET);
3728 __ bind(&miss_force_generic);
3737 Handle<Code> miss_ic =
3738 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3739 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3749 Label miss_force_generic;
3755 GenerateSmiKeyCheck(masm,
rax,
rcx,
xmm0,
xmm1, &miss_force_generic);
3759 __ AssertFastElements(
rcx);
3770 FixedArray::kHeaderSize));
3771 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
3772 __ j(
equal, &miss_force_generic);
3776 __ bind(&miss_force_generic);
3777 Code* code = masm->isolate()->builtins()->builtin(
3778 Builtins::kKeyedLoadIC_MissForceGeneric);
3779 Handle<Code> ic(code);
3780 __ jmp(ic, RelocInfo::CODE_TARGET);
3785 MacroAssembler* masm) {
3791 Label miss_force_generic, slow_allocate_heapnumber;
3797 GenerateSmiKeyCheck(masm,
rax,
rcx,
xmm0,
xmm1, &miss_force_generic);
3801 __ AssertFastElements(
rcx);
3812 __ j(
equal, &miss_force_generic);
3817 __ AllocateHeapNumber(
rcx, rbx, &slow_allocate_heapnumber);
3823 __ bind(&slow_allocate_heapnumber);
3824 Handle<Code> slow_ic =
3825 masm->isolate()->builtins()->KeyedLoadIC_Slow();
3826 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3828 __ bind(&miss_force_generic);
3829 Handle<Code> miss_ic =
3830 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3831 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3836 MacroAssembler* masm,
3846 Label miss_force_generic, transition_elements_kind, finish_store, grow;
3847 Label check_capacity, slow;
3853 GenerateSmiKeyCheck(masm,
rcx, rbx,
xmm0,
xmm1, &miss_force_generic);
3856 __ JumpIfNotSmi(
rax, &transition_elements_kind);
3875 Heap::kFixedArrayMapRootIndex);
3878 __ bind(&finish_store);
3899 __ bind(&miss_force_generic);
3900 Handle<Code> ic_force_generic =
3901 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3902 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3904 __ bind(&transition_elements_kind);
3905 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
3906 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3920 __ CompareRoot(rdi, Heap::kEmptyFixedArrayRootIndex);
3932 masm->isolate()->factory()->fixed_array_map());
3935 __ LoadRoot(rbx, Heap::kTheHoleValueRootIndex);
3952 __ bind(&check_capacity);
3955 Heap::kFixedCOWArrayMapRootIndex);
3956 __ j(
equal, &miss_force_generic);
3969 __ jmp(&finish_store);
3972 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
3973 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3979 MacroAssembler* masm,
3988 Label miss_force_generic, transition_elements_kind, finish_store;
3989 Label grow, slow, check_capacity;
3995 GenerateSmiKeyCheck(masm,
rcx, rbx,
xmm0,
xmm1, &miss_force_generic);
3999 __ AssertFastElements(rdi);
4015 __ bind(&finish_store);
4018 &transition_elements_kind);
4022 __ bind(&miss_force_generic);
4023 Handle<Code> ic_force_generic =
4024 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4025 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
4027 __ bind(&transition_elements_kind);
4030 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4031 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
4044 __ JumpIfSmi(
rax, &value_is_smi);
4046 Heap::kHeapNumberMapRootIndex);
4048 __ bind(&value_is_smi);
4053 __ CompareRoot(rdi, Heap::kEmptyFixedArrayRootIndex);
4066 masm->isolate()->factory()->fixed_double_array_map());
4078 __ jmp(&finish_store);
4080 __ bind(&check_capacity);
4092 __ jmp(&finish_store);
4095 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow();
4096 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4105 #endif // V8_TARGET_ARCH_X64
static const int kBitFieldOffset
Handle< Code > CompileLoadFunctionPrototype(Handle< String > name)
static const int kMaxLength
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 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)
Operand StackSpaceOperand(int index)
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
const Register kScratchRegister
static const int kContextOffset
static void GenerateLoadFastElement(MacroAssembler *masm)
static const uint32_t kSignMask
v8::Handle< v8::Value > Load(const v8::Arguments &args)
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
static const int kNativeContextOffset
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 kMaxValue
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 JSFunction * cast(Object *obj)