| 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 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 | 2816 |
| 2817 // Return the generated code. | 2817 // Return the generated code. |
| 2818 return GetCode(Code::CALLBACKS, name); | 2818 return GetCode(Code::CALLBACKS, name); |
| 2819 } | 2819 } |
| 2820 | 2820 |
| 2821 | 2821 |
| 2822 #undef __ | 2822 #undef __ |
| 2823 #define __ ACCESS_MASM(masm) | 2823 #define __ ACCESS_MASM(masm) |
| 2824 | 2824 |
| 2825 | 2825 |
| 2826 void LoadStubCompiler::GenerateLoadArrayLength( |
| 2827 MacroAssembler* masm, |
| 2828 Register holder) { |
| 2829 // ----------- S t a t e ------------- |
| 2830 // -- rax : receiver |
| 2831 // -- rcx : name |
| 2832 // -- rsp[0] : return address |
| 2833 // ----------------------------------- |
| 2834 |
| 2835 // Load length directly from the JS array. |
| 2836 __ movq(rax, FieldOperand(holder, JSArray::kLengthOffset)); |
| 2837 __ ret(0); |
| 2838 } |
| 2839 |
| 2840 |
| 2841 #undef __ |
| 2842 #define __ ACCESS_MASM(masm()) |
| 2843 |
| 2844 |
| 2845 Handle<Code> LoadStubCompiler::CompileLoadArrayLength( |
| 2846 Handle<String> name, |
| 2847 Handle<JSObject> receiver, |
| 2848 Handle<JSObject> holder) { |
| 2849 // ----------- S t a t e ------------- |
| 2850 // -- rax : receiver |
| 2851 // -- rcx : name |
| 2852 // -- rsp[0] : return address |
| 2853 // ----------------------------------- |
| 2854 Label miss; |
| 2855 |
| 2856 // Check that the maps haven't changed. |
| 2857 __ JumpIfSmi(rax, &miss); |
| 2858 Register holder_reg = CheckPrototypes( |
| 2859 receiver, rax, holder, rbx, rdx, rdi, name, &miss); |
| 2860 |
| 2861 GenerateLoadArrayLength(masm(), holder_reg); |
| 2862 |
| 2863 __ bind(&miss); |
| 2864 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2865 |
| 2866 // Return the generated code. |
| 2867 return GetCode(Code::CALLBACKS, name, |
| 2868 Code::ExtraICStateForeignCallbackArrayLength); |
| 2869 } |
| 2870 |
| 2871 |
| 2872 #undef __ |
| 2873 #define __ ACCESS_MASM(masm) |
| 2874 |
| 2875 |
| 2826 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 2876 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 2827 Handle<JSFunction> getter) { | 2877 Handle<JSFunction> getter) { |
| 2828 // ----------- S t a t e ------------- | 2878 // ----------- S t a t e ------------- |
| 2829 // -- rax : receiver | 2879 // -- rax : receiver |
| 2830 // -- rcx : name | 2880 // -- rcx : name |
| 2831 // -- rsp[0] : return address | 2881 // -- rsp[0] : return address |
| 2832 // ----------------------------------- | 2882 // ----------------------------------- |
| 2833 { | 2883 { |
| 2834 FrameScope scope(masm, StackFrame::INTERNAL); | 2884 FrameScope scope(masm, StackFrame::INTERNAL); |
| 2835 | 2885 |
| (...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4096 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4146 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 4097 } | 4147 } |
| 4098 } | 4148 } |
| 4099 | 4149 |
| 4100 | 4150 |
| 4101 #undef __ | 4151 #undef __ |
| 4102 | 4152 |
| 4103 } } // namespace v8::internal | 4153 } } // namespace v8::internal |
| 4104 | 4154 |
| 4105 #endif // V8_TARGET_ARCH_X64 | 4155 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |