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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1156323004: Version 4.2.77.21 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.2
Patch Set: Created 5 years, 6 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/ast.cc ('k') | src/full-codegen.h » ('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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 1457
1458 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { 1458 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
1459 Node* closure = GetFunctionClosure(); 1459 Node* closure = GetFunctionClosure();
1460 1460
1461 // Create node to deep-copy the literal boilerplate. 1461 // Create node to deep-copy the literal boilerplate.
1462 expr->BuildConstantProperties(isolate()); 1462 expr->BuildConstantProperties(isolate());
1463 Node* literals_array = 1463 Node* literals_array =
1464 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); 1464 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset);
1465 Node* literal_index = jsgraph()->Constant(expr->literal_index()); 1465 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1466 Node* constants = jsgraph()->Constant(expr->constant_properties()); 1466 Node* constants = jsgraph()->Constant(expr->constant_properties());
1467 Node* flags = jsgraph()->Constant(expr->ComputeFlags()); 1467 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true));
1468 const Operator* op = 1468 const Operator* op =
1469 javascript()->CallRuntime(Runtime::kCreateObjectLiteral, 4); 1469 javascript()->CallRuntime(Runtime::kCreateObjectLiteral, 4);
1470 Node* literal = NewNode(op, literals_array, literal_index, constants, flags); 1470 Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
1471 PrepareFrameState(literal, expr->CreateLiteralId(), 1471 PrepareFrameState(literal, expr->CreateLiteralId(),
1472 OutputFrameStateCombine::Push()); 1472 OutputFrameStateCombine::Push());
1473 1473
1474 // The object is expected on the operand stack during computation of the 1474 // The object is expected on the operand stack during computation of the
1475 // property values and is the value of the entire expression. 1475 // property values and is the value of the entire expression.
1476 environment()->Push(literal); 1476 environment()->Push(literal);
1477 1477
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 1649
1650 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { 1650 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
1651 Node* closure = GetFunctionClosure(); 1651 Node* closure = GetFunctionClosure();
1652 1652
1653 // Create node to deep-copy the literal boilerplate. 1653 // Create node to deep-copy the literal boilerplate.
1654 expr->BuildConstantElements(isolate()); 1654 expr->BuildConstantElements(isolate());
1655 Node* literals_array = 1655 Node* literals_array =
1656 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); 1656 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset);
1657 Node* literal_index = jsgraph()->Constant(expr->literal_index()); 1657 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1658 Node* constants = jsgraph()->Constant(expr->constant_elements()); 1658 Node* constants = jsgraph()->Constant(expr->constant_elements());
1659 Node* flags = jsgraph()->Constant(expr->ComputeFlags()); 1659 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true));
1660 const Operator* op = 1660 const Operator* op =
1661 javascript()->CallRuntime(Runtime::kCreateArrayLiteral, 4); 1661 javascript()->CallRuntime(Runtime::kCreateArrayLiteral, 4);
1662 Node* literal = NewNode(op, literals_array, literal_index, constants, flags); 1662 Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
1663 PrepareFrameState(literal, expr->CreateLiteralId(), 1663 PrepareFrameState(literal, expr->CreateLiteralId(),
1664 OutputFrameStateCombine::Push()); 1664 OutputFrameStateCombine::Push());
1665 1665
1666 // The array and the literal index are both expected on the operand stack 1666 // The array and the literal index are both expected on the operand stack
1667 // during computation of the element values. 1667 // during computation of the element values.
1668 environment()->Push(literal); 1668 environment()->Push(literal);
1669 environment()->Push(literal_index); 1669 environment()->Push(literal_index);
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
3208 // Phi does not exist yet, introduce one. 3208 // Phi does not exist yet, introduce one.
3209 value = NewPhi(inputs, value, control); 3209 value = NewPhi(inputs, value, control);
3210 value->ReplaceInput(inputs - 1, other); 3210 value->ReplaceInput(inputs - 1, other);
3211 } 3211 }
3212 return value; 3212 return value;
3213 } 3213 }
3214 3214
3215 } // namespace compiler 3215 } // namespace compiler
3216 } // namespace internal 3216 } // namespace internal
3217 } // namespace v8 3217 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698