Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/ic/handler-compiler.cc

Issue 767743002: Hydrogen code stubs for vector-based ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch One. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ic/call-optimization.h" 7 #include "src/ic/call-optimization.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/ic-inl.h" 10 #include "src/ic/ic-inl.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Handle<Name> name, 125 Handle<Name> name,
126 Label* miss) { 126 Label* miss) {
127 return CheckPrototypes(object_reg, this->name(), scratch1(), scratch2(), name, 127 return CheckPrototypes(object_reg, this->name(), scratch1(), scratch2(), name,
128 miss, SKIP_RECEIVER); 128 miss, SKIP_RECEIVER);
129 } 129 }
130 130
131 131
132 Register PropertyHandlerCompiler::Frontend(Register object_reg, 132 Register PropertyHandlerCompiler::Frontend(Register object_reg,
133 Handle<Name> name) { 133 Handle<Name> name) {
134 Label miss; 134 Label miss;
135 if (FLAG_vector_ics &&
Jakob Kummerow 2014/12/02 08:43:07 Can we re-use IC::ICUseVector here and below?
mvstanton 2014/12/03 11:48:30 Done.
136 (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
137 if (object_reg.is(VectorLoadICDescriptor::VectorRegister())) {
138 PushVectorAndSlot(scratch2(), scratch3());
139 } else {
140 PushVectorAndSlot();
141 }
142 }
135 Register reg = FrontendHeader(object_reg, name, &miss); 143 Register reg = FrontendHeader(object_reg, name, &miss);
136 FrontendFooter(name, &miss); 144 FrontendFooter(name, &miss);
145 // The footer consumes the vector and slot from the stack if
146 // miss occurs
Jakob Kummerow 2014/12/02 08:43:07 nit: Trailing full stop.
mvstanton 2014/12/03 11:48:30 Done.
147 if (FLAG_vector_ics &&
148 (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
149 if (reg.is(VectorLoadICDescriptor::VectorRegister()) &&
150 !reg.is(object_reg)) {
Jakob Kummerow 2014/12/02 08:43:07 Uhm... you've pushed scratch2/scratch3 if object_r
mvstanton 2014/12/03 11:48:30 Okay, I've refactored this. The problem is that Fr
151 PopVectorAndSlot(scratch2(), scratch3());
152 } else {
153 DiscardVectorAndSlot();
154 }
155 }
137 return reg; 156 return reg;
138 } 157 }
139 158
140 159
141 void PropertyHandlerCompiler::NonexistentFrontendHeader(Handle<Name> name, 160 void PropertyHandlerCompiler::NonexistentFrontendHeader(Handle<Name> name,
142 Label* miss, 161 Label* miss,
143 Register scratch1, 162 Register scratch1,
144 Register scratch2) { 163 Register scratch2) {
145 Register holder_reg; 164 Register holder_reg;
146 Handle<Map> last_map; 165 Handle<Map> last_map;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 __ Move(receiver(), reg); 212 __ Move(receiver(), reg);
194 LoadConstantStub stub(isolate(), constant_index); 213 LoadConstantStub stub(isolate(), constant_index);
195 GenerateTailCall(masm(), stub.GetCode()); 214 GenerateTailCall(masm(), stub.GetCode());
196 return GetCode(kind(), Code::FAST, name); 215 return GetCode(kind(), Code::FAST, name);
197 } 216 }
198 217
199 218
200 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( 219 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
201 Handle<Name> name) { 220 Handle<Name> name) {
202 Label miss; 221 Label miss;
222 if (FLAG_vector_ics) {
223 DCHECK(kind() == Code::LOAD_IC);
224 PushVectorAndSlot();
225 }
203 NonexistentFrontendHeader(name, &miss, scratch2(), scratch3()); 226 NonexistentFrontendHeader(name, &miss, scratch2(), scratch3());
227 if (FLAG_vector_ics &&
228 (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC)) {
229 DiscardVectorAndSlot();
230 }
204 GenerateLoadConstant(isolate()->factory()->undefined_value()); 231 GenerateLoadConstant(isolate()->factory()->undefined_value());
205 FrontendFooter(name, &miss); 232 FrontendFooter(name, &miss);
206 return GetCode(kind(), Code::FAST, name); 233 return GetCode(kind(), Code::FAST, name);
207 } 234 }
208 235
209 236
210 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( 237 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
211 Handle<Name> name, Handle<ExecutableAccessorInfo> callback) { 238 Handle<Name> name, Handle<ExecutableAccessorInfo> callback) {
212 Register reg = Frontend(receiver(), name); 239 Register reg = Frontend(receiver(), name);
213 GenerateLoadCallback(reg, callback); 240 GenerateLoadCallback(reg, callback);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 DCHECK(elements_kind == DICTIONARY_ELEMENTS); 463 DCHECK(elements_kind == DICTIONARY_ELEMENTS);
437 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); 464 cached_stub = LoadDictionaryElementStub(isolate()).GetCode();
438 } 465 }
439 } 466 }
440 467
441 handlers->Add(cached_stub); 468 handlers->Add(cached_stub);
442 } 469 }
443 } 470 }
444 } 471 }
445 } // namespace v8::internal 472 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698