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 // static | |
15 Callable CodeFactory::LoadGlobalIC(Isolate* isolate, | |
16 Handle<GlobalObject> global, | |
17 Handle<String> name) { | |
18 return Callable(LoadIC::load_global(isolate, global, name), | |
19 LoadDescriptor(isolate)); | |
20 } | |
21 | |
22 | 14 |
23 // static | 15 // static |
24 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode) { | 16 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode) { |
25 return Callable( | 17 return Callable( |
26 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), | 18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), |
27 LoadDescriptor(isolate)); | 19 LoadDescriptor(isolate)); |
28 } | 20 } |
29 | 21 |
30 | 22 |
31 // static | 23 // static |
32 Callable CodeFactory::LoadICInOptimizedCode( | 24 Callable CodeFactory::LoadICInOptimizedCode( |
33 Isolate* isolate, ContextualMode mode, | 25 Isolate* isolate, ContextualMode mode, |
34 InlineCacheState initialization_state) { | 26 InlineCacheState initialization_state) { |
35 auto code = LoadIC::initialize_stub_in_optimized_code( | 27 auto code = LoadIC::initialize_stub_in_optimized_code( |
36 isolate, LoadICState(mode).GetExtraICState(), initialization_state); | 28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); |
37 if (FLAG_vector_ics) { | 29 return Callable(code, VectorLoadICDescriptor(isolate)); |
38 return Callable(code, VectorLoadICDescriptor(isolate)); | |
39 } | |
40 return Callable(code, LoadDescriptor(isolate)); | |
41 } | 30 } |
42 | 31 |
43 | 32 |
44 // static | 33 // static |
45 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { | 34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { |
46 return Callable(KeyedLoadIC::initialize_stub(isolate), | 35 return Callable(KeyedLoadIC::initialize_stub(isolate), |
47 LoadDescriptor(isolate)); | 36 LoadDescriptor(isolate)); |
48 } | 37 } |
49 | 38 |
50 | 39 |
51 // static | 40 // static |
52 Callable CodeFactory::KeyedLoadICInOptimizedCode( | 41 Callable CodeFactory::KeyedLoadICInOptimizedCode( |
53 Isolate* isolate, InlineCacheState initialization_state) { | 42 Isolate* isolate, InlineCacheState initialization_state) { |
54 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( | 43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( |
55 isolate, initialization_state); | 44 isolate, initialization_state); |
56 if (FLAG_vector_ics && initialization_state != MEGAMORPHIC) { | 45 if (initialization_state != MEGAMORPHIC) { |
57 return Callable(code, VectorLoadICDescriptor(isolate)); | 46 return Callable(code, VectorLoadICDescriptor(isolate)); |
58 } | 47 } |
59 return Callable(code, LoadDescriptor(isolate)); | 48 return Callable(code, LoadDescriptor(isolate)); |
60 } | 49 } |
61 | 50 |
62 | 51 |
63 // static | 52 // static |
64 Callable CodeFactory::CallIC(Isolate* isolate, int argc, | 53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, |
65 CallICState::CallType call_type) { | 54 CallICState::CallType call_type) { |
66 return Callable(CallIC::initialize_stub(isolate, argc, call_type), | 55 return Callable(CallIC::initialize_stub(isolate, argc, call_type), |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 174 |
186 // static | 175 // static |
187 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, | 176 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, |
188 CallFunctionFlags flags) { | 177 CallFunctionFlags flags) { |
189 CallFunctionStub stub(isolate, argc, flags); | 178 CallFunctionStub stub(isolate, argc, flags); |
190 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); | 179 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); |
191 } | 180 } |
192 | 181 |
193 } // namespace internal | 182 } // namespace internal |
194 } // namespace v8 | 183 } // namespace v8 |
OLD | NEW |