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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 // rsp[argc * 8] : argument 1 | 2214 // rsp[argc * 8] : argument 1 |
2215 // rsp[(argc + 1) * 8] : argument 0 = receiver | 2215 // rsp[(argc + 1) * 8] : argument 0 = receiver |
2216 // ----------------------------------- | 2216 // ----------------------------------- |
2217 Label miss; | 2217 Label miss; |
2218 | 2218 |
2219 GenerateNameCheck(name, &miss); | 2219 GenerateNameCheck(name, &miss); |
2220 | 2220 |
2221 // Get the number of arguments. | 2221 // Get the number of arguments. |
2222 const int argc = arguments().immediate(); | 2222 const int argc = arguments().immediate(); |
2223 | 2223 |
2224 LookupResult lookup; | 2224 LookupResult lookup(isolate()); |
2225 LookupPostInterceptor(holder, name, &lookup); | 2225 LookupPostInterceptor(holder, name, &lookup); |
2226 | 2226 |
2227 // Get the receiver from the stack. | 2227 // Get the receiver from the stack. |
2228 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 2228 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
2229 | 2229 |
2230 CallInterceptorCompiler compiler(this, arguments(), rcx, extra_ic_state_); | 2230 CallInterceptorCompiler compiler(this, arguments(), rcx, extra_ic_state_); |
2231 MaybeObject* result = compiler.Compile(masm(), | 2231 MaybeObject* result = compiler.Compile(masm(), |
2232 object, | 2232 object, |
2233 holder, | 2233 holder, |
2234 name, | 2234 name, |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2758 MaybeObject* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 2758 MaybeObject* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
2759 JSObject* holder, | 2759 JSObject* holder, |
2760 String* name) { | 2760 String* name) { |
2761 // ----------- S t a t e ------------- | 2761 // ----------- S t a t e ------------- |
2762 // -- rax : receiver | 2762 // -- rax : receiver |
2763 // -- rcx : name | 2763 // -- rcx : name |
2764 // -- rsp[0] : return address | 2764 // -- rsp[0] : return address |
2765 // ----------------------------------- | 2765 // ----------------------------------- |
2766 Label miss; | 2766 Label miss; |
2767 | 2767 |
2768 LookupResult lookup; | 2768 LookupResult lookup(isolate()); |
2769 LookupPostInterceptor(holder, name, &lookup); | 2769 LookupPostInterceptor(holder, name, &lookup); |
2770 | 2770 |
2771 // TODO(368): Compile in the whole chain: all the interceptors in | 2771 // TODO(368): Compile in the whole chain: all the interceptors in |
2772 // prototypes and ultimate answer. | 2772 // prototypes and ultimate answer. |
2773 GenerateLoadInterceptor(receiver, | 2773 GenerateLoadInterceptor(receiver, |
2774 holder, | 2774 holder, |
2775 &lookup, | 2775 &lookup, |
2776 rax, | 2776 rax, |
2777 rcx, | 2777 rcx, |
2778 rdx, | 2778 rdx, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2942 // ----------------------------------- | 2942 // ----------------------------------- |
2943 Label miss; | 2943 Label miss; |
2944 | 2944 |
2945 Counters* counters = isolate()->counters(); | 2945 Counters* counters = isolate()->counters(); |
2946 __ IncrementCounter(counters->keyed_load_interceptor(), 1); | 2946 __ IncrementCounter(counters->keyed_load_interceptor(), 1); |
2947 | 2947 |
2948 // Check that the name has not changed. | 2948 // Check that the name has not changed. |
2949 __ Cmp(rax, Handle<String>(name)); | 2949 __ Cmp(rax, Handle<String>(name)); |
2950 __ j(not_equal, &miss); | 2950 __ j(not_equal, &miss); |
2951 | 2951 |
2952 LookupResult lookup; | 2952 LookupResult lookup(isolate()); |
2953 LookupPostInterceptor(holder, name, &lookup); | 2953 LookupPostInterceptor(holder, name, &lookup); |
2954 GenerateLoadInterceptor(receiver, | 2954 GenerateLoadInterceptor(receiver, |
2955 holder, | 2955 holder, |
2956 &lookup, | 2956 &lookup, |
2957 rdx, | 2957 rdx, |
2958 rax, | 2958 rax, |
2959 rcx, | 2959 rcx, |
2960 rbx, | 2960 rbx, |
2961 rdi, | 2961 rdi, |
2962 name, | 2962 name, |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3804 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3804 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3805 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3805 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3806 } | 3806 } |
3807 | 3807 |
3808 | 3808 |
3809 #undef __ | 3809 #undef __ |
3810 | 3810 |
3811 } } // namespace v8::internal | 3811 } } // namespace v8::internal |
3812 | 3812 |
3813 #endif // V8_TARGET_ARCH_X64 | 3813 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |