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 Handle<Code> CodeFactory::RuntimeCEntry(Isolate* isolate, int result_size) { |
| 26 CEntryStub stub(isolate, result_size); |
| 27 return stub.GetCode(); |
| 28 } |
| 29 |
| 30 // static |
25 Callable CodeFactory::LoadIC(Isolate* isolate) { | 31 Callable CodeFactory::LoadIC(Isolate* isolate) { |
26 LoadICTrampolineStub stub(isolate); | 32 LoadICTrampolineStub stub(isolate); |
27 return make_callable(stub); | 33 return make_callable(stub); |
28 } | 34 } |
29 | 35 |
30 // static | 36 // static |
31 Callable CodeFactory::ApiGetter(Isolate* isolate) { | 37 Callable CodeFactory::ApiGetter(Isolate* isolate) { |
32 CallApiGetterStub stub(isolate); | 38 CallApiGetterStub stub(isolate); |
33 return make_callable(stub); | 39 return make_callable(stub); |
34 } | 40 } |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 510 } |
505 | 511 |
506 // static | 512 // static |
507 Callable CodeFactory::FunctionPrototypeBind(Isolate* isolate) { | 513 Callable CodeFactory::FunctionPrototypeBind(Isolate* isolate) { |
508 return Callable(isolate->builtins()->FunctionPrototypeBind(), | 514 return Callable(isolate->builtins()->FunctionPrototypeBind(), |
509 BuiltinDescriptor(isolate)); | 515 BuiltinDescriptor(isolate)); |
510 } | 516 } |
511 | 517 |
512 } // namespace internal | 518 } // namespace internal |
513 } // namespace v8 | 519 } // namespace v8 |
OLD | NEW |