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

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

Issue 1097963002: [turbofan] Use FastCloneShallow[Array|Object]Stub if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 8 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/compiler/js-intrinsic-lowering.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/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 Node* closure = GetFunctionClosure(); 1623 Node* closure = GetFunctionClosure();
1624 1624
1625 // Create node to deep-copy the literal boilerplate. 1625 // Create node to deep-copy the literal boilerplate.
1626 expr->BuildConstantProperties(isolate()); 1626 expr->BuildConstantProperties(isolate());
1627 Node* literals_array = 1627 Node* literals_array =
1628 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); 1628 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset);
1629 Node* literal_index = jsgraph()->Constant(expr->literal_index()); 1629 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1630 Node* constants = jsgraph()->Constant(expr->constant_properties()); 1630 Node* constants = jsgraph()->Constant(expr->constant_properties());
1631 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true)); 1631 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true));
1632 const Operator* op = 1632 const Operator* op =
1633 javascript()->CallRuntime(Runtime::kCreateObjectLiteral, 4); 1633 javascript()->CallRuntime(Runtime::kInlineCreateObjectLiteral, 4);
1634 Node* literal = NewNode(op, literals_array, literal_index, constants, flags); 1634 Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
1635 PrepareFrameState(literal, expr->CreateLiteralId(), 1635 PrepareFrameState(literal, expr->CreateLiteralId(),
1636 OutputFrameStateCombine::Push()); 1636 OutputFrameStateCombine::Push());
1637 1637
1638 // The object is expected on the operand stack during computation of the 1638 // The object is expected on the operand stack during computation of the
1639 // property values and is the value of the entire expression. 1639 // property values and is the value of the entire expression.
1640 environment()->Push(literal); 1640 environment()->Push(literal);
1641 1641
1642 // Mark all computed expressions that are bound to a key that is shadowed by 1642 // Mark all computed expressions that are bound to a key that is shadowed by
1643 // a later occurrence of the same key. For the marked expressions, no store 1643 // a later occurrence of the same key. For the marked expressions, no store
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 Node* closure = GetFunctionClosure(); 1815 Node* closure = GetFunctionClosure();
1816 1816
1817 // Create node to deep-copy the literal boilerplate. 1817 // Create node to deep-copy the literal boilerplate.
1818 expr->BuildConstantElements(isolate()); 1818 expr->BuildConstantElements(isolate());
1819 Node* literals_array = 1819 Node* literals_array =
1820 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); 1820 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset);
1821 Node* literal_index = jsgraph()->Constant(expr->literal_index()); 1821 Node* literal_index = jsgraph()->Constant(expr->literal_index());
1822 Node* constants = jsgraph()->Constant(expr->constant_elements()); 1822 Node* constants = jsgraph()->Constant(expr->constant_elements());
1823 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true)); 1823 Node* flags = jsgraph()->Constant(expr->ComputeFlags(true));
1824 const Operator* op = 1824 const Operator* op =
1825 javascript()->CallRuntime(Runtime::kCreateArrayLiteral, 4); 1825 javascript()->CallRuntime(Runtime::kInlineCreateArrayLiteral, 4);
1826 Node* literal = NewNode(op, literals_array, literal_index, constants, flags); 1826 Node* literal = NewNode(op, literals_array, literal_index, constants, flags);
1827 PrepareFrameState(literal, expr->CreateLiteralId(), 1827 PrepareFrameState(literal, expr->CreateLiteralId(),
1828 OutputFrameStateCombine::Push()); 1828 OutputFrameStateCombine::Push());
1829 1829
1830 // The array and the literal index are both expected on the operand stack 1830 // The array and the literal index are both expected on the operand stack
1831 // during computation of the element values. 1831 // during computation of the element values.
1832 environment()->Push(literal); 1832 environment()->Push(literal);
1833 environment()->Push(literal_index); 1833 environment()->Push(literal_index);
1834 1834
1835 // Create nodes to evaluate all the non-constant subexpressions and to store 1835 // Create nodes to evaluate all the non-constant subexpressions and to store
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
3550 // Phi does not exist yet, introduce one. 3550 // Phi does not exist yet, introduce one.
3551 value = NewPhi(inputs, value, control); 3551 value = NewPhi(inputs, value, control);
3552 value->ReplaceInput(inputs - 1, other); 3552 value->ReplaceInput(inputs - 1, other);
3553 } 3553 }
3554 return value; 3554 return value;
3555 } 3555 }
3556 3556
3557 } // namespace compiler 3557 } // namespace compiler
3558 } // namespace internal 3558 } // namespace internal
3559 } // namespace v8 3559 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698