1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h"
11 #include "src/ic/ic.h"
16 #define __ ACCESS_MASM(masm)
19 void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
20 MacroAssembler* masm, Handle<HeapType> type, Register receiver,
21 Handle<JSFunction> getter) {
23 FrameScope scope(masm, StackFrame::INTERNAL);
25 if (!getter.is_null()) {
26 // Call the JavaScript getter with the receiver on the stack.
27 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
28 // Swap in the global receiver.
30 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
33 ParameterCount actual(0);
34 ParameterCount expected(getter);
35 __ InvokeFunction(getter, expected, actual, CALL_FUNCTION,
38 // If we generate a global code snippet for deoptimization only, remember
39 // the place to continue after deoptimization.
40 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
43 // Restore context register.
44 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
50 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
51 MacroAssembler* masm, Label* miss_label, Register receiver,
52 Handle<Name> name, Register scratch0, Register scratch1) {
53 DCHECK(name->IsUniqueName());
54 DCHECK(!receiver.is(scratch0));
55 Counters* counters = masm->isolate()->counters();
56 __ IncrementCounter(counters->negative_lookups(), 1);
57 __ IncrementCounter(counters->negative_lookups_miss(), 1);
59 __ mov(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
61 const int kInterceptorOrAccessCheckNeededMask =
62 (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
64 // Bail out if the receiver has a named interceptor or requires access checks.
65 __ test_b(FieldOperand(scratch0, Map::kBitFieldOffset),
66 kInterceptorOrAccessCheckNeededMask);
67 __ j(not_zero, miss_label);
69 // Check that receiver is a JSObject.
70 __ CmpInstanceType(scratch0, FIRST_SPEC_OBJECT_TYPE);
71 __ j(below, miss_label);
73 // Load properties array.
74 Register properties = scratch0;
75 __ mov(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
77 // Check that the properties array is a dictionary.
78 __ cmp(FieldOperand(properties, HeapObject::kMapOffset),
79 Immediate(masm->isolate()->factory()->hash_table_map()));
80 __ j(not_equal, miss_label);
83 NameDictionaryLookupStub::GenerateNegativeLookup(masm, miss_label, &done,
84 properties, name, scratch1);
86 __ DecrementCounter(counters->negative_lookups_miss(), 1);
90 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
91 MacroAssembler* masm, int index, Register prototype, Label* miss) {
92 // Get the global function with the given index.
93 Handle<JSFunction> function(
94 JSFunction::cast(masm->isolate()->native_context()->get(index)));
95 // Check we're still in the same context.
96 Register scratch = prototype;
97 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
98 __ mov(scratch, Operand(esi, offset));
99 __ mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset));
100 __ cmp(Operand(scratch, Context::SlotOffset(index)), function);
101 __ j(not_equal, miss);
103 // Load its initial map. The global functions all have initial maps.
104 __ Move(prototype, Immediate(Handle<Map>(function->initial_map())));
105 // Load the prototype from the initial map.
106 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
110 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
111 MacroAssembler* masm, Register receiver, Register scratch1,
112 Register scratch2, Label* miss_label) {
113 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
114 __ mov(eax, scratch1);
119 // Generate call to api function.
120 // This function uses push() to generate smaller, faster code than
121 // the version above. It is an optimization that should will be removed
122 // when api call ICs are generated in hydrogen.
123 void PropertyHandlerCompiler::GenerateFastApiCall(
124 MacroAssembler* masm, const CallOptimization& optimization,
125 Handle<Map> receiver_map, Register receiver, Register scratch_in,
126 bool is_store, int argc, Register* values) {
127 // Copy return value.
131 // Write the arguments to stack frame.
132 for (int i = 0; i < argc; i++) {
133 Register arg = values[argc - 1 - i];
134 DCHECK(!receiver.is(arg));
135 DCHECK(!scratch_in.is(arg));
139 // Stack now matches JSFunction abi.
140 DCHECK(optimization.is_simple_api_call());
142 // Abi for CallApiFunctionStub.
143 Register callee = eax;
144 Register call_data = ebx;
145 Register holder = ecx;
146 Register api_function_address = edx;
147 Register scratch = edi; // scratch_in is no longer valid.
149 // Put holder in place.
150 CallOptimization::HolderLookup holder_lookup;
151 Handle<JSObject> api_holder =
152 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup);
153 switch (holder_lookup) {
154 case CallOptimization::kHolderIsReceiver:
155 __ Move(holder, receiver);
157 case CallOptimization::kHolderFound:
158 __ LoadHeapObject(holder, api_holder);
160 case CallOptimization::kHolderNotFound:
165 Isolate* isolate = masm->isolate();
166 Handle<JSFunction> function = optimization.constant_function();
167 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
168 Handle<Object> call_data_obj(api_call_info->data(), isolate);
170 // Put callee in place.
171 __ LoadHeapObject(callee, function);
173 bool call_data_undefined = false;
174 // Put call_data in place.
175 if (isolate->heap()->InNewSpace(*call_data_obj)) {
176 __ mov(scratch, api_call_info);
177 __ mov(call_data, FieldOperand(scratch, CallHandlerInfo::kDataOffset));
178 } else if (call_data_obj->IsUndefined()) {
179 call_data_undefined = true;
180 __ mov(call_data, Immediate(isolate->factory()->undefined_value()));
182 __ mov(call_data, call_data_obj);
185 // Put api_function_address in place.
186 Address function_address = v8::ToCData<Address>(api_call_info->callback());
187 __ mov(api_function_address, Immediate(function_address));
190 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc);
191 __ TailCallStub(&stub);
195 // Generate code to check that a global property cell is empty. Create
196 // the property cell at compilation time if no cell exists for the
198 void PropertyHandlerCompiler::GenerateCheckPropertyCell(
199 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
200 Register scratch, Label* miss) {
201 Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
202 DCHECK(cell->value()->IsTheHole());
203 Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value();
204 if (masm->serializer_enabled()) {
205 __ mov(scratch, Immediate(cell));
206 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset),
207 Immediate(the_hole));
209 __ cmp(Operand::ForCell(cell), Immediate(the_hole));
211 __ j(not_equal, miss);
215 void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
216 MacroAssembler* masm, Handle<HeapType> type, Register receiver,
217 Handle<JSFunction> setter) {
218 // ----------- S t a t e -------------
219 // -- esp[0] : return address
220 // -----------------------------------
222 FrameScope scope(masm, StackFrame::INTERNAL);
224 // Save value register, so we can restore it later.
227 if (!setter.is_null()) {
228 // Call the JavaScript setter with receiver and value on the stack.
229 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
230 // Swap in the global receiver.
232 FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
236 ParameterCount actual(1);
237 ParameterCount expected(setter);
238 __ InvokeFunction(setter, expected, actual, CALL_FUNCTION,
241 // If we generate a global code snippet for deoptimization only, remember
242 // the place to continue after deoptimization.
243 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
246 // We have to return the passed value, not the return value of the setter.
249 // Restore context register.
250 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
256 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver,
257 Register holder, Register name,
258 Handle<JSObject> holder_obj) {
259 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
260 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
261 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
262 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
263 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
265 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
266 DCHECK(!masm->isolate()->heap()->InNewSpace(*interceptor));
267 Register scratch = name;
268 __ mov(scratch, Immediate(interceptor));
275 static void CompileCallLoadPropertyWithInterceptor(
276 MacroAssembler* masm, Register receiver, Register holder, Register name,
277 Handle<JSObject> holder_obj, IC::UtilityId id) {
278 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
279 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
280 NamedLoadHandlerCompiler::kInterceptorArgsLength);
284 static void StoreIC_PushArgs(MacroAssembler* masm) {
285 Register receiver = StoreDescriptor::ReceiverRegister();
286 Register name = StoreDescriptor::NameRegister();
287 Register value = StoreDescriptor::ValueRegister();
289 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value));
299 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
300 // Return address is on the stack.
301 StoreIC_PushArgs(masm);
303 // Do tail-call to runtime routine.
304 ExternalReference ref(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
305 __ TailCallExternalReference(ref, 3, 1);
309 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
310 // Return address is on the stack.
311 StoreIC_PushArgs(masm);
313 // Do tail-call to runtime routine.
314 ExternalReference ref(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
315 __ TailCallExternalReference(ref, 3, 1);
320 #define __ ACCESS_MASM(masm())
323 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
325 if (!label->is_unused()) {
327 __ mov(this->name(), Immediate(name));
332 void NamedStoreHandlerCompiler::GenerateRestoreNameAndMap(
333 Handle<Name> name, Handle<Map> transition) {
334 __ mov(this->name(), Immediate(name));
335 __ mov(StoreTransitionDescriptor::MapRegister(), Immediate(transition));
339 void NamedStoreHandlerCompiler::GenerateConstantCheck(Object* constant,
342 __ CmpObject(value_reg, handle(constant, isolate()));
343 __ j(not_equal, miss_label);
347 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type,
350 __ JumpIfSmi(value_reg, miss_label);
351 HeapType::Iterator<Map> it = field_type->Classes();
355 __ CompareMap(value_reg, it.Current());
358 __ j(not_equal, miss_label);
361 __ j(equal, &do_store, Label::kNear);
368 Register PropertyHandlerCompiler::CheckPrototypes(
369 Register object_reg, Register holder_reg, Register scratch1,
370 Register scratch2, Handle<Name> name, Label* miss,
371 PrototypeCheckType check) {
372 Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));
374 // Make sure there's no overlap between holder and object registers.
375 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
376 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) &&
377 !scratch2.is(scratch1));
379 // Keep track of the current object in register reg.
380 Register reg = object_reg;
383 Handle<JSObject> current = Handle<JSObject>::null();
384 if (type()->IsConstant())
385 current = Handle<JSObject>::cast(type()->AsConstant()->Value());
386 Handle<JSObject> prototype = Handle<JSObject>::null();
387 Handle<Map> current_map = receiver_map;
388 Handle<Map> holder_map(holder()->map());
389 // Traverse the prototype chain and check the maps in the prototype chain for
390 // fast and global objects or do negative lookup for normal objects.
391 while (!current_map.is_identical_to(holder_map)) {
394 // Only global objects and objects that do not require access
395 // checks are allowed in stubs.
396 DCHECK(current_map->IsJSGlobalProxyMap() ||
397 !current_map->is_access_check_needed());
399 prototype = handle(JSObject::cast(current_map->prototype()));
400 if (current_map->is_dictionary_map() &&
401 !current_map->IsJSGlobalObjectMap()) {
402 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
403 if (!name->IsUniqueName()) {
404 DCHECK(name->IsString());
405 name = factory()->InternalizeString(Handle<String>::cast(name));
407 DCHECK(current.is_null() ||
408 current->property_dictionary()->FindEntry(name) ==
409 NameDictionary::kNotFound);
411 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1,
414 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
415 reg = holder_reg; // From now on the object will be in holder_reg.
416 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
418 bool in_new_space = heap()->InNewSpace(*prototype);
419 // Two possible reasons for loading the prototype from the map:
420 // (1) Can't store references to new space in code.
421 // (2) Handler is shared for all receivers with the same prototype
422 // map (but not necessarily the same prototype instance).
423 bool load_prototype_from_map = in_new_space || depth == 1;
424 if (depth != 1 || check == CHECK_ALL_MAPS) {
425 __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
428 // Check access rights to the global object. This has to happen after
429 // the map check so that we know that the object is actually a global
431 // This allows us to install generated handlers for accesses to the
432 // global proxy (as opposed to using slow ICs). See corresponding code
433 // in LookupForRead().
434 if (current_map->IsJSGlobalProxyMap()) {
435 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss);
436 } else if (current_map->IsJSGlobalObjectMap()) {
437 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
438 name, scratch2, miss);
441 if (load_prototype_from_map) {
442 // Save the map in scratch1 for later.
443 __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
446 reg = holder_reg; // From now on the object will be in holder_reg.
448 if (load_prototype_from_map) {
449 __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
451 __ mov(reg, prototype);
455 // Go to the next object in the prototype chain.
457 current_map = handle(current->map());
460 // Log the check depth.
461 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
463 if (depth != 0 || check == CHECK_ALL_MAPS) {
464 // Check the holder map.
465 __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
468 // Perform security check for access to the global object.
469 DCHECK(current_map->IsJSGlobalProxyMap() ||
470 !current_map->is_access_check_needed());
471 if (current_map->IsJSGlobalProxyMap()) {
472 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss);
475 // Return the register containing the holder.
480 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
481 if (!miss->is_unused()) {
485 TailCallBuiltin(masm(), MissBuiltin(kind()));
491 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
492 if (!miss->is_unused()) {
495 GenerateRestoreName(miss, name);
496 TailCallBuiltin(masm(), MissBuiltin(kind()));
502 void NamedLoadHandlerCompiler::GenerateLoadCallback(
503 Register reg, Handle<ExecutableAccessorInfo> callback) {
504 // Insert additional parameters into the stack frame above return address.
505 DCHECK(!scratch3().is(reg));
506 __ pop(scratch3()); // Get return address to place it below.
508 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
509 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1);
510 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2);
511 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3);
512 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
513 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
514 __ push(receiver()); // receiver
515 // Push data from ExecutableAccessorInfo.
516 if (isolate()->heap()->InNewSpace(callback->data())) {
517 DCHECK(!scratch2().is(reg));
518 __ mov(scratch2(), Immediate(callback));
519 __ push(FieldOperand(scratch2(), ExecutableAccessorInfo::kDataOffset));
521 __ push(Immediate(Handle<Object>(callback->data(), isolate())));
523 __ push(Immediate(isolate()->factory()->undefined_value())); // ReturnValue
524 // ReturnValue default value
525 __ push(Immediate(isolate()->factory()->undefined_value()));
526 __ push(Immediate(reinterpret_cast<int>(isolate())));
527 __ push(reg); // holder
529 // Save a pointer to where we pushed the arguments. This will be
530 // passed as the const PropertyAccessorInfo& to the C++ callback.
533 __ push(name()); // name
535 __ push(scratch3()); // Restore return address.
537 // Abi for CallApiGetter
538 Register getter_address = ApiGetterDescriptor::function_address();
539 Address function_address = v8::ToCData<Address>(callback->getter());
540 __ mov(getter_address, Immediate(function_address));
542 CallApiGetterStub stub(isolate());
543 __ TailCallStub(&stub);
547 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
548 // Return the constant value.
549 __ LoadObject(eax, value);
554 void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup(
555 LookupIterator* it, Register holder_reg) {
556 DCHECK(holder()->HasNamedInterceptor());
557 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
559 // Compile the interceptor call, followed by inline code to load the
560 // property from further up the prototype chain if the call fails.
561 // Check that the maps haven't changed.
562 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1()));
564 // Preserve the receiver register explicitly whenever it is different from the
565 // holder and it is needed should the interceptor return without any result.
566 // The ACCESSOR case needs the receiver to be passed into C++ code, the FIELD
567 // case might cause a miss during the prototype check.
568 bool must_perform_prototype_check =
569 !holder().is_identical_to(it->GetHolder<JSObject>());
570 bool must_preserve_receiver_reg =
571 !receiver().is(holder_reg) &&
572 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check);
574 // Save necessary data before invoking an interceptor.
575 // Requires a frame to make GC aware of pushed pointers.
577 FrameScope frame_scope(masm(), StackFrame::INTERNAL);
579 if (must_preserve_receiver_reg) {
583 __ push(this->name());
585 // Invoke an interceptor. Note: map checks from receiver to
586 // interceptor's holder has been compiled before (see a caller
588 CompileCallLoadPropertyWithInterceptor(
589 masm(), receiver(), holder_reg, this->name(), holder(),
590 IC::kLoadPropertyWithInterceptorOnly);
592 // Check if interceptor provided a value for property. If it's
593 // the case, return immediately.
594 Label interceptor_failed;
595 __ cmp(eax, factory()->no_interceptor_result_sentinel());
596 __ j(equal, &interceptor_failed);
597 frame_scope.GenerateLeaveFrame();
600 // Clobber registers when generating debug-code to provoke errors.
601 __ bind(&interceptor_failed);
602 if (FLAG_debug_code) {
603 __ mov(receiver(), Immediate(bit_cast<int32_t>(kZapValue)));
604 __ mov(holder_reg, Immediate(bit_cast<int32_t>(kZapValue)));
605 __ mov(this->name(), Immediate(bit_cast<int32_t>(kZapValue)));
608 __ pop(this->name());
610 if (must_preserve_receiver_reg) {
614 // Leave the internal frame.
617 GenerateLoadPostInterceptor(it, holder_reg);
621 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
622 DCHECK(holder()->HasNamedInterceptor());
623 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
624 // Call the runtime system to load the interceptor.
625 __ pop(scratch2()); // save old return address
626 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
628 __ push(scratch2()); // restore old return address
630 ExternalReference ref = ExternalReference(
631 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
632 __ TailCallExternalReference(
633 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
637 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
638 Handle<JSObject> object, Handle<Name> name,
639 Handle<ExecutableAccessorInfo> callback) {
640 Register holder_reg = Frontend(receiver(), name);
642 __ pop(scratch1()); // remove the return address
648 __ push(scratch1()); // restore return address
650 // Do tail-call to the runtime system.
651 ExternalReference store_callback_property =
652 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
653 __ TailCallExternalReference(store_callback_property, 5, 1);
655 // Return the generated code.
656 return GetCode(kind(), Code::FAST, name);
660 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
662 __ pop(scratch1()); // remove the return address
664 __ push(this->name());
666 __ push(scratch1()); // restore return address
668 // Do tail-call to the runtime system.
669 ExternalReference store_ic_property = ExternalReference(
670 IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
671 __ TailCallExternalReference(store_ic_property, 3, 1);
673 // Return the generated code.
674 return GetCode(kind(), Code::FAST, name);
678 Register NamedStoreHandlerCompiler::value() {
679 return StoreDescriptor::ValueRegister();
683 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
684 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
687 FrontendHeader(receiver(), name, &miss);
688 // Get the value from the cell.
689 Register result = StoreDescriptor::ValueRegister();
690 if (masm()->serializer_enabled()) {
691 __ mov(result, Immediate(cell));
692 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
694 __ mov(result, Operand::ForCell(cell));
697 // Check for deleted property if property can actually be deleted.
698 if (is_configurable) {
699 __ cmp(result, factory()->the_hole_value());
701 } else if (FLAG_debug_code) {
702 __ cmp(result, factory()->the_hole_value());
703 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
706 Counters* counters = isolate()->counters();
707 __ IncrementCounter(counters->named_load_global_stub(), 1);
708 // The code above already loads the result into the return register.
711 FrontendFooter(name, &miss);
713 // Return the generated code.
714 return GetCode(kind(), Code::NORMAL, name);
720 } // namespace v8::internal
722 #endif // V8_TARGET_ARCH_X87