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

Unified Diff: src/interpreter/bytecode-peephole-optimizer.cc

Issue 2351763002: [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. (Closed)
Patch Set: Fix Chromium Windows bots. 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-peephole-optimizer.h ('k') | src/interpreter/bytecode-pipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-peephole-optimizer.cc
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc
index 11aebb6ddb3ef1f3d85ac36196e0b57f37e4aef9..c87d31c39f04aef43254e8643af83c2672b1d8c6 100644
--- a/src/interpreter/bytecode-peephole-optimizer.cc
+++ b/src/interpreter/bytecode-peephole-optimizer.cc
@@ -13,17 +13,17 @@ namespace interpreter {
BytecodePeepholeOptimizer::BytecodePeepholeOptimizer(
BytecodePipelineStage* next_stage)
- : next_stage_(next_stage) {
+ : next_stage_(next_stage), last_(Bytecode::kIllegal) {
InvalidateLast();
}
// override
Handle<BytecodeArray> BytecodePeepholeOptimizer::ToBytecodeArray(
- Isolate* isolate, int fixed_register_count, int parameter_count,
+ Isolate* isolate, int register_count, int parameter_count,
Handle<FixedArray> handler_table) {
Flush();
- return next_stage_->ToBytecodeArray(isolate, fixed_register_count,
- parameter_count, handler_table);
+ return next_stage_->ToBytecodeArray(isolate, register_count, parameter_count,
+ handler_table);
}
// override
@@ -142,7 +142,7 @@ void TransformLdaSmiBinaryOpToBinaryOpWithSmi(Bytecode new_bytecode,
current->set_bytecode(new_bytecode, last->operand(0), current->operand(0),
current->operand(1));
if (last->source_info().is_valid()) {
- current->source_info().Clone(last->source_info());
+ current->source_info_ptr()->Clone(last->source_info());
}
}
@@ -153,7 +153,7 @@ void TransformLdaZeroBinaryOpToBinaryOpWithZero(Bytecode new_bytecode,
current->set_bytecode(new_bytecode, 0, current->operand(0),
current->operand(1));
if (last->source_info().is_valid()) {
- current->source_info().Clone(last->source_info());
+ current->source_info_ptr()->Clone(last->source_info());
}
}
@@ -223,7 +223,7 @@ void BytecodePeepholeOptimizer::ElideLastAction(
// |node| can not have a valid source position if the source
// position of last() is valid (per rules in
// CanElideLastBasedOnSourcePosition()).
- node->source_info().Clone(last()->source_info());
+ node->source_info_ptr()->Clone(last()->source_info());
}
SetLast(node);
} else {
@@ -314,7 +314,7 @@ void BytecodePeepholeOptimizer::ElideLastBeforeJumpAction(
if (!CanElideLastBasedOnSourcePosition(node)) {
next_stage()->Write(last());
} else if (!node->source_info().is_valid()) {
- node->source_info().Clone(last()->source_info());
+ node->source_info_ptr()->Clone(last()->source_info());
}
InvalidateLast();
}
« no previous file with comments | « src/interpreter/bytecode-peephole-optimizer.h ('k') | src/interpreter/bytecode-pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698