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

Unified Diff: src/interpreter/interpreter.cc

Issue 1634153002: [Interpreter] Adds support for const/let variables to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased the patch. 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/cctest/cctest.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 6f64d63eb7e7cd6e344418c4cb5e5b76ce082c1c..6d346229e8b2a399a8ed06fa708317b5cc2b0cf0 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1605,8 +1605,7 @@ void Interpreter::DoJumpIfNullConstantWide(
DoJumpIfNullConstant(assembler);
}
-
-// jumpifundefined <imm8>
+// JumpIfUndefined <imm8>
//
// Jump by number of bytes represented by an immediate operand if the object
// referenced by the accumulator is the undefined constant.
@@ -1644,6 +1643,27 @@ void Interpreter::DoJumpIfUndefinedConstantWide(
DoJumpIfUndefinedConstant(assembler);
}
+// JumpIfHole <imm8>
+//
+// Jump by number of bytes represented by an immediate operand if the object
+// referenced by the accumulator is the hole.
+void Interpreter::DoJumpIfHole(compiler::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);
+}
+
+// JumpIfNotHole <imm8>
+//
+// Jump by number of bytes represented by an immediate operand if the object
+// referenced by the accumulator is not the hole.
+void Interpreter::DoJumpIfNotHole(compiler::InterpreterAssembler* assembler) {
+ Node* accumulator = __ GetAccumulator();
+ Node* the_hole_value = __ HeapConstant(isolate_->factory()->the_hole_value());
+ Node* relative_jump = __ BytecodeOperandImm(0);
+ __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump);
+}
void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
compiler::InterpreterAssembler* assembler) {
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698