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

Unified Diff: src/interpreter/interpreter.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/interpreter/bytecodes.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 418ba97b59b69c05c812199ac71bce33fcd146e5..cd06baee50c7a1f8c645a7a3b3eb33767f3ca334 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1580,28 +1580,38 @@ void Interpreter::DoJumpIfUndefinedConstantWide(
DoJumpIfUndefinedConstant(assembler);
}
-// JumpIfHole <imm8>
+// JumpIfNotHole <imm8>
//
// Jump by number of bytes represented by an immediate operand if the object
// referenced by the accumulator is the hole.
-void Interpreter::DoJumpIfHole(InterpreterAssembler* assembler) {
+void Interpreter::DoJumpIfNotHole(InterpreterAssembler* assembler) {
Node* accumulator = __ GetAccumulator();
Node* the_hole_value = __ HeapConstant(isolate_->factory()->the_hole_value());
Node* relative_jump = __ BytecodeOperandImm(0);
- __ JumpIfWordEqual(accumulator, the_hole_value, relative_jump);
+ __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump);
}
-// JumpIfNotHole <imm8>
+// JumpIfNotHoleConstant <idx8>
//
-// Jump by number of bytes represented by an immediate operand if the object
-// referenced by the accumulator is not the hole.
-void Interpreter::DoJumpIfNotHole(InterpreterAssembler* assembler) {
+// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
+// if the object referenced by the accumulator is the hole constant.
+void Interpreter::DoJumpIfNotHoleConstant(InterpreterAssembler* assembler) {
Node* accumulator = __ GetAccumulator();
Node* the_hole_value = __ HeapConstant(isolate_->factory()->the_hole_value());
- Node* relative_jump = __ BytecodeOperandImm(0);
+ Node* index = __ BytecodeOperandIdx(0);
+ Node* constant = __ LoadConstantPoolEntry(index);
+ Node* relative_jump = __ SmiUntag(constant);
__ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump);
}
+// JumpIfNotHoleConstantWide <idx16>
+//
+// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
+// if the object referenced by the accumulator is the hole constant.
+void Interpreter::DoJumpIfNotHoleConstantWide(InterpreterAssembler* assembler) {
+ DoJumpIfNotHoleConstant(assembler);
+}
+
void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
InterpreterAssembler* assembler) {
Node* index = __ BytecodeOperandIdx(0);
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698