1 // Copyright 2014 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) {
22 // ----------- S t a t e -------------
25 // -- lr : return address
26 // -----------------------------------
28 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
30 if (!getter.is_null()) {
31 // Call the JavaScript getter with the receiver on the stack.
32 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
33 // Swap in the global receiver.
35 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
38 ParameterCount actual(0);
39 ParameterCount expected(getter);
40 __ InvokeFunction(getter, expected, actual, CALL_FUNCTION,
43 // If we generate a global code snippet for deoptimization only, remember
44 // the place to continue after deoptimization.
45 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
48 // Restore context register.
49 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
55 void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
56 MacroAssembler* masm, Handle<HeapType> type, Register receiver,
57 Handle<JSFunction> setter) {
58 // ----------- S t a t e -------------
59 // -- lr : return address
60 // -----------------------------------
62 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
64 // Save value register, so we can restore it later.
67 if (!setter.is_null()) {
68 // Call the JavaScript setter with receiver and value on the stack.
69 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
70 // Swap in the global receiver.
72 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
74 __ Push(receiver, value());
75 ParameterCount actual(1);
76 ParameterCount expected(setter);
77 __ InvokeFunction(setter, expected, actual, CALL_FUNCTION,
80 // If we generate a global code snippet for deoptimization only, remember
81 // the place to continue after deoptimization.
82 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
85 // We have to return the passed value, not the return value of the setter.
88 // Restore context register.
89 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
95 void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
96 MacroAssembler* masm, Label* miss_label, Register receiver,
97 Handle<Name> name, Register scratch0, Register scratch1) {
98 DCHECK(name->IsUniqueName());
99 DCHECK(!receiver.is(scratch0));
100 Counters* counters = masm->isolate()->counters();
101 __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
102 __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
106 const int kInterceptorOrAccessCheckNeededMask =
107 (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
109 // Bail out if the receiver has a named interceptor or requires access checks.
110 Register map = scratch1;
111 __ ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
112 __ ldrb(scratch0, FieldMemOperand(map, Map::kBitFieldOffset));
113 __ tst(scratch0, Operand(kInterceptorOrAccessCheckNeededMask));
114 __ b(ne, miss_label);
116 // Check that receiver is a JSObject.
117 __ ldrb(scratch0, FieldMemOperand(map, Map::kInstanceTypeOffset));
118 __ cmp(scratch0, Operand(FIRST_SPEC_OBJECT_TYPE));
119 __ b(lt, miss_label);
121 // Load properties array.
122 Register properties = scratch0;
123 __ ldr(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
124 // Check that the properties array is a dictionary.
125 __ ldr(map, FieldMemOperand(properties, HeapObject::kMapOffset));
126 Register tmp = properties;
127 __ LoadRoot(tmp, Heap::kHashTableMapRootIndex);
129 __ b(ne, miss_label);
131 // Restore the temporarily used register.
132 __ ldr(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
135 NameDictionaryLookupStub::GenerateNegativeLookup(
136 masm, miss_label, &done, receiver, properties, name, scratch1);
138 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
142 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype(
143 MacroAssembler* masm, int index, Register prototype, Label* miss) {
144 Isolate* isolate = masm->isolate();
145 // Get the global function with the given index.
146 Handle<JSFunction> function(
147 JSFunction::cast(isolate->native_context()->get(index)));
149 // Check we're still in the same context.
150 Register scratch = prototype;
151 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
152 __ ldr(scratch, MemOperand(cp, offset));
153 __ ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset));
154 __ ldr(scratch, MemOperand(scratch, Context::SlotOffset(index)));
155 __ Move(ip, function);
159 // Load its initial map. The global functions all have initial maps.
160 __ Move(prototype, Handle<Map>(function->initial_map()));
161 // Load the prototype from the initial map.
162 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset));
166 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(
167 MacroAssembler* masm, Register receiver, Register scratch1,
168 Register scratch2, Label* miss_label) {
169 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label);
170 __ mov(r0, scratch1);
175 // Generate code to check that a global property cell is empty. Create
176 // the property cell at compilation time if no cell exists for the
178 void PropertyHandlerCompiler::GenerateCheckPropertyCell(
179 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
180 Register scratch, Label* miss) {
181 Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
182 DCHECK(cell->value()->IsTheHole());
183 __ mov(scratch, Operand(cell));
184 __ ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
185 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
191 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver,
192 Register holder, Register name,
193 Handle<JSObject> holder_obj) {
194 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0);
195 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1);
196 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2);
197 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3);
198 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
200 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
201 DCHECK(!masm->isolate()->heap()->InNewSpace(*interceptor));
202 Register scratch = name;
203 __ mov(scratch, Operand(interceptor));
210 static void CompileCallLoadPropertyWithInterceptor(
211 MacroAssembler* masm, Register receiver, Register holder, Register name,
212 Handle<JSObject> holder_obj, IC::UtilityId id) {
213 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
214 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
215 NamedLoadHandlerCompiler::kInterceptorArgsLength);
219 // Generate call to api function.
220 void PropertyHandlerCompiler::GenerateFastApiCall(
221 MacroAssembler* masm, const CallOptimization& optimization,
222 Handle<Map> receiver_map, Register receiver, Register scratch_in,
223 bool is_store, int argc, Register* values) {
224 DCHECK(!receiver.is(scratch_in));
226 // Write the arguments to stack frame.
227 for (int i = 0; i < argc; i++) {
228 Register arg = values[argc - 1 - i];
229 DCHECK(!receiver.is(arg));
230 DCHECK(!scratch_in.is(arg));
233 DCHECK(optimization.is_simple_api_call());
235 // Abi for CallApiFunctionStub.
236 Register callee = r0;
237 Register call_data = r4;
238 Register holder = r2;
239 Register api_function_address = r1;
241 // Put holder in place.
242 CallOptimization::HolderLookup holder_lookup;
243 Handle<JSObject> api_holder =
244 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup);
245 switch (holder_lookup) {
246 case CallOptimization::kHolderIsReceiver:
247 __ Move(holder, receiver);
249 case CallOptimization::kHolderFound:
250 __ Move(holder, api_holder);
252 case CallOptimization::kHolderNotFound:
257 Isolate* isolate = masm->isolate();
258 Handle<JSFunction> function = optimization.constant_function();
259 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
260 Handle<Object> call_data_obj(api_call_info->data(), isolate);
262 // Put callee in place.
263 __ Move(callee, function);
265 bool call_data_undefined = false;
266 // Put call_data in place.
267 if (isolate->heap()->InNewSpace(*call_data_obj)) {
268 __ Move(call_data, api_call_info);
269 __ ldr(call_data, FieldMemOperand(call_data, CallHandlerInfo::kDataOffset));
270 } else if (call_data_obj->IsUndefined()) {
271 call_data_undefined = true;
272 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex);
274 __ Move(call_data, call_data_obj);
277 // Put api_function_address in place.
278 Address function_address = v8::ToCData<Address>(api_call_info->callback());
279 ApiFunction fun(function_address);
280 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
281 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
282 __ mov(api_function_address, Operand(ref));
285 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc);
286 __ TailCallStub(&stub);
290 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
291 // Push receiver, key and value for runtime call.
292 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
293 StoreDescriptor::ValueRegister());
295 // The slow case calls into the runtime to complete the store without causing
296 // an IC miss that would otherwise cause a transition to the generic stub.
297 ExternalReference ref =
298 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
299 __ TailCallExternalReference(ref, 3, 1);
303 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
304 // Push receiver, key and value for runtime call.
305 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
306 StoreDescriptor::ValueRegister());
308 // The slow case calls into the runtime to complete the store without causing
309 // an IC miss that would otherwise cause a transition to the generic stub.
310 ExternalReference ref =
311 ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
312 __ TailCallExternalReference(ref, 3, 1);
317 #define __ ACCESS_MASM(masm())
320 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
322 if (!label->is_unused()) {
324 __ mov(this->name(), Operand(name));
329 void NamedStoreHandlerCompiler::GenerateRestoreNameAndMap(
330 Handle<Name> name, Handle<Map> transition) {
331 __ mov(this->name(), Operand(name));
332 __ mov(StoreTransitionDescriptor::MapRegister(), Operand(transition));
336 void NamedStoreHandlerCompiler::GenerateConstantCheck(Object* constant,
339 __ Move(scratch1(), handle(constant, isolate()));
340 __ cmp(value_reg, scratch1());
341 __ b(ne, miss_label);
345 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type,
348 __ JumpIfSmi(value_reg, miss_label);
349 HeapType::Iterator<Map> it = field_type->Classes();
351 __ ldr(scratch1(), FieldMemOperand(value_reg, HeapObject::kMapOffset));
354 __ CompareMap(scratch1(), it.Current(), &do_store);
357 __ b(ne, miss_label);
367 Register PropertyHandlerCompiler::CheckPrototypes(
368 Register object_reg, Register holder_reg, Register scratch1,
369 Register scratch2, Handle<Name> name, Label* miss,
370 PrototypeCheckType check) {
371 Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));
373 // Make sure there's no overlap between holder and object registers.
374 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
375 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) &&
376 !scratch2.is(scratch1));
378 // Keep track of the current object in register reg.
379 Register reg = object_reg;
382 Handle<JSObject> current = Handle<JSObject>::null();
383 if (type()->IsConstant()) {
384 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 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
415 reg = holder_reg; // From now on the object will be in holder_reg.
416 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
418 Register map_reg = scratch1;
419 if (depth != 1 || check == CHECK_ALL_MAPS) {
420 // CheckMap implicitly loads the map of |reg| into |map_reg|.
421 __ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
423 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
426 // Check access rights to the global object. This has to happen after
427 // the map check so that we know that the object is actually a global
429 // This allows us to install generated handlers for accesses to the
430 // global proxy (as opposed to using slow ICs). See corresponding code
431 // in LookupForRead().
432 if (current_map->IsJSGlobalProxyMap()) {
433 __ CheckAccessGlobalProxy(reg, scratch2, miss);
434 } else if (current_map->IsJSGlobalObjectMap()) {
435 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
436 name, scratch2, miss);
439 reg = holder_reg; // From now on the object will be in holder_reg.
441 // Two possible reasons for loading the prototype from the map:
442 // (1) Can't store references to new space in code.
443 // (2) Handler is shared for all receivers with the same prototype
444 // map (but not necessarily the same prototype instance).
445 bool load_prototype_from_map =
446 heap()->InNewSpace(*prototype) || depth == 1;
447 if (load_prototype_from_map) {
448 __ ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
450 __ mov(reg, Operand(prototype));
454 // Go to the next object in the prototype chain.
456 current_map = handle(current->map());
459 // Log the check depth.
460 LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
462 if (depth != 0 || check == CHECK_ALL_MAPS) {
463 // Check the holder map.
464 __ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK);
467 // Perform security check for access to the global object.
468 DCHECK(current_map->IsJSGlobalProxyMap() ||
469 !current_map->is_access_check_needed());
470 if (current_map->IsJSGlobalProxyMap()) {
471 __ CheckAccessGlobalProxy(reg, scratch1, miss);
474 // Return the register containing the holder.
479 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
480 if (!miss->is_unused()) {
484 TailCallBuiltin(masm(), MissBuiltin(kind()));
490 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) {
491 if (!miss->is_unused()) {
494 GenerateRestoreName(miss, name);
495 TailCallBuiltin(masm(), MissBuiltin(kind()));
501 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) {
502 // Return the constant value.
508 void NamedLoadHandlerCompiler::GenerateLoadCallback(
509 Register reg, Handle<ExecutableAccessorInfo> callback) {
510 // Build AccessorInfo::args_ list on the stack and push property name below
511 // the exit frame to make GC aware of them and store pointers to them.
512 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
513 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1);
514 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2);
515 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3);
516 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
517 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
518 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6);
519 DCHECK(!scratch2().is(reg));
520 DCHECK(!scratch3().is(reg));
521 DCHECK(!scratch4().is(reg));
523 if (heap()->InNewSpace(callback->data())) {
524 __ Move(scratch3(), callback);
526 FieldMemOperand(scratch3(), ExecutableAccessorInfo::kDataOffset));
528 __ Move(scratch3(), Handle<Object>(callback->data(), isolate()));
531 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex);
532 __ mov(scratch4(), scratch3());
533 __ Push(scratch3(), scratch4());
534 __ mov(scratch4(), Operand(ExternalReference::isolate_address(isolate())));
535 __ Push(scratch4(), reg);
536 __ mov(scratch2(), sp); // scratch2 = PropertyAccessorInfo::args_
539 // Abi for CallApiGetter
540 Register getter_address_reg = ApiGetterDescriptor::function_address();
542 Address getter_address = v8::ToCData<Address>(callback->getter());
543 ApiFunction fun(getter_address);
544 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL;
545 ExternalReference ref = ExternalReference(&fun, type, isolate());
546 __ mov(getter_address_reg, Operand(ref));
548 CallApiGetterStub stub(isolate());
549 __ TailCallStub(&stub);
553 void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup(
554 LookupIterator* it, Register holder_reg) {
555 DCHECK(holder()->HasNamedInterceptor());
556 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
558 // Compile the interceptor call, followed by inline code to load the
559 // property from further up the prototype chain if the call fails.
560 // Check that the maps haven't changed.
561 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1()));
563 // Preserve the receiver register explicitly whenever it is different from the
564 // holder and it is needed should the interceptor return without any result.
565 // The ACCESSOR case needs the receiver to be passed into C++ code, the FIELD
566 // case might cause a miss during the prototype check.
567 bool must_perform_prototype_check =
568 !holder().is_identical_to(it->GetHolder<JSObject>());
569 bool must_preserve_receiver_reg =
570 !receiver().is(holder_reg) &&
571 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check);
573 // Save necessary data before invoking an interceptor.
574 // Requires a frame to make GC aware of pushed pointers.
576 FrameAndConstantPoolScope frame_scope(masm(), StackFrame::INTERNAL);
577 if (must_preserve_receiver_reg) {
578 __ Push(receiver(), holder_reg, this->name());
580 __ Push(holder_reg, this->name());
582 // Invoke an interceptor. Note: map checks from receiver to
583 // interceptor's holder has been compiled before (see a caller
585 CompileCallLoadPropertyWithInterceptor(
586 masm(), receiver(), holder_reg, this->name(), holder(),
587 IC::kLoadPropertyWithInterceptorOnly);
589 // Check if interceptor provided a value for property. If it's
590 // the case, return immediately.
591 Label interceptor_failed;
592 __ LoadRoot(scratch1(), Heap::kNoInterceptorResultSentinelRootIndex);
593 __ cmp(r0, scratch1());
594 __ b(eq, &interceptor_failed);
595 frame_scope.GenerateLeaveFrame();
598 __ bind(&interceptor_failed);
599 __ pop(this->name());
601 if (must_preserve_receiver_reg) {
604 // Leave the internal frame.
607 GenerateLoadPostInterceptor(it, holder_reg);
611 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) {
612 // Call the runtime system to load the interceptor.
613 DCHECK(holder()->HasNamedInterceptor());
614 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
615 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(),
618 ExternalReference ref = ExternalReference(
619 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
620 __ TailCallExternalReference(
621 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
625 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
626 Handle<JSObject> object, Handle<Name> name,
627 Handle<ExecutableAccessorInfo> callback) {
628 Register holder_reg = Frontend(receiver(), name);
630 __ push(receiver()); // receiver
632 __ mov(ip, Operand(callback)); // callback info
634 __ mov(ip, Operand(name));
635 __ Push(ip, value());
637 // Do tail-call to the runtime system.
638 ExternalReference store_callback_property =
639 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
640 __ TailCallExternalReference(store_callback_property, 5, 1);
642 // Return the generated code.
643 return GetCode(kind(), Code::FAST, name);
647 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor(
649 __ Push(receiver(), this->name(), value());
651 // Do tail-call to the runtime system.
652 ExternalReference store_ic_property = ExternalReference(
653 IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
654 __ TailCallExternalReference(store_ic_property, 3, 1);
656 // Return the generated code.
657 return GetCode(kind(), Code::FAST, name);
661 Register NamedStoreHandlerCompiler::value() {
662 return StoreDescriptor::ValueRegister();
666 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
667 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
669 FrontendHeader(receiver(), name, &miss);
671 // Get the value from the cell.
672 Register result = StoreDescriptor::ValueRegister();
673 __ mov(result, Operand(cell));
674 __ ldr(result, FieldMemOperand(result, Cell::kValueOffset));
676 // Check for deleted property if property can actually be deleted.
677 if (is_configurable) {
678 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
683 Counters* counters = isolate()->counters();
684 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3);
687 FrontendFooter(name, &miss);
689 // Return the generated code.
690 return GetCode(kind(), Code::NORMAL, name);
696 } // namespace v8::internal
698 #endif // V8_TARGET_ARCH_ARM