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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 945313003: emit premonomorphic ics for keyed loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « src/code-factory.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-generic-lowering.h" 8 #include "src/compiler/js-generic-lowering.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 286
287 void JSGenericLowering::LowerJSToObject(Node* node) { 287 void JSGenericLowering::LowerJSToObject(Node* node) {
288 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1); 288 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1);
289 } 289 }
290 290
291 291
292 void JSGenericLowering::LowerJSLoadProperty(Node* node) { 292 void JSGenericLowering::LowerJSLoadProperty(Node* node) {
293 const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op()); 293 const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op());
294 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); 294 Callable callable =
295 CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED);
295 if (FLAG_vector_ics) { 296 if (FLAG_vector_ics) {
296 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); 297 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
297 node->InsertInput(zone(), 3, 298 node->InsertInput(zone(), 3,
298 jsgraph()->HeapConstant(p.feedback().vector())); 299 jsgraph()->HeapConstant(p.feedback().vector()));
299 } 300 }
300 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); 301 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
301 } 302 }
302 303
303 304
304 void JSGenericLowering::LowerJSLoadNamed(Node* node) { 305 void JSGenericLowering::LowerJSLoadNamed(Node* node) {
305 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); 306 const LoadNamedParameters& p = LoadNamedParametersOf(node->op());
306 Callable callable = CodeFactory::LoadICInOptimizedCode( 307 Callable callable = CodeFactory::LoadICInOptimizedCode(
307 isolate(), p.contextual_mode(), UNINITIALIZED); 308 isolate(), p.contextual_mode(), UNINITIALIZED);
308 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); 309 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
309 if (FLAG_vector_ics) { 310 if (FLAG_vector_ics) {
310 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); 311 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
311 node->InsertInput(zone(), 3, 312 node->InsertInput(zone(), 3,
312 jsgraph()->HeapConstant(p.feedback().vector())); 313 jsgraph()->HeapConstant(p.feedback().vector()));
313 } 314 }
314 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); 315 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
315 } 316 }
316 317
317 318
318 void JSGenericLowering::LowerJSStoreProperty(Node* node) { 319 void JSGenericLowering::LowerJSStoreProperty(Node* node) {
319 LanguageMode language_mode = OpParameter<LanguageMode>(node); 320 LanguageMode language_mode = OpParameter<LanguageMode>(node);
320 Callable callable = CodeFactory::KeyedStoreIC(isolate(), language_mode); 321 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode(
322 isolate(), language_mode, UNINITIALIZED);
321 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); 323 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
322 } 324 }
323 325
324 326
325 void JSGenericLowering::LowerJSStoreNamed(Node* node) { 327 void JSGenericLowering::LowerJSStoreNamed(Node* node) {
326 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); 328 const StoreNamedParameters& p = StoreNamedParametersOf(node->op());
327 Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); 329 Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode());
328 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); 330 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
329 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); 331 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite);
330 } 332 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 476
475 477
476 void JSGenericLowering::LowerJSCallRuntime(Node* node) { 478 void JSGenericLowering::LowerJSCallRuntime(Node* node) {
477 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); 479 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op());
478 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); 480 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity()));
479 } 481 }
480 482
481 } // namespace compiler 483 } // namespace compiler
482 } // namespace internal 484 } // namespace internal
483 } // namespace v8 485 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698