OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-stub-assembler.h" | |
8 #include "src/ic/accessor-assembler.h" | 7 #include "src/ic/accessor-assembler.h" |
9 | 8 |
10 namespace v8 { | 9 namespace v8 { |
11 namespace internal { | 10 namespace internal { |
12 | 11 |
13 TF_BUILTIN(LoadIC, CodeStubAssembler) { | 12 #define IC_BUILTIN(Name) \ |
14 AccessorAssembler::GenerateLoadIC(state()); | 13 void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \ |
15 } | 14 AccessorAssembler assembler(state); \ |
| 15 assembler.Generate##Name(); \ |
| 16 } |
16 | 17 |
17 TF_BUILTIN(KeyedLoadIC, CodeStubAssembler) { | 18 #define IC_BUILTIN_PARAM(BuiltinName, GeneratorName, parameter) \ |
18 AccessorAssembler::GenerateKeyedLoadICTF(state()); | 19 void Builtins::Generate_##BuiltinName(compiler::CodeAssemblerState* state) { \ |
19 } | 20 AccessorAssembler assembler(state); \ |
| 21 assembler.Generate##GeneratorName(parameter); \ |
| 22 } |
20 | 23 |
21 TF_BUILTIN(LoadICTrampoline, CodeStubAssembler) { | 24 IC_BUILTIN(LoadIC) |
22 AccessorAssembler::GenerateLoadICTrampoline(state()); | 25 IC_BUILTIN(KeyedLoadIC) |
23 } | 26 IC_BUILTIN(LoadICTrampoline) |
| 27 IC_BUILTIN(LoadField) |
| 28 IC_BUILTIN(KeyedLoadICTrampoline) |
| 29 IC_BUILTIN(KeyedLoadIC_Megamorphic) |
| 30 IC_BUILTIN(StoreIC) |
| 31 IC_BUILTIN(StoreICTrampoline) |
24 | 32 |
25 TF_BUILTIN(KeyedLoadICTrampoline, CodeStubAssembler) { | 33 IC_BUILTIN_PARAM(StoreICStrict, StoreIC, /* no param */) |
26 AccessorAssembler::GenerateKeyedLoadICTrampolineTF(state()); | 34 IC_BUILTIN_PARAM(StoreICStrictTrampoline, StoreICTrampoline, /* no param */) |
27 } | |
28 | 35 |
29 TF_BUILTIN(StoreIC, CodeStubAssembler) { | 36 IC_BUILTIN_PARAM(KeyedStoreIC, KeyedStoreIC, SLOPPY) |
30 AccessorAssembler::GenerateStoreIC(state()); | 37 IC_BUILTIN_PARAM(KeyedStoreICTrampoline, KeyedStoreICTrampoline, SLOPPY) |
31 } | 38 IC_BUILTIN_PARAM(KeyedStoreICStrict, KeyedStoreIC, STRICT) |
32 | 39 IC_BUILTIN_PARAM(KeyedStoreICStrictTrampoline, KeyedStoreICTrampoline, STRICT) |
33 TF_BUILTIN(StoreICTrampoline, CodeStubAssembler) { | 40 IC_BUILTIN_PARAM(LoadGlobalIC, LoadGlobalIC, NOT_INSIDE_TYPEOF) |
34 AccessorAssembler::GenerateStoreICTrampoline(state()); | 41 IC_BUILTIN_PARAM(LoadGlobalICInsideTypeof, LoadGlobalIC, INSIDE_TYPEOF) |
35 } | 42 IC_BUILTIN_PARAM(LoadGlobalICTrampoline, LoadGlobalICTrampoline, |
36 | 43 NOT_INSIDE_TYPEOF) |
37 TF_BUILTIN(StoreICStrict, CodeStubAssembler) { | 44 IC_BUILTIN_PARAM(LoadGlobalICInsideTypeofTrampoline, LoadGlobalICTrampoline, |
38 AccessorAssembler::GenerateStoreIC(state()); | 45 INSIDE_TYPEOF) |
39 } | 46 IC_BUILTIN_PARAM(LoadICProtoArray, LoadICProtoArray, false) |
40 | 47 IC_BUILTIN_PARAM(LoadICProtoArrayThrowIfNonexistent, LoadICProtoArray, true) |
41 TF_BUILTIN(StoreICStrictTrampoline, CodeStubAssembler) { | |
42 AccessorAssembler::GenerateStoreICTrampoline(state()); | |
43 } | |
44 | |
45 TF_BUILTIN(KeyedStoreIC, CodeStubAssembler) { | |
46 AccessorAssembler::GenerateKeyedStoreICTF(state(), SLOPPY); | |
47 } | |
48 | |
49 TF_BUILTIN(KeyedStoreICTrampoline, CodeStubAssembler) { | |
50 AccessorAssembler::GenerateKeyedStoreICTrampolineTF(state(), SLOPPY); | |
51 } | |
52 | |
53 TF_BUILTIN(KeyedStoreICStrict, CodeStubAssembler) { | |
54 AccessorAssembler::GenerateKeyedStoreICTF(state(), STRICT); | |
55 } | |
56 | |
57 TF_BUILTIN(KeyedStoreICStrictTrampoline, CodeStubAssembler) { | |
58 AccessorAssembler::GenerateKeyedStoreICTrampolineTF(state(), STRICT); | |
59 } | |
60 | |
61 TF_BUILTIN(LoadGlobalIC, CodeStubAssembler) { | |
62 AccessorAssembler::GenerateLoadGlobalIC(state(), NOT_INSIDE_TYPEOF); | |
63 } | |
64 | |
65 TF_BUILTIN(LoadGlobalICInsideTypeof, CodeStubAssembler) { | |
66 AccessorAssembler::GenerateLoadGlobalIC(state(), INSIDE_TYPEOF); | |
67 } | |
68 | |
69 TF_BUILTIN(LoadGlobalICTrampoline, CodeStubAssembler) { | |
70 AccessorAssembler::GenerateLoadGlobalICTrampoline(state(), NOT_INSIDE_TYPEOF); | |
71 } | |
72 | |
73 TF_BUILTIN(LoadGlobalICInsideTypeofTrampoline, CodeStubAssembler) { | |
74 AccessorAssembler::GenerateLoadGlobalICTrampoline(state(), INSIDE_TYPEOF); | |
75 } | |
76 | 48 |
77 } // namespace internal | 49 } // namespace internal |
78 } // namespace v8 | 50 } // namespace v8 |
OLD | NEW |