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 | 13 |
14 // static | 14 // static |
15 Callable CodeFactory::LoadIC(Isolate* isolate) { | 15 Callable CodeFactory::LoadIC(Isolate* isolate) { |
16 if (FLAG_tf_load_ic_stub) { | 16 if (FLAG_tf_load_ic_stub) { |
17 LoadICTrampolineTFStub stub(isolate, LoadICState(NOT_INSIDE_TYPEOF)); | 17 LoadICTrampolineTFStub stub(isolate); |
18 return Callable(stub.GetCode(), LoadDescriptor(isolate)); | 18 return Callable(stub.GetCode(), LoadDescriptor(isolate)); |
19 } | 19 } |
20 LoadICTrampolineStub stub(isolate, LoadICState(NOT_INSIDE_TYPEOF)); | 20 LoadICTrampolineStub stub(isolate); |
21 return Callable(stub.GetCode(), LoadDescriptor(isolate)); | 21 return Callable(stub.GetCode(), LoadDescriptor(isolate)); |
22 } | 22 } |
23 | 23 |
24 // static | 24 // static |
25 Callable CodeFactory::ApiGetter(Isolate* isolate) { | 25 Callable CodeFactory::ApiGetter(Isolate* isolate) { |
26 CallApiGetterStub stub(isolate); | 26 CallApiGetterStub stub(isolate); |
27 return Callable(stub.GetCode(), ApiGetterDescriptor(isolate)); | 27 return Callable(stub.GetCode(), ApiGetterDescriptor(isolate)); |
28 } | 28 } |
29 | 29 |
30 // static | 30 // static |
31 Callable CodeFactory::LoadICInOptimizedCode(Isolate* isolate) { | 31 Callable CodeFactory::LoadICInOptimizedCode(Isolate* isolate) { |
32 auto code = LoadIC::initialize_stub_in_optimized_code( | 32 auto code = LoadIC::initialize_stub_in_optimized_code(isolate); |
33 isolate, LoadICState(NOT_INSIDE_TYPEOF).GetExtraICState()); | |
34 return Callable(code, LoadWithVectorDescriptor(isolate)); | 33 return Callable(code, LoadWithVectorDescriptor(isolate)); |
35 } | 34 } |
36 | 35 |
37 // static | 36 // static |
38 Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) { | 37 Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) { |
39 LoadGlobalICTrampolineStub stub(isolate, LoadICState(typeof_mode)); | 38 LoadGlobalICTrampolineStub stub(isolate, LoadGlobalICState(typeof_mode)); |
40 return Callable(stub.GetCode(), LoadDescriptor(isolate)); | 39 return Callable(stub.GetCode(), LoadDescriptor(isolate)); |
41 } | 40 } |
42 | 41 |
43 // static | 42 // static |
44 Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate, | 43 Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate, |
45 TypeofMode typeof_mode) { | 44 TypeofMode typeof_mode) { |
46 auto code = LoadGlobalIC::initialize_stub_in_optimized_code( | 45 auto code = LoadGlobalIC::initialize_stub_in_optimized_code( |
47 isolate, LoadICState(typeof_mode).GetExtraICState()); | 46 isolate, LoadGlobalICState(typeof_mode).GetExtraICState()); |
48 return Callable(code, LoadWithVectorDescriptor(isolate)); | 47 return Callable(code, LoadWithVectorDescriptor(isolate)); |
49 } | 48 } |
50 | 49 |
51 // static | 50 // static |
52 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { | 51 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { |
53 KeyedLoadICTrampolineStub stub(isolate, LoadICState(kNoExtraICState)); | 52 KeyedLoadICTrampolineStub stub(isolate); |
54 return Callable(stub.GetCode(), LoadDescriptor(isolate)); | 53 return Callable(stub.GetCode(), LoadDescriptor(isolate)); |
55 } | 54 } |
56 | 55 |
57 | 56 |
58 // static | 57 // static |
59 Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) { | 58 Callable CodeFactory::KeyedLoadICInOptimizedCode(Isolate* isolate) { |
60 auto code = | 59 auto code = |
61 KeyedLoadIC::initialize_stub_in_optimized_code(isolate, kNoExtraICState); | 60 KeyedLoadIC::initialize_stub_in_optimized_code(isolate, kNoExtraICState); |
62 return Callable(code, LoadWithVectorDescriptor(isolate)); | 61 return Callable(code, LoadWithVectorDescriptor(isolate)); |
63 } | 62 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 // static | 573 // static |
575 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { | 574 Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { |
576 // Note: If we ever use fpregs in the interpreter then we will need to | 575 // Note: If we ever use fpregs in the interpreter then we will need to |
577 // save fpregs too. | 576 // save fpregs too. |
578 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); | 577 CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); |
579 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); | 578 return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); |
580 } | 579 } |
581 | 580 |
582 } // namespace internal | 581 } // namespace internal |
583 } // namespace v8 | 582 } // namespace v8 |
OLD | NEW |