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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 | 14 |
15 // static | 15 // static |
16 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode, | 16 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode) { |
17 LanguageMode language_mode) { | |
18 return Callable( | 17 return Callable( |
19 LoadIC::initialize_stub( | 18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), |
20 isolate, LoadICState(mode, language_mode).GetExtraICState()), | |
21 LoadDescriptor(isolate)); | 19 LoadDescriptor(isolate)); |
22 } | 20 } |
23 | 21 |
24 | 22 |
25 // static | 23 // static |
26 Callable CodeFactory::LoadICInOptimizedCode( | 24 Callable CodeFactory::LoadICInOptimizedCode( |
27 Isolate* isolate, ContextualMode mode, LanguageMode language_mode, | 25 Isolate* isolate, ContextualMode mode, |
28 InlineCacheState initialization_state) { | 26 InlineCacheState initialization_state) { |
29 auto code = LoadIC::initialize_stub_in_optimized_code( | 27 auto code = LoadIC::initialize_stub_in_optimized_code( |
30 isolate, LoadICState(mode, language_mode).GetExtraICState(), | 28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); |
31 initialization_state); | |
32 return Callable(code, LoadWithVectorDescriptor(isolate)); | 29 return Callable(code, LoadWithVectorDescriptor(isolate)); |
33 } | 30 } |
34 | 31 |
35 | 32 |
36 // static | 33 // static |
37 Callable CodeFactory::KeyedLoadIC(Isolate* isolate, | 34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { |
38 LanguageMode language_mode) { | 35 return Callable(KeyedLoadIC::initialize_stub(isolate), |
39 ExtraICState state = | |
40 is_strong(language_mode) ? LoadICState::kStrongModeState : 0; | |
41 return Callable(KeyedLoadIC::initialize_stub(isolate, state), | |
42 LoadDescriptor(isolate)); | 36 LoadDescriptor(isolate)); |
43 } | 37 } |
44 | 38 |
45 | 39 |
46 // static | 40 // static |
47 Callable CodeFactory::KeyedLoadICInOptimizedCode( | 41 Callable CodeFactory::KeyedLoadICInOptimizedCode( |
48 Isolate* isolate, LanguageMode language_mode, | 42 Isolate* isolate, InlineCacheState initialization_state) { |
49 InlineCacheState initialization_state) { | |
50 ExtraICState state = | |
51 is_strong(language_mode) ? LoadICState::kStrongModeState : 0; | |
52 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
53 isolate, initialization_state, state); | 44 isolate, initialization_state); |
54 if (initialization_state != MEGAMORPHIC) { | 45 if (initialization_state != MEGAMORPHIC) { |
55 return Callable(code, LoadWithVectorDescriptor(isolate)); | 46 return Callable(code, LoadWithVectorDescriptor(isolate)); |
56 } | 47 } |
57 return Callable(code, LoadDescriptor(isolate)); | 48 return Callable(code, LoadDescriptor(isolate)); |
58 } | 49 } |
59 | 50 |
60 | 51 |
61 // static | 52 // static |
62 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, |
63 CallICState::CallType call_type) { | 54 CallICState::CallType call_type) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 173 |
183 // static | 174 // static |
184 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, | 175 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, |
185 CallFunctionFlags flags) { | 176 CallFunctionFlags flags) { |
186 CallFunctionStub stub(isolate, argc, flags); | 177 CallFunctionStub stub(isolate, argc, flags); |
187 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 178 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
188 } | 179 } |
189 | 180 |
190 } // namespace internal | 181 } // namespace internal |
191 } // namespace v8 | 182 } // namespace v8 |
OLD | NEW |