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

Unified Diff: src/interpreter/interpreter.cc

Issue 2557593004: [ignition] desugar GetIterator() via bytecode rather than via AST (Closed)
Patch Set: georg's comments Created 4 years 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.h ('k') | src/parsing/parser.h » ('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 67225af9ec20c26db060d24376b47364abaf870b..9d2fd2029f6bcf72e68e8dfc3127e65eace5c35f 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -2147,6 +2147,49 @@ void Interpreter::DoJumpIfUndefinedConstant(InterpreterAssembler* assembler) {
__ JumpIfWordEqual(accumulator, undefined_value, relative_jump);
}
+// JumpIfJSReceiver <imm>
+//
+// Jump by number of bytes represented by an immediate operand if the object
+// referenced by the accumulator is a JSReceiver.
+void Interpreter::DoJumpIfJSReceiver(InterpreterAssembler* assembler) {
+ Node* accumulator = __ GetAccumulator();
+ Node* relative_jump = __ BytecodeOperandImm(0);
+
+ Label if_object(assembler), if_notobject(assembler, Label::kDeferred),
+ if_notsmi(assembler);
+ __ Branch(__ TaggedIsSmi(accumulator), &if_notobject, &if_notsmi);
+
+ __ Bind(&if_notsmi);
+ __ Branch(__ IsJSReceiver(accumulator), &if_object, &if_notobject);
+ __ Bind(&if_object);
+ __ Jump(relative_jump);
+
+ __ Bind(&if_notobject);
+ __ Dispatch();
+}
+
+// JumpIfJSReceiverConstant <idx>
+//
+// Jump by number of bytes in the Smi in the |idx| entry in the constant pool if
+// the object referenced by the accumulator is a JSReceiver.
+void Interpreter::DoJumpIfJSReceiverConstant(InterpreterAssembler* assembler) {
+ Node* accumulator = __ GetAccumulator();
+ Node* index = __ BytecodeOperandIdx(0);
+ Node* relative_jump = __ LoadAndUntagConstantPoolEntry(index);
+
+ Label if_object(assembler), if_notobject(assembler), if_notsmi(assembler);
+ __ Branch(__ TaggedIsSmi(accumulator), &if_notobject, &if_notsmi);
+
+ __ Bind(&if_notsmi);
+ __ Branch(__ IsJSReceiver(accumulator), &if_object, &if_notobject);
+
+ __ Bind(&if_object);
+ __ Jump(relative_jump);
+
+ __ Bind(&if_notobject);
+ __ Dispatch();
+}
+
// JumpIfNotHole <imm>
//
// Jump by number of bytes represented by an immediate operand if the object
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698