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

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

Issue 1697473002: [interpreter] Add bytecodes for JumpIfNotHole with constant (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 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 4cfd68d4ca8b8d2b8fb56657e52e95e8ee847c65..28810526d787f660ca58f3200466323e0312eb92 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1426,6 +1426,16 @@ void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstantWide() {
BuildJumpIfToBooleanEqual(jsgraph()->FalseConstant());
}
+void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); }
+
+void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() {
+ BuildJumpIfNotHole();
+}
+
+void BytecodeGraphBuilder::VisitJumpIfNotHoleConstantWide() {
+ BuildJumpIfNotHole();
+}
+
void BytecodeGraphBuilder::VisitJumpIfNull() {
BuildJumpIfEqual(jsgraph()->NullConstant());
}
@@ -1450,20 +1460,6 @@ void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() {
BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
-void BytecodeGraphBuilder::VisitJumpIfHole() {
- BuildJumpIfEqual(jsgraph()->TheHoleConstant());
-}
-
-void BytecodeGraphBuilder::VisitJumpIfNotHole() {
- Node* accumulator = environment()->LookupAccumulator();
- Node* condition = NewNode(javascript()->StrictEqual(), accumulator,
- jsgraph()->TheHoleConstant());
- Node* node =
- NewNode(common()->Select(MachineRepresentation::kTagged), condition,
- jsgraph()->FalseConstant(), jsgraph()->TrueConstant());
- BuildConditionalJump(node);
-}
-
void BytecodeGraphBuilder::VisitStackCheck() {
FrameStateBeforeAndAfter states(this);
Node* node = NewNode(javascript()->StackCheck());
@@ -1601,6 +1597,15 @@ void BytecodeGraphBuilder::BuildJumpIfToBooleanEqual(Node* comperand) {
BuildConditionalJump(condition);
}
+void BytecodeGraphBuilder::BuildJumpIfNotHole() {
+ Node* accumulator = environment()->LookupAccumulator();
+ Node* condition = NewNode(javascript()->StrictEqual(), accumulator,
+ jsgraph()->TheHoleConstant());
+ Node* node =
+ NewNode(common()->Select(MachineRepresentation::kTagged), condition,
+ jsgraph()->FalseConstant(), jsgraph()->TrueConstant());
+ BuildConditionalJump(node);
+}
Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) {
if (size > input_buffer_size_) {
« 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