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

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

Issue 2331033002: [interpreter] Merge {OsrPoll} with {Jump} bytecode. (Closed)
Patch Set: One more test. Created 4 years, 3 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/bytecode-array-builder.h ('k') | src/interpreter/bytecode-array-writer.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 0220c2bd7dfc1340a8323cc29147721c27d5a83b..cf6d6b760f793dcd0f9e138fc993926255cd91f2 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -452,43 +452,54 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(const BytecodeLabel& target,
return *this;
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::OutputJump(Bytecode jump_bytecode,
+BytecodeArrayBuilder& BytecodeArrayBuilder::OutputJump(BytecodeNode* node,
BytecodeLabel* label) {
- BytecodeNode node(jump_bytecode, 0);
- AttachSourceInfo(&node);
- pipeline_->WriteJump(&node, label);
+ AttachSourceInfo(node);
+ pipeline_->WriteJump(node, label);
LeaveBasicBlock();
return *this;
}
BytecodeArrayBuilder& BytecodeArrayBuilder::Jump(BytecodeLabel* label) {
- return OutputJump(Bytecode::kJump, label);
+ BytecodeNode node(Bytecode::kJump, 0);
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfTrue(BytecodeLabel* label) {
// The peephole optimizer attempts to simplify JumpIfToBooleanTrue
// to JumpIfTrue.
- return OutputJump(Bytecode::kJumpIfToBooleanTrue, label);
+ BytecodeNode node(Bytecode::kJumpIfToBooleanTrue, 0);
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfFalse(BytecodeLabel* label) {
// The peephole optimizer attempts to simplify JumpIfToBooleanFalse
// to JumpIfFalse.
- return OutputJump(Bytecode::kJumpIfToBooleanFalse, label);
+ BytecodeNode node(Bytecode::kJumpIfToBooleanFalse, 0);
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) {
- return OutputJump(Bytecode::kJumpIfNull, label);
+ BytecodeNode node(Bytecode::kJumpIfNull, 0);
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined(
BytecodeLabel* label) {
- return OutputJump(Bytecode::kJumpIfUndefined, label);
+ BytecodeNode node(Bytecode::kJumpIfUndefined, 0);
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole(
BytecodeLabel* label) {
- return OutputJump(Bytecode::kJumpIfNotHole, label);
+ BytecodeNode node(Bytecode::kJumpIfNotHole, 0);
+ return OutputJump(&node, label);
+}
+
+BytecodeArrayBuilder& BytecodeArrayBuilder::JumpLoop(BytecodeLabel* label,
+ int loop_depth) {
+ BytecodeNode node(Bytecode::kJumpLoop, 0, UnsignedOperand(loop_depth));
+ return OutputJump(&node, label);
}
BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck(int position) {
@@ -509,11 +520,6 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck(int position) {
return *this;
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::OsrPoll(int loop_depth) {
- Output(Bytecode::kOsrPoll, UnsignedOperand(loop_depth));
- return *this;
-}
-
BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() {
Output(Bytecode::kThrow);
return *this;
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-array-writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698