OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 if (api_call_info->data()->IsUndefined()) { | 199 if (api_call_info->data()->IsUndefined()) { |
200 call_data_undefined = true; | 200 call_data_undefined = true; |
201 __ mov(data, Immediate(isolate->factory()->undefined_value())); | 201 __ mov(data, Immediate(isolate->factory()->undefined_value())); |
202 } else { | 202 } else { |
203 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 203 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
204 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 204 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
205 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 205 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
206 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); | 206 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); |
207 } | 207 } |
208 | 208 |
| 209 if (api_call_info->fast_handler()->IsCode()) { |
| 210 // Just tail call into the code. |
| 211 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
| 212 RelocInfo::CODE_TARGET); |
| 213 return; |
| 214 } |
209 // Put api_function_address in place. | 215 // Put api_function_address in place. |
210 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 216 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
211 __ mov(api_function_address, Immediate(function_address)); | 217 __ mov(api_function_address, Immediate(function_address)); |
212 | 218 |
213 // Jump to stub. | 219 // Jump to stub. |
214 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 220 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
215 __ TailCallStub(&stub); | 221 __ TailCallStub(&stub); |
216 } | 222 } |
217 | 223 |
218 | 224 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 // Return the generated code. | 816 // Return the generated code. |
811 return GetCode(kind(), Code::NORMAL, name); | 817 return GetCode(kind(), Code::NORMAL, name); |
812 } | 818 } |
813 | 819 |
814 | 820 |
815 #undef __ | 821 #undef __ |
816 } // namespace internal | 822 } // namespace internal |
817 } // namespace v8 | 823 } // namespace v8 |
818 | 824 |
819 #endif // V8_TARGET_ARCH_X87 | 825 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |