OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Write the arguments to stack frame. | 140 // Write the arguments to stack frame. |
141 if (is_store) { | 141 if (is_store) { |
142 DCHECK(!receiver.is(store_parameter)); | 142 DCHECK(!receiver.is(store_parameter)); |
143 DCHECK(!scratch_in.is(store_parameter)); | 143 DCHECK(!scratch_in.is(store_parameter)); |
144 __ Push(store_parameter); | 144 __ Push(store_parameter); |
145 } | 145 } |
146 __ PushReturnAddressFrom(scratch_in); | 146 __ PushReturnAddressFrom(scratch_in); |
147 // Stack now matches JSFunction abi. | 147 // Stack now matches JSFunction abi. |
148 | 148 |
149 // Abi for CallApiFunctionStub. | 149 // Abi for CallApiFunctionStub. |
150 Register callee = rax; | 150 Register callee = rdi; |
151 Register call_data = rbx; | 151 Register call_data = rbx; |
152 Register holder = rcx; | 152 Register holder = rcx; |
153 Register api_function_address = rdx; | 153 Register api_function_address = rdx; |
154 Register scratch = rdi; // scratch_in is no longer valid. | 154 Register scratch = rax; // scratch_in is no longer valid. |
155 | 155 |
156 // Put holder in place. | 156 // Put holder in place. |
157 CallOptimization::HolderLookup holder_lookup; | 157 CallOptimization::HolderLookup holder_lookup; |
158 Handle<JSObject> api_holder = | 158 Handle<JSObject> api_holder = |
159 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); | 159 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); |
160 switch (holder_lookup) { | 160 switch (holder_lookup) { |
161 case CallOptimization::kHolderIsReceiver: | 161 case CallOptimization::kHolderIsReceiver: |
162 __ Move(holder, receiver); | 162 __ Move(holder, receiver); |
163 break; | 163 break; |
164 case CallOptimization::kHolderFound: | 164 case CallOptimization::kHolderFound: |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 // Return the generated code. | 747 // Return the generated code. |
748 return GetCode(kind(), Code::NORMAL, name); | 748 return GetCode(kind(), Code::NORMAL, name); |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 #undef __ | 752 #undef __ |
753 } | 753 } |
754 } // namespace v8::internal | 754 } // namespace v8::internal |
755 | 755 |
756 #endif // V8_TARGET_ARCH_X64 | 756 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |