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) { |
17 return Callable( | 18 return Callable( |
18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), | 19 LoadIC::initialize_stub( |
| 20 isolate, LoadICState(mode, language_mode).GetExtraICState()), |
19 LoadDescriptor(isolate)); | 21 LoadDescriptor(isolate)); |
20 } | 22 } |
21 | 23 |
22 | 24 |
23 // static | 25 // static |
24 Callable CodeFactory::LoadICInOptimizedCode( | 26 Callable CodeFactory::LoadICInOptimizedCode( |
25 Isolate* isolate, ContextualMode mode, | 27 Isolate* isolate, ContextualMode mode, LanguageMode language_mode, |
26 InlineCacheState initialization_state) { | 28 InlineCacheState initialization_state) { |
27 auto code = LoadIC::initialize_stub_in_optimized_code( | 29 auto code = LoadIC::initialize_stub_in_optimized_code( |
28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); | 30 isolate, LoadICState(mode, language_mode).GetExtraICState(), |
| 31 initialization_state); |
29 return Callable(code, LoadWithVectorDescriptor(isolate)); | 32 return Callable(code, LoadWithVectorDescriptor(isolate)); |
30 } | 33 } |
31 | 34 |
32 | 35 |
33 // static | 36 // static |
34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { | 37 Callable CodeFactory::KeyedLoadIC(Isolate* isolate, |
35 return Callable(KeyedLoadIC::initialize_stub(isolate), | 38 LanguageMode language_mode) { |
| 39 ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState |
| 40 : kNoExtraICState; |
| 41 return Callable(KeyedLoadIC::initialize_stub(isolate, state), |
36 LoadDescriptor(isolate)); | 42 LoadDescriptor(isolate)); |
37 } | 43 } |
38 | 44 |
39 | 45 |
40 // static | 46 // static |
41 Callable CodeFactory::KeyedLoadICInOptimizedCode( | 47 Callable CodeFactory::KeyedLoadICInOptimizedCode( |
42 Isolate* isolate, InlineCacheState initialization_state) { | 48 Isolate* isolate, LanguageMode language_mode, |
| 49 InlineCacheState initialization_state) { |
| 50 ExtraICState state = is_strong(language_mode) ? LoadICState::kStrongModeState |
| 51 : kNoExtraICState; |
43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 52 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
44 isolate, initialization_state); | 53 isolate, initialization_state, state); |
45 if (initialization_state != MEGAMORPHIC) { | 54 if (initialization_state != MEGAMORPHIC) { |
46 return Callable(code, LoadWithVectorDescriptor(isolate)); | 55 return Callable(code, LoadWithVectorDescriptor(isolate)); |
47 } | 56 } |
48 return Callable(code, LoadDescriptor(isolate)); | 57 return Callable(code, LoadDescriptor(isolate)); |
49 } | 58 } |
50 | 59 |
51 | 60 |
52 // static | 61 // static |
53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 62 Callable CodeFactory::CallIC(Isolate* isolate, int argc, |
54 CallICState::CallType call_type) { | 63 CallICState::CallType call_type) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 210 |
202 // static | 211 // static |
203 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, | 212 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, |
204 CallFunctionFlags flags) { | 213 CallFunctionFlags flags) { |
205 CallFunctionStub stub(isolate, argc, flags); | 214 CallFunctionStub stub(isolate, argc, flags); |
206 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 215 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
207 } | 216 } |
208 | 217 |
209 } // namespace internal | 218 } // namespace internal |
210 } // namespace v8 | 219 } // namespace v8 |
OLD | NEW |