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 return Callable( | 17 return Callable( |
18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), | 18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), |
19 LoadDescriptor(isolate)); | 19 LoadDescriptor(isolate)); |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 // static | 23 // static |
24 Callable CodeFactory::LoadICInOptimizedCode( | 24 Callable CodeFactory::LoadICInOptimizedCode( |
25 Isolate* isolate, ContextualMode mode, | 25 Isolate* isolate, ContextualMode mode, |
26 InlineCacheState initialization_state) { | 26 InlineCacheState initialization_state) { |
27 auto code = LoadIC::initialize_stub_in_optimized_code( | 27 auto code = LoadIC::initialize_stub_in_optimized_code( |
28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); | 28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); |
29 return Callable(code, VectorLoadICDescriptor(isolate)); | 29 return Callable(code, LoadWithVectorDescriptor(isolate)); |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 // static | 33 // static |
34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { | 34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { |
35 return Callable(KeyedLoadIC::initialize_stub(isolate), | 35 return Callable(KeyedLoadIC::initialize_stub(isolate), |
36 LoadDescriptor(isolate)); | 36 LoadDescriptor(isolate)); |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 // static | 40 // static |
41 Callable CodeFactory::KeyedLoadICInOptimizedCode( | 41 Callable CodeFactory::KeyedLoadICInOptimizedCode( |
42 Isolate* isolate, InlineCacheState initialization_state) { | 42 Isolate* isolate, InlineCacheState initialization_state) { |
43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
44 isolate, initialization_state); | 44 isolate, initialization_state); |
45 if (initialization_state != MEGAMORPHIC) { | 45 if (initialization_state != MEGAMORPHIC) { |
46 return Callable(code, VectorLoadICDescriptor(isolate)); | 46 return Callable(code, LoadWithVectorDescriptor(isolate)); |
47 } | 47 } |
48 return Callable(code, LoadDescriptor(isolate)); | 48 return Callable(code, LoadDescriptor(isolate)); |
49 } | 49 } |
50 | 50 |
51 | 51 |
52 // static | 52 // static |
53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, |
54 CallICState::CallType call_type) { | 54 CallICState::CallType call_type) { |
55 return Callable(CallIC::initialize_stub(isolate, argc, call_type), | 55 return Callable(CallIC::initialize_stub(isolate, argc, call_type), |
56 CallFunctionWithFeedbackDescriptor(isolate)); | 56 CallFunctionWithFeedbackDescriptor(isolate)); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 // static | 175 // static |
176 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, | 176 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, |
177 CallFunctionFlags flags) { | 177 CallFunctionFlags flags) { |
178 CallFunctionStub stub(isolate, argc, flags); | 178 CallFunctionStub stub(isolate, argc, flags); |
179 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 179 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
180 } | 180 } |
181 | 181 |
182 } // namespace internal | 182 } // namespace internal |
183 } // namespace v8 | 183 } // namespace v8 |
OLD | NEW |