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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patchset 13. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 2fe2e1c397ec99a19f44a3f3bf2144002267eda6..a7694defb27c6d8a1cd94f0dc229b4113d20bfd1 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1489,87 +1489,117 @@ void BytecodeGraphBuilder::VisitJumpConstant(
}
+void BytecodeGraphBuilder::VisitJumpConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJump();
+}
+
+
void BytecodeGraphBuilder::VisitJumpIfTrue(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->TrueConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->TrueConstant());
}
void BytecodeGraphBuilder::VisitJumpIfTrueConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->TrueConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->TrueConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfTrueConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfEqual(jsgraph()->TrueConstant());
}
void BytecodeGraphBuilder::VisitJumpIfFalse(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->FalseConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->FalseConstant());
}
void BytecodeGraphBuilder::VisitJumpIfFalseConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->FalseConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->FalseConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfFalseConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfEqual(jsgraph()->FalseConstant());
}
void BytecodeGraphBuilder::VisitJumpIfToBooleanTrue(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildToBooleanCondition(jsgraph()->TrueConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
}
void BytecodeGraphBuilder::VisitJumpIfToBooleanTrueConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildToBooleanCondition(jsgraph()->TrueConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfToBooleanTrueConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfToBooleanEqual(jsgraph()->TrueConstant());
}
void BytecodeGraphBuilder::VisitJumpIfToBooleanFalse(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildToBooleanCondition(jsgraph()->FalseConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
}
void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildToBooleanCondition(jsgraph()->FalseConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
}
void BytecodeGraphBuilder::VisitJumpIfNull(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->NullConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->NullConstant());
}
void BytecodeGraphBuilder::VisitJumpIfNullConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->NullConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->NullConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfNullConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfEqual(jsgraph()->NullConstant());
}
void BytecodeGraphBuilder::VisitJumpIfUndefined(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->UndefinedConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
void BytecodeGraphBuilder::VisitJumpIfUndefinedConstant(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* condition = BuildCondition(jsgraph()->UndefinedConstant());
- BuildConditionalJump(condition);
+ BuildJumpIfEqual(jsgraph()->UndefinedConstant());
+}
+
+
+void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
@@ -1714,17 +1744,20 @@ void BytecodeGraphBuilder::BuildConditionalJump(Node* condition) {
}
-Node* BytecodeGraphBuilder::BuildCondition(Node* comperand) {
+void BytecodeGraphBuilder::BuildJumpIfEqual(Node* comperand) {
Node* accumulator = environment()->LookupAccumulator();
- return NewNode(javascript()->StrictEqual(), accumulator, comperand);
+ Node* condition =
+ NewNode(javascript()->StrictEqual(), accumulator, comperand);
+ BuildConditionalJump(condition);
}
-Node* BytecodeGraphBuilder::BuildToBooleanCondition(Node* comperand) {
+void BytecodeGraphBuilder::BuildJumpIfToBooleanEqual(Node* comperand) {
Node* accumulator = environment()->LookupAccumulator();
Node* to_boolean =
NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), accumulator);
- return NewNode(javascript()->StrictEqual(), to_boolean, comperand);
+ Node* condition = NewNode(javascript()->StrictEqual(), to_boolean, comperand);
+ BuildConditionalJump(condition);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698