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 return Callable(CallIC::initialize_stub(isolate, argc), | 62 ConvertReceiverMode mode) { |
| 63 return Callable(CallIC::initialize_stub(isolate, argc, mode), |
63 CallFunctionWithFeedbackDescriptor(isolate)); | 64 CallFunctionWithFeedbackDescriptor(isolate)); |
64 } | 65 } |
65 | 66 |
66 | 67 |
67 // static | 68 // static |
68 Callable CodeFactory::CallICInOptimizedCode(Isolate* isolate, int argc) { | 69 Callable CodeFactory::CallICInOptimizedCode(Isolate* isolate, int argc, |
69 return Callable(CallIC::initialize_stub_in_optimized_code(isolate, argc), | 70 ConvertReceiverMode mode) { |
70 CallFunctionWithFeedbackAndVectorDescriptor(isolate)); | 71 return Callable( |
| 72 CallIC::initialize_stub_in_optimized_code(isolate, argc, mode), |
| 73 CallFunctionWithFeedbackAndVectorDescriptor(isolate)); |
71 } | 74 } |
72 | 75 |
73 | 76 |
74 // static | 77 // static |
75 Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { | 78 Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { |
76 return Callable( | 79 return Callable( |
77 StoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), | 80 StoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), |
78 FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) | 81 FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) |
79 : StoreDescriptor(isolate)); | 82 : StoreDescriptor(isolate)); |
80 } | 83 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 288 |
286 | 289 |
287 // static | 290 // static |
288 Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) { | 291 Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) { |
289 return Callable(isolate->builtins()->ArgumentsAdaptorTrampoline(), | 292 return Callable(isolate->builtins()->ArgumentsAdaptorTrampoline(), |
290 ArgumentAdaptorDescriptor(isolate)); | 293 ArgumentAdaptorDescriptor(isolate)); |
291 } | 294 } |
292 | 295 |
293 | 296 |
294 // static | 297 // static |
295 Callable CodeFactory::Call(Isolate* isolate) { | 298 Callable CodeFactory::Call(Isolate* isolate, ConvertReceiverMode mode) { |
296 return Callable(isolate->builtins()->Call(), | 299 return Callable(isolate->builtins()->Call(mode), |
297 CallTrampolineDescriptor(isolate)); | 300 CallTrampolineDescriptor(isolate)); |
298 } | 301 } |
299 | 302 |
300 | 303 |
301 // static | 304 // static |
302 Callable CodeFactory::CallFunction(Isolate* isolate) { | 305 Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) { |
303 return Callable(isolate->builtins()->CallFunction(), | 306 return Callable(isolate->builtins()->CallFunction(mode), |
304 CallTrampolineDescriptor(isolate)); | 307 CallTrampolineDescriptor(isolate)); |
305 } | 308 } |
306 | 309 |
307 | 310 |
308 // static | 311 // static |
309 Callable CodeFactory::InterpreterPushArgsAndCall(Isolate* isolate) { | 312 Callable CodeFactory::InterpreterPushArgsAndCall(Isolate* isolate) { |
310 return Callable(isolate->builtins()->InterpreterPushArgsAndCall(), | 313 return Callable(isolate->builtins()->InterpreterPushArgsAndCall(), |
311 InterpreterPushArgsAndCallDescriptor(isolate)); | 314 InterpreterPushArgsAndCallDescriptor(isolate)); |
312 } | 315 } |
313 | 316 |
314 | 317 |
315 // static | 318 // static |
316 Callable CodeFactory::InterpreterPushArgsAndConstruct(Isolate* isolate) { | 319 Callable CodeFactory::InterpreterPushArgsAndConstruct(Isolate* isolate) { |
317 return Callable(isolate->builtins()->InterpreterPushArgsAndConstruct(), | 320 return Callable(isolate->builtins()->InterpreterPushArgsAndConstruct(), |
318 InterpreterPushArgsAndConstructDescriptor(isolate)); | 321 InterpreterPushArgsAndConstructDescriptor(isolate)); |
319 } | 322 } |
320 | 323 |
321 | 324 |
322 // static | 325 // static |
323 Callable CodeFactory::InterpreterCEntry(Isolate* isolate) { | 326 Callable CodeFactory::InterpreterCEntry(Isolate* isolate) { |
324 // TODO(rmcilroy): Deal with runtime functions that return two values. | 327 // TODO(rmcilroy): Deal with runtime functions that return two values. |
325 // Note: If we ever use fpregs in the interpreter then we will need to | 328 // Note: If we ever use fpregs in the interpreter then we will need to |
326 // save fpregs too. | 329 // save fpregs too. |
327 CEntryStub stub(isolate, 1, kDontSaveFPRegs, kArgvInRegister); | 330 CEntryStub stub(isolate, 1, kDontSaveFPRegs, kArgvInRegister); |
328 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); | 331 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); |
329 } | 332 } |
330 | 333 |
331 } // namespace internal | 334 } // namespace internal |
332 } // namespace v8 | 335 } // namespace v8 |
OLD | NEW |