| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 // If we've skipped any global objects, it's not enough to verify that | 1291 // If we've skipped any global objects, it's not enough to verify that |
| 1292 // their maps haven't changed. We also need to check that the property | 1292 // their maps haven't changed. We also need to check that the property |
| 1293 // cell for the property is still empty. | 1293 // cell for the property is still empty. |
| 1294 GenerateCheckPropertyCells(masm(), object, holder, name, scratch1, miss); | 1294 GenerateCheckPropertyCells(masm(), object, holder, name, scratch1, miss); |
| 1295 | 1295 |
| 1296 // Return the register containing the holder. | 1296 // Return the register containing the holder. |
| 1297 return reg; | 1297 return reg; |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 | 1300 |
| 1301 void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, | 1301 void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { |
| 1302 Label* success, | |
| 1303 Label* miss) { | |
| 1304 if (!miss->is_unused()) { | 1302 if (!miss->is_unused()) { |
| 1305 __ b(success); | 1303 Label success; |
| 1304 __ b(&success); |
| 1306 __ bind(miss); | 1305 __ bind(miss); |
| 1307 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1306 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 1307 __ bind(&success); |
| 1308 } | 1308 } |
| 1309 } | 1309 } |
| 1310 | 1310 |
| 1311 | 1311 |
| 1312 void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, | 1312 void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { |
| 1313 Label* success, | |
| 1314 Label* miss) { | |
| 1315 if (!miss->is_unused()) { | 1313 if (!miss->is_unused()) { |
| 1316 __ b(success); | 1314 Label success; |
| 1315 __ b(&success); |
| 1317 GenerateRestoreName(masm(), miss, name); | 1316 GenerateRestoreName(masm(), miss, name); |
| 1318 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1317 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 1318 __ bind(&success); |
| 1319 } | 1319 } |
| 1320 } | 1320 } |
| 1321 | 1321 |
| 1322 | 1322 |
| 1323 Register LoadStubCompiler::CallbackHandlerFrontend( | 1323 Register LoadStubCompiler::CallbackHandlerFrontend( |
| 1324 Handle<JSObject> object, | 1324 Handle<Object> object, |
| 1325 Register object_reg, | 1325 Register object_reg, |
| 1326 Handle<JSObject> holder, | 1326 Handle<JSObject> holder, |
| 1327 Handle<Name> name, | 1327 Handle<Name> name, |
| 1328 Label* success, | |
| 1329 Handle<Object> callback) { | 1328 Handle<Object> callback) { |
| 1330 Label miss; | 1329 Label miss; |
| 1331 | 1330 |
| 1332 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1331 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); |
| 1333 | 1332 |
| 1334 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1333 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
| 1335 ASSERT(!reg.is(scratch2())); | 1334 ASSERT(!reg.is(scratch2())); |
| 1336 ASSERT(!reg.is(scratch3())); | 1335 ASSERT(!reg.is(scratch3())); |
| 1337 ASSERT(!reg.is(scratch4())); | 1336 ASSERT(!reg.is(scratch4())); |
| 1338 | 1337 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1355 // pointer into the dictionary. Check that the value is the callback. | 1354 // pointer into the dictionary. Check that the value is the callback. |
| 1356 Register pointer = scratch3(); | 1355 Register pointer = scratch3(); |
| 1357 const int kElementsStartOffset = NameDictionary::kHeaderSize + | 1356 const int kElementsStartOffset = NameDictionary::kHeaderSize + |
| 1358 NameDictionary::kElementsStartIndex * kPointerSize; | 1357 NameDictionary::kElementsStartIndex * kPointerSize; |
| 1359 const int kValueOffset = kElementsStartOffset + kPointerSize; | 1358 const int kValueOffset = kElementsStartOffset + kPointerSize; |
| 1360 __ ldr(scratch2(), FieldMemOperand(pointer, kValueOffset)); | 1359 __ ldr(scratch2(), FieldMemOperand(pointer, kValueOffset)); |
| 1361 __ cmp(scratch2(), Operand(callback)); | 1360 __ cmp(scratch2(), Operand(callback)); |
| 1362 __ b(ne, &miss); | 1361 __ b(ne, &miss); |
| 1363 } | 1362 } |
| 1364 | 1363 |
| 1365 HandlerFrontendFooter(name, success, &miss); | 1364 HandlerFrontendFooter(name, &miss); |
| 1366 return reg; | 1365 return reg; |
| 1367 } | 1366 } |
| 1368 | 1367 |
| 1369 | 1368 |
| 1370 void LoadStubCompiler::GenerateLoadField(Register reg, | 1369 void LoadStubCompiler::GenerateLoadField(Register reg, |
| 1371 Handle<JSObject> holder, | 1370 Handle<JSObject> holder, |
| 1372 PropertyIndex field, | 1371 PropertyIndex field, |
| 1373 Representation representation) { | 1372 Representation representation) { |
| 1374 if (!reg.is(receiver())) __ mov(receiver(), reg); | 1373 if (!reg.is(receiver())) __ mov(receiver(), reg); |
| 1375 if (kind() == Code::LOAD_IC) { | 1374 if (kind() == Code::LOAD_IC) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 thunk_ref, | 1460 thunk_ref, |
| 1462 r2, | 1461 r2, |
| 1463 kStackUnwindSpace, | 1462 kStackUnwindSpace, |
| 1464 MemOperand(fp, 6 * kPointerSize), | 1463 MemOperand(fp, 6 * kPointerSize), |
| 1465 NULL); | 1464 NULL); |
| 1466 } | 1465 } |
| 1467 | 1466 |
| 1468 | 1467 |
| 1469 void LoadStubCompiler::GenerateLoadInterceptor( | 1468 void LoadStubCompiler::GenerateLoadInterceptor( |
| 1470 Register holder_reg, | 1469 Register holder_reg, |
| 1471 Handle<JSObject> object, | 1470 Handle<Object> object, |
| 1472 Handle<JSObject> interceptor_holder, | 1471 Handle<JSObject> interceptor_holder, |
| 1473 LookupResult* lookup, | 1472 LookupResult* lookup, |
| 1474 Handle<Name> name) { | 1473 Handle<Name> name) { |
| 1475 ASSERT(interceptor_holder->HasNamedInterceptor()); | 1474 ASSERT(interceptor_holder->HasNamedInterceptor()); |
| 1476 ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); | 1475 ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); |
| 1477 | 1476 |
| 1478 // So far the most popular follow ups for interceptor loads are FIELD | 1477 // So far the most popular follow ups for interceptor loads are FIELD |
| 1479 // and CALLBACKS, so inline only them, other cases may be added | 1478 // and CALLBACKS, so inline only them, other cases may be added |
| 1480 // later. | 1479 // later. |
| 1481 bool compile_followup_inline = false; | 1480 bool compile_followup_inline = false; |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 FreeSpaceForFastApiCall(masm()); | 2531 FreeSpaceForFastApiCall(masm()); |
| 2533 | 2532 |
| 2534 __ bind(&miss_before_stack_reserved); | 2533 __ bind(&miss_before_stack_reserved); |
| 2535 GenerateMissBranch(); | 2534 GenerateMissBranch(); |
| 2536 | 2535 |
| 2537 // Return the generated code. | 2536 // Return the generated code. |
| 2538 return GetCode(function); | 2537 return GetCode(function); |
| 2539 } | 2538 } |
| 2540 | 2539 |
| 2541 | 2540 |
| 2541 void StubCompiler::GenerateBooleanCheck(Register object, Label* miss) { |
| 2542 Label success; |
| 2543 // Check that the object is a boolean. |
| 2544 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 2545 __ cmp(object, ip); |
| 2546 __ b(eq, &success); |
| 2547 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
| 2548 __ cmp(object, ip); |
| 2549 __ b(ne, miss); |
| 2550 __ bind(&success); |
| 2551 } |
| 2552 |
| 2553 |
| 2542 void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, | 2554 void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, |
| 2543 Handle<JSObject> holder, | 2555 Handle<JSObject> holder, |
| 2544 Handle<Name> name, | 2556 Handle<Name> name, |
| 2545 CheckType check, | 2557 CheckType check) { |
| 2546 Label* success) { | |
| 2547 // ----------- S t a t e ------------- | 2558 // ----------- S t a t e ------------- |
| 2548 // -- r2 : name | 2559 // -- r2 : name |
| 2549 // -- lr : return address | 2560 // -- lr : return address |
| 2550 // ----------------------------------- | 2561 // ----------------------------------- |
| 2551 Label miss; | 2562 Label miss; |
| 2552 GenerateNameCheck(name, &miss); | 2563 GenerateNameCheck(name, &miss); |
| 2553 | 2564 |
| 2554 // Get the receiver from the stack | 2565 // Get the receiver from the stack |
| 2555 const int argc = arguments().immediate(); | 2566 const int argc = arguments().immediate(); |
| 2556 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 2567 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 __ bind(&fast); | 2623 __ bind(&fast); |
| 2613 // Check that the maps starting from the prototype haven't changed. | 2624 // Check that the maps starting from the prototype haven't changed. |
| 2614 GenerateDirectLoadGlobalFunctionPrototype( | 2625 GenerateDirectLoadGlobalFunctionPrototype( |
| 2615 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); | 2626 masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); |
| 2616 CheckPrototypes( | 2627 CheckPrototypes( |
| 2617 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), | 2628 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2618 r0, holder, r3, r1, r4, name, &miss); | 2629 r0, holder, r3, r1, r4, name, &miss); |
| 2619 break; | 2630 break; |
| 2620 } | 2631 } |
| 2621 case BOOLEAN_CHECK: { | 2632 case BOOLEAN_CHECK: { |
| 2622 Label fast; | 2633 GenerateBooleanCheck(r1, &miss); |
| 2623 // Check that the object is a boolean. | 2634 |
| 2624 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | |
| 2625 __ cmp(r1, ip); | |
| 2626 __ b(eq, &fast); | |
| 2627 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | |
| 2628 __ cmp(r1, ip); | |
| 2629 __ b(ne, &miss); | |
| 2630 __ bind(&fast); | |
| 2631 // Check that the maps starting from the prototype haven't changed. | 2635 // Check that the maps starting from the prototype haven't changed. |
| 2632 GenerateDirectLoadGlobalFunctionPrototype( | 2636 GenerateDirectLoadGlobalFunctionPrototype( |
| 2633 masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss); | 2637 masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss); |
| 2634 CheckPrototypes( | 2638 CheckPrototypes( |
| 2635 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), | 2639 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2636 r0, holder, r3, r1, r4, name, &miss); | 2640 r0, holder, r3, r1, r4, name, &miss); |
| 2637 break; | 2641 break; |
| 2638 } | 2642 } |
| 2639 } | 2643 } |
| 2640 | 2644 |
| 2641 __ b(success); | 2645 Label success; |
| 2646 __ b(&success); |
| 2642 | 2647 |
| 2643 // Handle call cache miss. | 2648 // Handle call cache miss. |
| 2644 __ bind(&miss); | 2649 __ bind(&miss); |
| 2645 GenerateMissBranch(); | 2650 GenerateMissBranch(); |
| 2651 |
| 2652 __ bind(&success); |
| 2646 } | 2653 } |
| 2647 | 2654 |
| 2648 | 2655 |
| 2649 void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) { | 2656 void CallStubCompiler::CompileHandlerBackend(Handle<JSFunction> function) { |
| 2650 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) | 2657 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) |
| 2651 ? CALL_AS_FUNCTION | 2658 ? CALL_AS_FUNCTION |
| 2652 : CALL_AS_METHOD; | 2659 : CALL_AS_METHOD; |
| 2653 ParameterCount expected(function); | 2660 ParameterCount expected(function); |
| 2654 __ InvokeFunction(function, expected, arguments(), | 2661 __ InvokeFunction(function, expected, arguments(), |
| 2655 JUMP_FUNCTION, NullCallWrapper(), call_kind); | 2662 JUMP_FUNCTION, NullCallWrapper(), call_kind); |
| 2656 } | 2663 } |
| 2657 | 2664 |
| 2658 | 2665 |
| 2659 Handle<Code> CallStubCompiler::CompileCallConstant( | 2666 Handle<Code> CallStubCompiler::CompileCallConstant( |
| 2660 Handle<Object> object, | 2667 Handle<Object> object, |
| 2661 Handle<JSObject> holder, | 2668 Handle<JSObject> holder, |
| 2662 Handle<Name> name, | 2669 Handle<Name> name, |
| 2663 CheckType check, | 2670 CheckType check, |
| 2664 Handle<JSFunction> function) { | 2671 Handle<JSFunction> function) { |
| 2665 if (HasCustomCallGenerator(function)) { | 2672 if (HasCustomCallGenerator(function)) { |
| 2666 Handle<Code> code = CompileCustomCall(object, holder, | 2673 Handle<Code> code = CompileCustomCall(object, holder, |
| 2667 Handle<Cell>::null(), | 2674 Handle<Cell>::null(), |
| 2668 function, Handle<String>::cast(name), | 2675 function, Handle<String>::cast(name), |
| 2669 Code::CONSTANT); | 2676 Code::CONSTANT); |
| 2670 // A null handle means bail out to the regular compiler code below. | 2677 // A null handle means bail out to the regular compiler code below. |
| 2671 if (!code.is_null()) return code; | 2678 if (!code.is_null()) return code; |
| 2672 } | 2679 } |
| 2673 | 2680 |
| 2674 Label success; | 2681 CompileHandlerFrontend(object, holder, name, check); |
| 2675 | |
| 2676 CompileHandlerFrontend(object, holder, name, check, &success); | |
| 2677 __ bind(&success); | |
| 2678 CompileHandlerBackend(function); | 2682 CompileHandlerBackend(function); |
| 2679 | 2683 |
| 2680 // Return the generated code. | 2684 // Return the generated code. |
| 2681 return GetCode(function); | 2685 return GetCode(function); |
| 2682 } | 2686 } |
| 2683 | 2687 |
| 2684 | 2688 |
| 2685 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, | 2689 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
| 2686 Handle<JSObject> holder, | 2690 Handle<JSObject> holder, |
| 2687 Handle<Name> name) { | 2691 Handle<Name> name) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2778 // Return the generated code. | 2782 // Return the generated code. |
| 2779 return GetCode(Code::NORMAL, name); | 2783 return GetCode(Code::NORMAL, name); |
| 2780 } | 2784 } |
| 2781 | 2785 |
| 2782 | 2786 |
| 2783 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2787 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 2784 Handle<JSObject> object, | 2788 Handle<JSObject> object, |
| 2785 Handle<JSObject> holder, | 2789 Handle<JSObject> holder, |
| 2786 Handle<Name> name, | 2790 Handle<Name> name, |
| 2787 Handle<ExecutableAccessorInfo> callback) { | 2791 Handle<ExecutableAccessorInfo> callback) { |
| 2788 Label success; | 2792 HandlerFrontend(object, receiver(), holder, name); |
| 2789 HandlerFrontend(object, receiver(), holder, name, &success); | |
| 2790 __ bind(&success); | |
| 2791 | 2793 |
| 2792 // Stub never generated for non-global objects that require access checks. | 2794 // Stub never generated for non-global objects that require access checks. |
| 2793 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); | 2795 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); |
| 2794 | 2796 |
| 2795 __ push(receiver()); // receiver | 2797 __ push(receiver()); // receiver |
| 2796 __ mov(ip, Operand(callback)); // callback info | 2798 __ mov(ip, Operand(callback)); // callback info |
| 2797 __ push(ip); | 2799 __ push(ip); |
| 2798 __ mov(ip, Operand(name)); | 2800 __ mov(ip, Operand(name)); |
| 2799 __ Push(ip, value()); | 2801 __ Push(ip, value()); |
| 2800 | 2802 |
| 2801 // Do tail-call to the runtime system. | 2803 // Do tail-call to the runtime system. |
| 2802 ExternalReference store_callback_property = | 2804 ExternalReference store_callback_property = |
| 2803 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2805 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
| 2804 __ TailCallExternalReference(store_callback_property, 4, 1); | 2806 __ TailCallExternalReference(store_callback_property, 4, 1); |
| 2805 | 2807 |
| 2806 // Return the generated code. | 2808 // Return the generated code. |
| 2807 return GetCode(kind(), Code::CALLBACKS, name); | 2809 return GetCode(kind(), Code::CALLBACKS, name); |
| 2808 } | 2810 } |
| 2809 | 2811 |
| 2810 | 2812 |
| 2811 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2813 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 2812 Handle<JSObject> object, | 2814 Handle<JSObject> object, |
| 2813 Handle<JSObject> holder, | 2815 Handle<JSObject> holder, |
| 2814 Handle<Name> name, | 2816 Handle<Name> name, |
| 2815 const CallOptimization& call_optimization) { | 2817 const CallOptimization& call_optimization) { |
| 2816 Label success; | 2818 HandlerFrontend(object, receiver(), holder, name); |
| 2817 HandlerFrontend(object, receiver(), holder, name, &success); | |
| 2818 __ bind(&success); | |
| 2819 | 2819 |
| 2820 Register values[] = { value() }; | 2820 Register values[] = { value() }; |
| 2821 GenerateFastApiCall( | 2821 GenerateFastApiCall( |
| 2822 masm(), call_optimization, receiver(), scratch3(), 1, values); | 2822 masm(), call_optimization, receiver(), scratch3(), 1, values); |
| 2823 | 2823 |
| 2824 // Return the generated code. | 2824 // Return the generated code. |
| 2825 return GetCode(kind(), Code::CALLBACKS, name); | 2825 return GetCode(kind(), Code::CALLBACKS, name); |
| 2826 } | 2826 } |
| 2827 | 2827 |
| 2828 | 2828 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2903 // Handle store cache miss. | 2903 // Handle store cache miss. |
| 2904 __ bind(&miss); | 2904 __ bind(&miss); |
| 2905 TailCallBuiltin(masm(), MissBuiltin(kind())); | 2905 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 2906 | 2906 |
| 2907 // Return the generated code. | 2907 // Return the generated code. |
| 2908 return GetCode(kind(), Code::INTERCEPTOR, name); | 2908 return GetCode(kind(), Code::INTERCEPTOR, name); |
| 2909 } | 2909 } |
| 2910 | 2910 |
| 2911 | 2911 |
| 2912 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( | 2912 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
| 2913 Handle<JSObject> object, | 2913 Handle<Object> object, |
| 2914 Handle<JSObject> last, | 2914 Handle<JSObject> last, |
| 2915 Handle<Name> name, | 2915 Handle<Name> name, |
| 2916 Handle<JSGlobalObject> global) { | 2916 Handle<JSGlobalObject> global) { |
| 2917 Label success; | 2917 NonexistentHandlerFrontend(object, last, name, global); |
| 2918 | 2918 |
| 2919 NonexistentHandlerFrontend(object, last, name, &success, global); | |
| 2920 | |
| 2921 __ bind(&success); | |
| 2922 // Return undefined if maps of the full prototype chain are still the | 2919 // Return undefined if maps of the full prototype chain are still the |
| 2923 // same and no global property with this name contains a value. | 2920 // same and no global property with this name contains a value. |
| 2924 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 2921 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 2925 __ Ret(); | 2922 __ Ret(); |
| 2926 | 2923 |
| 2927 // Return the generated code. | 2924 // Return the generated code. |
| 2928 return GetCode(kind(), Code::NONEXISTENT, name); | 2925 return GetCode(kind(), Code::NONEXISTENT, name); |
| 2929 } | 2926 } |
| 2930 | 2927 |
| 2931 | 2928 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3006 } | 3003 } |
| 3007 __ Ret(); | 3004 __ Ret(); |
| 3008 } | 3005 } |
| 3009 | 3006 |
| 3010 | 3007 |
| 3011 #undef __ | 3008 #undef __ |
| 3012 #define __ ACCESS_MASM(masm()) | 3009 #define __ ACCESS_MASM(masm()) |
| 3013 | 3010 |
| 3014 | 3011 |
| 3015 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 3012 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
| 3016 Handle<JSObject> object, | 3013 Handle<Object> object, |
| 3017 Handle<GlobalObject> global, | 3014 Handle<GlobalObject> global, |
| 3018 Handle<PropertyCell> cell, | 3015 Handle<PropertyCell> cell, |
| 3019 Handle<Name> name, | 3016 Handle<Name> name, |
| 3020 bool is_dont_delete) { | 3017 bool is_dont_delete) { |
| 3021 Label success, miss; | 3018 Label miss; |
| 3022 | 3019 |
| 3023 HandlerFrontendHeader(object, receiver(), global, name, &miss); | 3020 HandlerFrontendHeader(object, receiver(), global, name, &miss); |
| 3024 | 3021 |
| 3025 // Get the value from the cell. | 3022 // Get the value from the cell. |
| 3026 __ mov(r3, Operand(cell)); | 3023 __ mov(r3, Operand(cell)); |
| 3027 __ ldr(r4, FieldMemOperand(r3, Cell::kValueOffset)); | 3024 __ ldr(r4, FieldMemOperand(r3, Cell::kValueOffset)); |
| 3028 | 3025 |
| 3029 // Check for deleted property if property can actually be deleted. | 3026 // Check for deleted property if property can actually be deleted. |
| 3030 if (!is_dont_delete) { | 3027 if (!is_dont_delete) { |
| 3031 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 3028 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 3032 __ cmp(r4, ip); | 3029 __ cmp(r4, ip); |
| 3033 __ b(eq, &miss); | 3030 __ b(eq, &miss); |
| 3034 } | 3031 } |
| 3035 | 3032 |
| 3036 HandlerFrontendFooter(name, &success, &miss); | 3033 HandlerFrontendFooter(name, &miss); |
| 3037 __ bind(&success); | |
| 3038 | 3034 |
| 3039 Counters* counters = isolate()->counters(); | 3035 Counters* counters = isolate()->counters(); |
| 3040 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); | 3036 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); |
| 3041 __ mov(r0, r4); | 3037 __ mov(r0, r4); |
| 3042 __ Ret(); | 3038 __ Ret(); |
| 3043 | 3039 |
| 3044 // Return the generated code. | 3040 // Return the generated code. |
| 3045 return GetCode(kind(), Code::NORMAL, name); | 3041 return GetCode(kind(), Code::NORMAL, name); |
| 3046 } | 3042 } |
| 3047 | 3043 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3160 // ----------------------------------- | 3156 // ----------------------------------- |
| 3161 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3157 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
| 3162 } | 3158 } |
| 3163 | 3159 |
| 3164 | 3160 |
| 3165 #undef __ | 3161 #undef __ |
| 3166 | 3162 |
| 3167 } } // namespace v8::internal | 3163 } } // namespace v8::internal |
| 3168 | 3164 |
| 3169 #endif // V8_TARGET_ARCH_ARM | 3165 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |