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 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 | 13 |
14 // static | 14 // static |
15 Callable CodeFactory::LoadIC(Isolate* isolate, TypeofMode typeof_mode, | 15 Callable CodeFactory::LoadIC(Isolate* isolate, TypeofMode typeof_mode) { |
16 LanguageMode language_mode) { | 16 return Callable(LoadIC::initialize_stub( |
17 return Callable( | 17 isolate, LoadICState(typeof_mode).GetExtraICState()), |
18 LoadIC::initialize_stub( | 18 LoadDescriptor(isolate)); |
19 isolate, LoadICState(typeof_mode, language_mode).GetExtraICState()), | |
20 LoadDescriptor(isolate)); | |
21 } | 19 } |
22 | 20 |
23 | 21 |
24 // static | 22 // static |
25 Callable CodeFactory::LoadICInOptimizedCode( | 23 Callable CodeFactory::LoadICInOptimizedCode( |
26 Isolate* isolate, TypeofMode typeof_mode, LanguageMode language_mode, | 24 Isolate* isolate, TypeofMode typeof_mode, |
27 InlineCacheState initialization_state) { | 25 InlineCacheState initialization_state) { |
28 auto code = LoadIC::initialize_stub_in_optimized_code( | 26 auto code = LoadIC::initialize_stub_in_optimized_code( |
29 isolate, LoadICState(typeof_mode, language_mode).GetExtraICState(), | 27 isolate, LoadICState(typeof_mode).GetExtraICState(), |
30 initialization_state); | 28 initialization_state); |
31 return Callable(code, LoadWithVectorDescriptor(isolate)); | 29 return Callable(code, LoadWithVectorDescriptor(isolate)); |
32 } | 30 } |
33 | 31 |
34 | 32 |
35 // static | 33 // static |
36 Callable CodeFactory::KeyedLoadIC(Isolate* isolate, | 34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { |
37 LanguageMode language_mode) { | 35 return Callable(KeyedLoadIC::initialize_stub(isolate, kNoExtraICState), |
38 ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState | |
39 : kNoExtraICState; | |
40 return Callable(KeyedLoadIC::initialize_stub(isolate, state), | |
41 LoadDescriptor(isolate)); | 36 LoadDescriptor(isolate)); |
42 } | 37 } |
43 | 38 |
44 | 39 |
45 // static | 40 // static |
46 Callable CodeFactory::KeyedLoadICInOptimizedCode( | 41 Callable CodeFactory::KeyedLoadICInOptimizedCode( |
47 Isolate* isolate, LanguageMode language_mode, | 42 Isolate* isolate, InlineCacheState initialization_state) { |
48 InlineCacheState initialization_state) { | |
49 ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState | |
50 : kNoExtraICState; | |
51 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
52 isolate, initialization_state, state); | 44 isolate, initialization_state, kNoExtraICState); |
53 if (initialization_state != MEGAMORPHIC) { | 45 if (initialization_state != MEGAMORPHIC) { |
54 return Callable(code, LoadWithVectorDescriptor(isolate)); | 46 return Callable(code, LoadWithVectorDescriptor(isolate)); |
55 } | 47 } |
56 return Callable(code, LoadDescriptor(isolate)); | 48 return Callable(code, LoadDescriptor(isolate)); |
57 } | 49 } |
58 | 50 |
59 | 51 |
60 // static | 52 // static |
61 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, |
62 ConvertReceiverMode mode, | 54 ConvertReceiverMode mode, |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // static | 363 // static |
372 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { | 364 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { |
373 // Note: If we ever use fpregs in the interpreter then we will need to | 365 // Note: If we ever use fpregs in the interpreter then we will need to |
374 // save fpregs too. | 366 // save fpregs too. |
375 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); | 367 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); |
376 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); | 368 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); |
377 } | 369 } |
378 | 370 |
379 } // namespace internal | 371 } // namespace internal |
380 } // namespace v8 | 372 } // namespace v8 |
OLD | NEW |