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

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

Issue 1329293003: [runtime] Sanitize %NewClosure runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Ports Created 5 years, 3 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/compiler/ast-graph-builder.cc ('k') | src/compiler/js-operator.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/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 Node* projection = graph()->NewNode(common()->Projection(0), node); 484 Node* projection = graph()->NewNode(common()->Projection(0), node);
485 NodeProperties::ReplaceUses(node, projection, node, node, node); 485 NodeProperties::ReplaceUses(node, projection, node, node, node);
486 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name())); 486 node->InsertInput(zone(), 1, jsgraph()->Constant(access.name()));
487 ReplaceWithRuntimeCall(node, Runtime::kLoadLookupSlot); 487 ReplaceWithRuntimeCall(node, Runtime::kLoadLookupSlot);
488 projection->ReplaceInput(0, node); 488 projection->ReplaceInput(0, node);
489 } 489 }
490 490
491 491
492 void JSGenericLowering::LowerJSCreateClosure(Node* node) { 492 void JSGenericLowering::LowerJSCreateClosure(Node* node) {
493 CreateClosureParameters p = CreateClosureParametersOf(node->op()); 493 CreateClosureParameters p = CreateClosureParametersOf(node->op());
494 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.shared_info())); 494 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(p.shared_info()));
495 node->InsertInput(zone(), 2, jsgraph()->BooleanConstant(p.pretenure())); 495 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED)
496 ReplaceWithRuntimeCall(node, Runtime::kNewClosure); 496 ? Runtime::kNewClosure_Tenured
497 : Runtime::kNewClosure);
497 } 498 }
498 499
499 500
500 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { 501 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) {
501 int literal_flags = OpParameter<int>(node->op()); 502 int literal_flags = OpParameter<int>(node->op());
502 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(literal_flags)); 503 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(literal_flags));
503 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); 504 ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral);
504 } 505 }
505 506
506 507
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 } 825 }
825 826
826 827
827 MachineOperatorBuilder* JSGenericLowering::machine() const { 828 MachineOperatorBuilder* JSGenericLowering::machine() const {
828 return jsgraph()->machine(); 829 return jsgraph()->machine();
829 } 830 }
830 831
831 } // namespace compiler 832 } // namespace compiler
832 } // namespace internal 833 } // namespace internal
833 } // namespace v8 834 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698