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 namespace { | 13 namespace { |
14 | 14 |
15 // TODO(ishell): make it (const Stub& stub) once CodeStub::GetCode() is const. | 15 // TODO(ishell): make it (const Stub& stub) once CodeStub::GetCode() is const. |
16 template <typename Stub> | 16 template <typename Stub> |
17 Callable make_callable(Stub& stub) { | 17 Callable make_callable(Stub& stub) { |
18 typedef typename Stub::Descriptor Descriptor; | 18 typedef typename Stub::Descriptor Descriptor; |
19 return Callable(stub.GetCode(), Descriptor(stub.isolate())); | 19 return Callable(stub.GetCode(), Descriptor(stub.isolate())); |
20 } | 20 } |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 // static | 24 // static |
25 Callable CodeFactory::LoadIC(Isolate* isolate) { | 25 Callable CodeFactory::LoadIC(Isolate* isolate) { |
26 if (FLAG_tf_load_ic_stub) { | 26 LoadICTrampolineTFStub stub(isolate); |
27 LoadICTrampolineTFStub stub(isolate); | |
28 return make_callable(stub); | |
29 } | |
30 LoadICTrampolineStub stub(isolate); | |
31 return make_callable(stub); | 27 return make_callable(stub); |
32 } | 28 } |
33 | 29 |
34 // static | 30 // static |
35 Callable CodeFactory::ApiGetter(Isolate* isolate) { | 31 Callable CodeFactory::ApiGetter(Isolate* isolate) { |
36 CallApiGetterStub stub(isolate); | 32 CallApiGetterStub stub(isolate); |
37 return make_callable(stub); | 33 return make_callable(stub); |
38 } | 34 } |
39 | 35 |
40 // static | 36 // static |
41 Callable CodeFactory::LoadICInOptimizedCode(Isolate* isolate) { | 37 Callable CodeFactory::LoadICInOptimizedCode(Isolate* isolate) { |
42 if (FLAG_tf_load_ic_stub) { | 38 LoadICTFStub stub(isolate); |
43 LoadICTFStub stub(isolate); | |
44 return make_callable(stub); | |
45 } | |
46 LoadICStub stub(isolate); | |
47 return make_callable(stub); | 39 return make_callable(stub); |
48 } | 40 } |
49 | 41 |
50 // static | 42 // static |
51 Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) { | 43 Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) { |
52 LoadGlobalICTrampolineStub stub(isolate, LoadGlobalICState(typeof_mode)); | 44 LoadGlobalICTrampolineStub stub(isolate, LoadGlobalICState(typeof_mode)); |
53 return make_callable(stub); | 45 return make_callable(stub); |
54 } | 46 } |
55 | 47 |
56 // static | 48 // static |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 498 } |
507 | 499 |
508 // static | 500 // static |
509 Callable CodeFactory::InterpreterOnStackReplacement(Isolate* isolate) { | 501 Callable CodeFactory::InterpreterOnStackReplacement(Isolate* isolate) { |
510 return Callable(isolate->builtins()->InterpreterOnStackReplacement(), | 502 return Callable(isolate->builtins()->InterpreterOnStackReplacement(), |
511 ContextOnlyDescriptor(isolate)); | 503 ContextOnlyDescriptor(isolate)); |
512 } | 504 } |
513 | 505 |
514 } // namespace internal | 506 } // namespace internal |
515 } // namespace v8 | 507 } // namespace v8 |
OLD | NEW |