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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (api_call_info->data()->IsUndefined()) { | 181 if (api_call_info->data()->IsUndefined()) { |
182 call_data_undefined = true; | 182 call_data_undefined = true; |
183 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 183 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
184 } else { | 184 } else { |
185 __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 185 __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
186 __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 186 __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
187 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 187 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
188 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); | 188 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); |
189 } | 189 } |
190 | 190 |
| 191 if (api_call_info->fast_handler()->IsCode()) { |
| 192 // Just tail call into the fast handler if present. |
| 193 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
| 194 RelocInfo::CODE_TARGET); |
| 195 return; |
| 196 } |
| 197 |
191 // Put api_function_address in place. | 198 // Put api_function_address in place. |
192 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 199 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
193 __ Move(api_function_address, function_address, | 200 __ Move(api_function_address, function_address, |
194 RelocInfo::EXTERNAL_REFERENCE); | 201 RelocInfo::EXTERNAL_REFERENCE); |
195 | 202 |
196 // Jump to stub. | 203 // Jump to stub. |
197 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 204 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
198 __ TailCallStub(&stub); | 205 __ TailCallStub(&stub); |
199 } | 206 } |
200 | 207 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 // Return the generated code. | 818 // Return the generated code. |
812 return GetCode(kind(), Code::NORMAL, name); | 819 return GetCode(kind(), Code::NORMAL, name); |
813 } | 820 } |
814 | 821 |
815 | 822 |
816 #undef __ | 823 #undef __ |
817 } // namespace internal | 824 } // namespace internal |
818 } // namespace v8 | 825 } // namespace v8 |
819 | 826 |
820 #endif // V8_TARGET_ARCH_X64 | 827 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |