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.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 21 matching lines...) Expand all Loading... |
32 void Builtins::Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { | 32 void Builtins::Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { |
33 KeyedStoreIC::GenerateMiss(masm); | 33 KeyedStoreIC::GenerateMiss(masm); |
34 } | 34 } |
35 | 35 |
36 void Builtins::Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { | 36 void Builtins::Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { |
37 ElementHandlerCompiler::GenerateStoreSlow(masm); | 37 ElementHandlerCompiler::GenerateStoreSlow(masm); |
38 } | 38 } |
39 | 39 |
40 void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) { | 40 void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) { |
41 typedef compiler::Node Node; | 41 typedef compiler::Node Node; |
| 42 typedef LoadGlobalWithVectorDescriptor Descriptor; |
42 | 43 |
43 Node* slot = assembler->Parameter(0); | 44 Node* slot = assembler->Parameter(Descriptor::kSlot); |
44 Node* vector = assembler->Parameter(1); | 45 Node* vector = assembler->Parameter(Descriptor::kVector); |
45 Node* context = assembler->Parameter(2); | 46 Node* context = assembler->Parameter(Descriptor::kContext); |
46 | 47 |
47 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot, | 48 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot, |
48 vector); | 49 vector); |
49 } | 50 } |
50 | 51 |
51 namespace { | 52 namespace { |
52 void Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler, TypeofMode mode) { | 53 void Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler, TypeofMode mode) { |
53 typedef compiler::Node Node; | 54 typedef compiler::Node Node; |
| 55 typedef LoadGlobalWithVectorDescriptor Descriptor; |
54 | 56 |
55 Node* slot = assembler->Parameter(0); | 57 Node* slot = assembler->Parameter(Descriptor::kSlot); |
56 Node* vector = assembler->Parameter(1); | 58 Node* vector = assembler->Parameter(Descriptor::kVector); |
57 Node* context = assembler->Parameter(2); | 59 Node* context = assembler->Parameter(Descriptor::kContext); |
58 Node* typeof_mode = assembler->SmiConstant(Smi::FromInt(mode)); | 60 Node* typeof_mode = assembler->SmiConstant(Smi::FromInt(mode)); |
59 | 61 |
60 assembler->TailCallRuntime(Runtime::kGetGlobal, context, slot, vector, | 62 assembler->TailCallRuntime(Runtime::kGetGlobal, context, slot, vector, |
61 typeof_mode); | 63 typeof_mode); |
62 } | 64 } |
63 } // anonymous namespace | 65 } // anonymous namespace |
64 | 66 |
65 void Builtins::Generate_LoadGlobalIC_SlowInsideTypeof( | 67 void Builtins::Generate_LoadGlobalIC_SlowInsideTypeof( |
66 CodeStubAssembler* assembler) { | 68 CodeStubAssembler* assembler) { |
67 Generate_LoadGlobalIC_Slow(assembler, INSIDE_TYPEOF); | 69 Generate_LoadGlobalIC_Slow(assembler, INSIDE_TYPEOF); |
68 } | 70 } |
69 | 71 |
70 void Builtins::Generate_LoadGlobalIC_SlowNotInsideTypeof( | 72 void Builtins::Generate_LoadGlobalIC_SlowNotInsideTypeof( |
71 CodeStubAssembler* assembler) { | 73 CodeStubAssembler* assembler) { |
72 Generate_LoadGlobalIC_Slow(assembler, NOT_INSIDE_TYPEOF); | 74 Generate_LoadGlobalIC_Slow(assembler, NOT_INSIDE_TYPEOF); |
73 } | 75 } |
74 | 76 |
75 void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { | 77 void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { |
76 NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm); | 78 NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm); |
77 } | 79 } |
78 | 80 |
79 void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) { | 81 void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) { |
80 typedef compiler::Node Node; | 82 typedef compiler::Node Node; |
| 83 typedef LoadWithVectorDescriptor Descriptor; |
81 | 84 |
82 Node* receiver = assembler->Parameter(0); | 85 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
83 Node* name = assembler->Parameter(1); | 86 Node* name = assembler->Parameter(Descriptor::kName); |
84 Node* slot = assembler->Parameter(2); | 87 Node* slot = assembler->Parameter(Descriptor::kSlot); |
85 Node* vector = assembler->Parameter(3); | 88 Node* vector = assembler->Parameter(Descriptor::kVector); |
86 Node* context = assembler->Parameter(4); | 89 Node* context = assembler->Parameter(Descriptor::kContext); |
87 | 90 |
88 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name, | 91 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name, |
89 slot, vector); | 92 slot, vector); |
90 } | 93 } |
91 | 94 |
92 void Builtins::Generate_LoadIC_Normal(MacroAssembler* masm) { | 95 void Builtins::Generate_LoadIC_Normal(MacroAssembler* masm) { |
93 LoadIC::GenerateNormal(masm); | 96 LoadIC::GenerateNormal(masm); |
94 } | 97 } |
95 | 98 |
96 void Builtins::Generate_LoadIC_Slow(CodeStubAssembler* assembler) { | 99 void Builtins::Generate_LoadIC_Slow(CodeStubAssembler* assembler) { |
97 typedef compiler::Node Node; | 100 typedef compiler::Node Node; |
| 101 typedef LoadWithVectorDescriptor Descriptor; |
98 | 102 |
99 Node* receiver = assembler->Parameter(0); | 103 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
100 Node* name = assembler->Parameter(1); | 104 Node* name = assembler->Parameter(Descriptor::kName); |
101 // Node* slot = assembler->Parameter(2); | 105 Node* context = assembler->Parameter(Descriptor::kContext); |
102 // Node* vector = assembler->Parameter(3); | |
103 Node* context = assembler->Parameter(4); | |
104 | 106 |
105 assembler->TailCallRuntime(Runtime::kGetProperty, context, receiver, name); | 107 assembler->TailCallRuntime(Runtime::kGetProperty, context, receiver, name); |
106 } | 108 } |
107 | 109 |
108 void Builtins::Generate_StoreIC_Miss(CodeStubAssembler* assembler) { | 110 void Builtins::Generate_StoreIC_Miss(CodeStubAssembler* assembler) { |
109 typedef compiler::Node Node; | 111 typedef compiler::Node Node; |
| 112 typedef StoreWithVectorDescriptor Descriptor; |
110 | 113 |
111 Node* receiver = assembler->Parameter(0); | 114 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
112 Node* name = assembler->Parameter(1); | 115 Node* name = assembler->Parameter(Descriptor::kName); |
113 Node* value = assembler->Parameter(2); | 116 Node* value = assembler->Parameter(Descriptor::kValue); |
114 Node* slot = assembler->Parameter(3); | 117 Node* slot = assembler->Parameter(Descriptor::kSlot); |
115 Node* vector = assembler->Parameter(4); | 118 Node* vector = assembler->Parameter(Descriptor::kVector); |
116 Node* context = assembler->Parameter(5); | 119 Node* context = assembler->Parameter(Descriptor::kContext); |
117 | 120 |
118 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, name, | 121 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, name, |
119 value, slot, vector); | 122 value, slot, vector); |
120 } | 123 } |
121 | 124 |
122 void Builtins::Generate_StoreIC_Normal(MacroAssembler* masm) { | 125 void Builtins::Generate_StoreIC_Normal(MacroAssembler* masm) { |
123 StoreIC::GenerateNormal(masm); | 126 StoreIC::GenerateNormal(masm); |
124 } | 127 } |
125 | 128 |
126 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { | 129 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { |
127 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); | 130 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); |
128 } | 131 } |
129 | 132 |
130 namespace { | 133 namespace { |
131 void Generate_StoreIC_Slow(CodeStubAssembler* assembler, | 134 void Generate_StoreIC_Slow(CodeStubAssembler* assembler, |
132 LanguageMode language_mode) { | 135 LanguageMode language_mode) { |
133 typedef compiler::Node Node; | 136 typedef compiler::Node Node; |
| 137 typedef StoreWithVectorDescriptor Descriptor; |
134 | 138 |
135 Node* receiver = assembler->Parameter(0); | 139 Node* receiver = assembler->Parameter(Descriptor::kReceiver); |
136 Node* name = assembler->Parameter(1); | 140 Node* name = assembler->Parameter(Descriptor::kName); |
137 Node* value = assembler->Parameter(2); | 141 Node* value = assembler->Parameter(Descriptor::kValue); |
138 // Node* slot = assembler->Parameter(3); | 142 Node* context = assembler->Parameter(Descriptor::kContext); |
139 // Node* vector = assembler->Parameter(4); | |
140 Node* context = assembler->Parameter(5); | |
141 Node* lang_mode = assembler->SmiConstant(Smi::FromInt(language_mode)); | 143 Node* lang_mode = assembler->SmiConstant(Smi::FromInt(language_mode)); |
142 | 144 |
143 // The slow case calls into the runtime to complete the store without causing | 145 // The slow case calls into the runtime to complete the store without causing |
144 // an IC miss that would otherwise cause a transition to the generic stub. | 146 // an IC miss that would otherwise cause a transition to the generic stub. |
145 assembler->TailCallRuntime(Runtime::kSetProperty, context, receiver, name, | 147 assembler->TailCallRuntime(Runtime::kSetProperty, context, receiver, name, |
146 value, lang_mode); | 148 value, lang_mode); |
147 } | 149 } |
148 } // anonymous namespace | 150 } // anonymous namespace |
149 | 151 |
150 void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) { | 152 void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) { |
151 Generate_StoreIC_Slow(assembler, SLOPPY); | 153 Generate_StoreIC_Slow(assembler, SLOPPY); |
152 } | 154 } |
153 | 155 |
154 void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) { | 156 void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) { |
155 Generate_StoreIC_Slow(assembler, STRICT); | 157 Generate_StoreIC_Slow(assembler, STRICT); |
156 } | 158 } |
157 | 159 |
158 } // namespace internal | 160 } // namespace internal |
159 } // namespace v8 | 161 } // namespace v8 |
OLD | NEW |