OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 // Handle store cache miss. | 2586 // Handle store cache miss. |
2587 __ bind(&miss); | 2587 __ bind(&miss); |
2588 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2588 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
2589 __ Jump(ic, RelocInfo::CODE_TARGET); | 2589 __ Jump(ic, RelocInfo::CODE_TARGET); |
2590 | 2590 |
2591 // Return the generated code. | 2591 // Return the generated code. |
2592 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); | 2592 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); |
2593 } | 2593 } |
2594 | 2594 |
2595 | 2595 |
2596 MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, | 2596 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
2597 AccessorInfo* callback, | 2597 Handle<JSObject> object, |
2598 String* name) { | 2598 Handle<AccessorInfo> callback, |
| 2599 Handle<String> name) { |
2599 // ----------- S t a t e ------------- | 2600 // ----------- S t a t e ------------- |
2600 // -- rax : value | 2601 // -- rax : value |
2601 // -- rcx : name | 2602 // -- rcx : name |
2602 // -- rdx : receiver | 2603 // -- rdx : receiver |
2603 // -- rsp[0] : return address | 2604 // -- rsp[0] : return address |
2604 // ----------------------------------- | 2605 // ----------------------------------- |
2605 Label miss; | 2606 Label miss; |
2606 | 2607 |
2607 // Check that the object isn't a smi. | 2608 // Check that the object isn't a smi. |
2608 __ JumpIfSmi(rdx, &miss); | 2609 __ JumpIfSmi(rdx, &miss); |
2609 | 2610 |
2610 // Check that the map of the object hasn't changed. | 2611 // Check that the map of the object hasn't changed. |
2611 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), | 2612 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
2612 Handle<Map>(object->map())); | 2613 Handle<Map>(object->map())); |
2613 __ j(not_equal, &miss); | 2614 __ j(not_equal, &miss); |
2614 | 2615 |
2615 // Perform global security token check if needed. | 2616 // Perform global security token check if needed. |
2616 if (object->IsJSGlobalProxy()) { | 2617 if (object->IsJSGlobalProxy()) { |
2617 __ CheckAccessGlobalProxy(rdx, rbx, &miss); | 2618 __ CheckAccessGlobalProxy(rdx, rbx, &miss); |
2618 } | 2619 } |
2619 | 2620 |
2620 // Stub never generated for non-global objects that require access | 2621 // Stub never generated for non-global objects that require access |
2621 // checks. | 2622 // checks. |
2622 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 2623 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
2623 | 2624 |
2624 __ pop(rbx); // remove the return address | 2625 __ pop(rbx); // remove the return address |
2625 __ push(rdx); // receiver | 2626 __ push(rdx); // receiver |
2626 __ Push(Handle<AccessorInfo>(callback)); // callback info | 2627 __ Push(callback); // callback info |
2627 __ push(rcx); // name | 2628 __ push(rcx); // name |
2628 __ push(rax); // value | 2629 __ push(rax); // value |
2629 __ push(rbx); // restore return address | 2630 __ push(rbx); // restore return address |
2630 | 2631 |
2631 // Do tail-call to the runtime system. | 2632 // Do tail-call to the runtime system. |
2632 ExternalReference store_callback_property = | 2633 ExternalReference store_callback_property = |
2633 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2634 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
2634 __ TailCallExternalReference(store_callback_property, 4, 1); | 2635 __ TailCallExternalReference(store_callback_property, 4, 1); |
2635 | 2636 |
2636 // Handle store cache miss. | 2637 // Handle store cache miss. |
2637 __ bind(&miss); | 2638 __ bind(&miss); |
2638 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2639 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
2639 __ Jump(ic, RelocInfo::CODE_TARGET); | 2640 __ Jump(ic, RelocInfo::CODE_TARGET); |
2640 | 2641 |
2641 // Return the generated code. | 2642 // Return the generated code. |
2642 return TryGetCode(CALLBACKS, name); | 2643 return GetCode(CALLBACKS, name); |
2643 } | 2644 } |
2644 | 2645 |
2645 | 2646 |
2646 MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, | 2647 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
2647 String* name) { | 2648 Handle<JSObject> receiver, |
| 2649 Handle<String> name) { |
2648 // ----------- S t a t e ------------- | 2650 // ----------- S t a t e ------------- |
2649 // -- rax : value | 2651 // -- rax : value |
2650 // -- rcx : name | 2652 // -- rcx : name |
2651 // -- rdx : receiver | 2653 // -- rdx : receiver |
2652 // -- rsp[0] : return address | 2654 // -- rsp[0] : return address |
2653 // ----------------------------------- | 2655 // ----------------------------------- |
2654 Label miss; | 2656 Label miss; |
2655 | 2657 |
2656 // Check that the object isn't a smi. | 2658 // Check that the object isn't a smi. |
2657 __ JumpIfSmi(rdx, &miss); | 2659 __ JumpIfSmi(rdx, &miss); |
(...skipping 23 matching lines...) Expand all Loading... |
2681 ExternalReference store_ic_property = | 2683 ExternalReference store_ic_property = |
2682 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); | 2684 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); |
2683 __ TailCallExternalReference(store_ic_property, 4, 1); | 2685 __ TailCallExternalReference(store_ic_property, 4, 1); |
2684 | 2686 |
2685 // Handle store cache miss. | 2687 // Handle store cache miss. |
2686 __ bind(&miss); | 2688 __ bind(&miss); |
2687 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2689 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
2688 __ Jump(ic, RelocInfo::CODE_TARGET); | 2690 __ Jump(ic, RelocInfo::CODE_TARGET); |
2689 | 2691 |
2690 // Return the generated code. | 2692 // Return the generated code. |
2691 return TryGetCode(INTERCEPTOR, name); | 2693 return GetCode(INTERCEPTOR, name); |
2692 } | 2694 } |
2693 | 2695 |
2694 | 2696 |
2695 Handle<Code> StoreStubCompiler::CompileStoreGlobal( | 2697 Handle<Code> StoreStubCompiler::CompileStoreGlobal( |
2696 Handle<GlobalObject> object, | 2698 Handle<GlobalObject> object, |
2697 Handle<JSGlobalPropertyCell> cell, | 2699 Handle<JSGlobalPropertyCell> cell, |
2698 Handle<String> name) { | 2700 Handle<String> name) { |
2699 // ----------- S t a t e ------------- | 2701 // ----------- S t a t e ------------- |
2700 // -- rax : value | 2702 // -- rax : value |
2701 // -- rcx : name | 2703 // -- rcx : name |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4001 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 4003 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
4002 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 4004 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
4003 } | 4005 } |
4004 | 4006 |
4005 | 4007 |
4006 #undef __ | 4008 #undef __ |
4007 | 4009 |
4008 } } // namespace v8::internal | 4010 } } // namespace v8::internal |
4009 | 4011 |
4010 #endif // V8_TARGET_ARCH_X64 | 4012 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |