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/code-factory.h" | 5 #include "src/code-factory.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 51 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
52 isolate, initialization_state, state); | 52 isolate, initialization_state, state); |
53 if (initialization_state != MEGAMORPHIC) { | 53 if (initialization_state != MEGAMORPHIC) { |
54 return Callable(code, LoadWithVectorDescriptor(isolate)); | 54 return Callable(code, LoadWithVectorDescriptor(isolate)); |
55 } | 55 } |
56 return Callable(code, LoadDescriptor(isolate)); | 56 return Callable(code, LoadDescriptor(isolate)); |
57 } | 57 } |
58 | 58 |
59 | 59 |
60 // static | 60 // static |
61 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 61 Callable CodeFactory::CallIC(Isolate* isolate, int argc) { |
62 CallICState::CallType call_type) { | 62 return Callable(CallIC::initialize_stub(isolate, argc), |
63 return Callable(CallIC::initialize_stub(isolate, argc, call_type), | |
64 CallFunctionWithFeedbackDescriptor(isolate)); | 63 CallFunctionWithFeedbackDescriptor(isolate)); |
65 } | 64 } |
66 | 65 |
67 | 66 |
68 // static | 67 // static |
69 Callable CodeFactory::CallICInOptimizedCode(Isolate* isolate, int argc, | 68 Callable CodeFactory::CallICInOptimizedCode(Isolate* isolate, int argc) { |
70 CallICState::CallType call_type) { | 69 return Callable(CallIC::initialize_stub_in_optimized_code(isolate, argc), |
71 return Callable( | 70 CallFunctionWithFeedbackAndVectorDescriptor(isolate)); |
72 CallIC::initialize_stub_in_optimized_code(isolate, argc, call_type), | |
73 CallFunctionWithFeedbackAndVectorDescriptor(isolate)); | |
74 } | 71 } |
75 | 72 |
76 | 73 |
77 // static | 74 // static |
78 Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { | 75 Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { |
79 return Callable( | 76 return Callable( |
80 StoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), | 77 StoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), |
81 FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) | 78 FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) |
82 : StoreDescriptor(isolate)); | 79 : StoreDescriptor(isolate)); |
83 } | 80 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 278 |
282 | 279 |
283 // static | 280 // static |
284 Callable CodeFactory::AllocateInNewSpace(Isolate* isolate) { | 281 Callable CodeFactory::AllocateInNewSpace(Isolate* isolate) { |
285 AllocateInNewSpaceStub stub(isolate); | 282 AllocateInNewSpaceStub stub(isolate); |
286 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 283 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
287 } | 284 } |
288 | 285 |
289 | 286 |
290 // static | 287 // static |
291 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, | |
292 CallFunctionFlags flags) { | |
293 CallFunctionStub stub(isolate, argc, flags); | |
294 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | |
295 } | |
296 | |
297 | |
298 // static | |
299 Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) { | 288 Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) { |
300 return Callable(isolate->builtins()->ArgumentsAdaptorTrampoline(), | 289 return Callable(isolate->builtins()->ArgumentsAdaptorTrampoline(), |
301 ArgumentAdaptorDescriptor(isolate)); | 290 ArgumentAdaptorDescriptor(isolate)); |
302 } | 291 } |
303 | 292 |
304 | 293 |
305 // static | 294 // static |
306 Callable CodeFactory::Call(Isolate* isolate) { | 295 Callable CodeFactory::Call(Isolate* isolate) { |
307 return Callable(isolate->builtins()->Call(), | 296 return Callable(isolate->builtins()->Call(), |
308 CallTrampolineDescriptor(isolate)); | 297 CallTrampolineDescriptor(isolate)); |
(...skipping 18 matching lines...) Expand all Loading... |
327 Callable CodeFactory::InterpreterCEntry(Isolate* isolate) { | 316 Callable CodeFactory::InterpreterCEntry(Isolate* isolate) { |
328 // TODO(rmcilroy): Deal with runtime functions that return two values. | 317 // TODO(rmcilroy): Deal with runtime functions that return two values. |
329 // Note: If we ever use fpregs in the interpreter then we will need to | 318 // Note: If we ever use fpregs in the interpreter then we will need to |
330 // save fpregs too. | 319 // save fpregs too. |
331 CEntryStub stub(isolate, 1, kDontSaveFPRegs, kArgvInRegister); | 320 CEntryStub stub(isolate, 1, kDontSaveFPRegs, kArgvInRegister); |
332 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); | 321 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); |
333 } | 322 } |
334 | 323 |
335 } // namespace internal | 324 } // namespace internal |
336 } // namespace v8 | 325 } // namespace v8 |
OLD | NEW |