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

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

Issue 1901083002: [Interpreter] Introduce IncStub and DecStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 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-stubs.cc ('k') | src/ia32/interface-descriptors-ia32.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 BuildBinaryOp(javascript()->ShiftRight(hints)); 1114 BuildBinaryOp(javascript()->ShiftRight(hints));
1115 } 1115 }
1116 1116
1117 void BytecodeGraphBuilder::VisitShiftRightLogical() { 1117 void BytecodeGraphBuilder::VisitShiftRightLogical() {
1118 BinaryOperationHints hints = BinaryOperationHints::Any(); 1118 BinaryOperationHints hints = BinaryOperationHints::Any();
1119 BuildBinaryOp(javascript()->ShiftRightLogical(hints)); 1119 BuildBinaryOp(javascript()->ShiftRightLogical(hints));
1120 } 1120 }
1121 1121
1122 void BytecodeGraphBuilder::VisitInc() { 1122 void BytecodeGraphBuilder::VisitInc() {
1123 FrameStateBeforeAndAfter states(this); 1123 FrameStateBeforeAndAfter states(this);
1124 const Operator* js_op = javascript()->Add(BinaryOperationHints::Any()); 1124 // Note: Use subtract -1 here instead of add 1 to ensure we always convert to
1125 // a number, not a string.
1126 const Operator* js_op = javascript()->Subtract(BinaryOperationHints::Any());
1125 Node* node = NewNode(js_op, environment()->LookupAccumulator(), 1127 Node* node = NewNode(js_op, environment()->LookupAccumulator(),
1126 jsgraph()->OneConstant()); 1128 jsgraph()->Constant(-1.0));
1127 environment()->BindAccumulator(node, &states); 1129 environment()->BindAccumulator(node, &states);
1128 } 1130 }
1129 1131
1130 void BytecodeGraphBuilder::VisitDec() { 1132 void BytecodeGraphBuilder::VisitDec() {
1131 FrameStateBeforeAndAfter states(this); 1133 FrameStateBeforeAndAfter states(this);
1132 const Operator* js_op = javascript()->Subtract(BinaryOperationHints::Any()); 1134 const Operator* js_op = javascript()->Subtract(BinaryOperationHints::Any());
1133 Node* node = NewNode(js_op, environment()->LookupAccumulator(), 1135 Node* node = NewNode(js_op, environment()->LookupAccumulator(),
1134 jsgraph()->OneConstant()); 1136 jsgraph()->OneConstant());
1135 environment()->BindAccumulator(node, &states); 1137 environment()->BindAccumulator(node, &states);
1136 } 1138 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 // Phi does not exist yet, introduce one. 1652 // Phi does not exist yet, introduce one.
1651 value = NewPhi(inputs, value, control); 1653 value = NewPhi(inputs, value, control);
1652 value->ReplaceInput(inputs - 1, other); 1654 value->ReplaceInput(inputs - 1, other);
1653 } 1655 }
1654 return value; 1656 return value;
1655 } 1657 }
1656 1658
1657 } // namespace compiler 1659 } // namespace compiler
1658 } // namespace internal 1660 } // namespace internal
1659 } // namespace v8 1661 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698