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/compiler/js-generic-lowering.cc

Issue 620803003: [turbofan] Add control input to Load and LoadElements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/js-typed-lowering.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/graph-inl.h" 8 #include "src/compiler/graph-inl.h"
9 #include "src/compiler/js-generic-lowering.h" 9 #include "src/compiler/js-generic-lowering.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 CallDescriptor* desc = 324 CallDescriptor* desc =
325 linkage()->GetStubCallDescriptor(d, 0, FlagsForNode(node)); 325 linkage()->GetStubCallDescriptor(d, 0, FlagsForNode(node));
326 Node* stub_code = CodeConstant(stub.GetCode()); 326 Node* stub_code = CodeConstant(stub.GetCode());
327 PatchInsertInput(node, 0, stub_code); 327 PatchInsertInput(node, 0, stub_code);
328 PatchOperator(node, common()->Call(desc)); 328 PatchOperator(node, common()->Call(desc));
329 } 329 }
330 330
331 331
332 void JSGenericLowering::LowerJSLoadContext(Node* node) { 332 void JSGenericLowering::LowerJSLoadContext(Node* node) {
333 const ContextAccess& access = ContextAccessOf(node->op()); 333 const ContextAccess& access = ContextAccessOf(node->op());
334 // TODO(mstarzinger): Use simplified operators instead of machine operators
335 // here so that load/store optimization can be applied afterwards.
336 for (size_t i = 0; i < access.depth(); ++i) { 334 for (size_t i = 0; i < access.depth(); ++i) {
337 node->ReplaceInput( 335 node->ReplaceInput(
338 0, graph()->NewNode( 336 0, graph()->NewNode(
339 machine()->Load(kMachAnyTagged), 337 machine()->Load(kMachAnyTagged),
340 NodeProperties::GetValueInput(node, 0), 338 NodeProperties::GetValueInput(node, 0),
341 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), 339 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)),
342 NodeProperties::GetEffectInput(node))); 340 NodeProperties::GetEffectInput(node), graph()->start()));
343 } 341 }
344 node->ReplaceInput( 342 node->ReplaceInput(
345 1, Int32Constant(Context::SlotOffset(static_cast<int>(access.index())))); 343 1, Int32Constant(Context::SlotOffset(static_cast<int>(access.index()))));
344 node->AppendInput(zone(), graph()->start());
346 PatchOperator(node, machine()->Load(kMachAnyTagged)); 345 PatchOperator(node, machine()->Load(kMachAnyTagged));
347 } 346 }
348 347
349 348
350 void JSGenericLowering::LowerJSStoreContext(Node* node) { 349 void JSGenericLowering::LowerJSStoreContext(Node* node) {
351 const ContextAccess& access = ContextAccessOf(node->op()); 350 const ContextAccess& access = ContextAccessOf(node->op());
352 // TODO(mstarzinger): Use simplified operators instead of machine operators
353 // here so that load/store optimization can be applied afterwards.
354 for (size_t i = 0; i < access.depth(); ++i) { 351 for (size_t i = 0; i < access.depth(); ++i) {
355 node->ReplaceInput( 352 node->ReplaceInput(
356 0, graph()->NewNode( 353 0, graph()->NewNode(
357 machine()->Load(kMachAnyTagged), 354 machine()->Load(kMachAnyTagged),
358 NodeProperties::GetValueInput(node, 0), 355 NodeProperties::GetValueInput(node, 0),
359 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)), 356 Int32Constant(Context::SlotOffset(Context::PREVIOUS_INDEX)),
360 NodeProperties::GetEffectInput(node))); 357 NodeProperties::GetEffectInput(node), graph()->start()));
361 } 358 }
362 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1)); 359 node->ReplaceInput(2, NodeProperties::GetValueInput(node, 1));
363 node->ReplaceInput( 360 node->ReplaceInput(
364 1, Int32Constant(Context::SlotOffset(static_cast<int>(access.index())))); 361 1, Int32Constant(Context::SlotOffset(static_cast<int>(access.index()))));
365 PatchOperator(node, machine()->Store(StoreRepresentation(kMachAnyTagged, 362 PatchOperator(node, machine()->Store(StoreRepresentation(kMachAnyTagged,
366 kFullWriteBarrier))); 363 kFullWriteBarrier)));
367 } 364 }
368 365
369 366
370 void JSGenericLowering::LowerJSCallConstruct(Node* node) { 367 void JSGenericLowering::LowerJSCallConstruct(Node* node) {
(...skipping 25 matching lines...) Expand all
396 393
397 394
398 void JSGenericLowering::LowerJSCallRuntime(Node* node) { 395 void JSGenericLowering::LowerJSCallRuntime(Node* node) {
399 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); 396 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op());
400 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); 397 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity()));
401 } 398 }
402 399
403 } // namespace compiler 400 } // namespace compiler
404 } // namespace internal 401 } // namespace internal
405 } // namespace v8 402 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698