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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1531693002: [Interpreter] Implement ForIn in bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0009-phi
Patch Set: Minor clean-up/simplication in Runtime_InterpreterForInPrepare. Created 5 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/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 06747cba830a5cd286593cdf6a90684824d30085..c4fe986dd7f1c2140afb29af19ce3dbc73390cd2 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -71,6 +71,7 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone)
last_block_end_(0),
last_bytecode_start_(~0),
exit_seen_in_block_(false),
+ unbound_jumps_(0),
constants_map_(isolate->heap(), zone),
constants_(zone),
parameter_count_(-1),
@@ -80,6 +81,9 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone)
free_temporaries_(zone) {}
+BytecodeArrayBuilder::~BytecodeArrayBuilder() { DCHECK_EQ(0, unbound_jumps_); }
+
+
void BytecodeArrayBuilder::set_locals_count(int number_of_locals) {
local_register_count_ = number_of_locals;
DCHECK_LE(context_register_count_, 0);
@@ -782,6 +786,7 @@ void BytecodeArrayBuilder::PatchJump(
UNIMPLEMENTED();
}
}
+ unbound_jumps_--;
}
@@ -826,6 +831,7 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::OutputJump(Bytecode jump_bytecode,
// that will be patched when the label is bound.
label->set_referrer(bytecodes()->size());
delta = 0;
+ unbound_jumps_++;
}
if (FitsInImm8Operand(delta)) {
@@ -884,21 +890,33 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Return() {
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::ForInPrepare(Register receiver) {
- Output(Bytecode::kForInPrepare, receiver.ToOperand());
+BytecodeArrayBuilder& BytecodeArrayBuilder::ForInPrepare(
+ Register cache_type, Register cache_array, Register cache_length) {
+ Output(Bytecode::kForInPrepare, cache_type.ToOperand(),
+ cache_array.ToOperand(), cache_length.ToOperand());
+ return *this;
+}
+
+
+BytecodeArrayBuilder& BytecodeArrayBuilder::ForInDone(Register index,
+ Register cache_length) {
+ Output(Bytecode::kForInDone, index.ToOperand(), cache_length.ToOperand());
return *this;
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::ForInNext(Register for_in_state,
+BytecodeArrayBuilder& BytecodeArrayBuilder::ForInNext(Register receiver,
+ Register cache_type,
+ Register cache_array,
Register index) {
- Output(Bytecode::kForInNext, for_in_state.ToOperand(), index.ToOperand());
+ Output(Bytecode::kForInNext, receiver.ToOperand(), cache_type.ToOperand(),
+ cache_array.ToOperand(), index.ToOperand());
return *this;
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::ForInDone(Register for_in_state) {
- Output(Bytecode::kForInDone, for_in_state.ToOperand());
+BytecodeArrayBuilder& BytecodeArrayBuilder::ForInStep(Register index) {
+ Output(Bytecode::kForInStep, index.ToOperand());
return *this;
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698