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

Unified Diff: runtime/vm/regexp_assembler_ir.cc

Issue 2900963008: Reapply "Shuffle around deopt id allocation... (Closed)
Patch Set: . Created 3 years, 7 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
Index: runtime/vm/regexp_assembler_ir.cc
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index 23aa5233dbe01031e5dc5203010783022abec3d9..2bdc701b8315cd222701a57599d7709d829dae86 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -80,6 +80,7 @@ IRRegExpMacroAssembler::IRRegExpMacroAssembler(
const ZoneGrowableArray<const ICData*>& ic_data_array,
Zone* zone)
: RegExpMacroAssembler(zone),
+ thread_(Thread::Current()),
specialization_cid_(specialization_cid),
parsed_function_(parsed_function),
ic_data_array_(ic_data_array),
@@ -122,14 +123,17 @@ IRRegExpMacroAssembler::IRRegExpMacroAssembler(
// Create and generate all preset blocks.
entry_block_ = new (zone) GraphEntryInstr(
*parsed_function_,
- new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
+ new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex,
+ GetNextDeoptId()),
Compiler::kNoOSRDeoptId);
- start_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
- success_block_ =
- new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
- backtrack_block_ =
- new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
- exit_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+ start_block_ = new (zone)
+ JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
+ success_block_ = new (zone)
+ JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
+ backtrack_block_ = new (zone)
+ JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
+ exit_block_ = new (zone)
+ JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
GenerateEntryBlock();
GenerateSuccessBlock();
@@ -252,8 +256,8 @@ void IRRegExpMacroAssembler::GenerateSuccessBlock() {
Value* type = Bind(new (Z) ConstantInstr(
TypeArguments::ZoneHandle(Z, TypeArguments::null())));
Value* length = Bind(Uint64Constant(saved_registers_count_));
- Value* array =
- Bind(new (Z) CreateArrayInstr(TokenPosition::kNoSource, type, length));
+ Value* array = Bind(new (Z) CreateArrayInstr(TokenPosition::kNoSource, type,
+ length, GetNextDeoptId()));
StoreLocal(result_, array);
// Store captured offsets in the `matches` parameter.
@@ -276,8 +280,8 @@ void IRRegExpMacroAssembler::GenerateSuccessBlock() {
PRINT(PushLocal(result_));
// Return true on success.
- AppendInstruction(
- new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
+ AppendInstruction(new (Z) ReturnInstr(
+ TokenPosition::kNoSource, Bind(LoadLocal(result_)), GetNextDeoptId()));
}
@@ -286,8 +290,8 @@ void IRRegExpMacroAssembler::GenerateExitBlock() {
TAG();
// Return false on failure.
- AppendInstruction(
- new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
+ AppendInstruction(new (Z) ReturnInstr(
+ TokenPosition::kNoSource, Bind(LoadLocal(result_)), GetNextDeoptId()));
}
@@ -489,8 +493,9 @@ ComparisonInstr* IRRegExpMacroAssembler::Comparison(ComparisonKind kind,
InstanceCallDescriptor::FromToken(intermediate_operator), lhs, rhs));
Value* rhs_value = Bind(BoolConstant(true));
- return new (Z) StrictCompareInstr(TokenPosition::kNoSource, strict_comparison,
- lhs_value, rhs_value, true);
+ return new (Z)
+ StrictCompareInstr(TokenPosition::kNoSource, strict_comparison, lhs_value,
+ rhs_value, true, GetNextDeoptId());
}
ComparisonInstr* IRRegExpMacroAssembler::Comparison(ComparisonKind kind,
@@ -538,9 +543,9 @@ StaticCallInstr* IRRegExpMacroAssembler::StaticCall(
const Function& function,
ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
const intptr_t kTypeArgsLen = 0;
- return new (Z)
- StaticCallInstr(TokenPosition::kNoSource, function, kTypeArgsLen,
- Object::null_array(), arguments, ic_data_array_);
+ return new (Z) StaticCallInstr(TokenPosition::kNoSource, function,
+ kTypeArgsLen, Object::null_array(), arguments,
+ ic_data_array_, GetNextDeoptId());
}
@@ -587,10 +592,10 @@ InstanceCallInstr* IRRegExpMacroAssembler::InstanceCall(
const InstanceCallDescriptor& desc,
ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
const intptr_t kTypeArgsLen = 0;
- return new (Z)
- InstanceCallInstr(TokenPosition::kNoSource, desc.name, desc.token_kind,
- arguments, kTypeArgsLen, Object::null_array(),
- desc.checked_argument_count, ic_data_array_);
+ return new (Z) InstanceCallInstr(
+ TokenPosition::kNoSource, desc.name, desc.token_kind, arguments,
+ kTypeArgsLen, Object::null_array(), desc.checked_argument_count,
+ ic_data_array_, GetNextDeoptId());
}
@@ -1571,8 +1576,8 @@ void IRRegExpMacroAssembler::CheckStackLimit() {
PushArgumentInstr* capacity_push = PushArgument(Bind(Sub(
length_push, PushArgument(Bind(Uint64Constant(stack_limit_slack()))))));
PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
- BranchInstr* branch =
- new (Z) BranchInstr(Comparison(kGT, capacity_push, stack_pointer_push));
+ BranchInstr* branch = new (Z) BranchInstr(
+ Comparison(kGT, capacity_push, stack_pointer_push), GetNextDeoptId());
CloseBlockWith(branch);
BlockLabel grow_stack;
@@ -1728,7 +1733,7 @@ void IRRegExpMacroAssembler::BranchOrBacktrack(ComparisonInstr* comparison,
// If the condition is not true, fall through to a new block.
BlockLabel fallthrough;
- BranchInstr* branch = new (Z) BranchInstr(comparison);
+ BranchInstr* branch = new (Z) BranchInstr(comparison, GetNextDeoptId());
*branch->true_successor_address() = TargetWithJoinGoto(true_successor_block);
*branch->false_successor_address() = TargetWithJoinGoto(fallthrough.block());
@@ -1739,11 +1744,11 @@ void IRRegExpMacroAssembler::BranchOrBacktrack(ComparisonInstr* comparison,
TargetEntryInstr* IRRegExpMacroAssembler::TargetWithJoinGoto(
JoinEntryInstr* dst) {
- TargetEntryInstr* target =
- new (Z) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+ TargetEntryInstr* target = new (Z)
+ TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
blocks_.Add(target);
- target->AppendInstruction(new (Z) GotoInstr(dst));
+ target->AppendInstruction(new (Z) GotoInstr(dst, GetNextDeoptId()));
return target;
}
@@ -1751,11 +1756,12 @@ TargetEntryInstr* IRRegExpMacroAssembler::TargetWithJoinGoto(
IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
JoinEntryInstr* dst) {
- IndirectEntryInstr* target = new (Z) IndirectEntryInstr(
- block_id_.Alloc(), indirect_id_.Alloc(), kInvalidTryIndex);
+ IndirectEntryInstr* target =
+ new (Z) IndirectEntryInstr(block_id_.Alloc(), indirect_id_.Alloc(),
+ kInvalidTryIndex, GetNextDeoptId());
blocks_.Add(target);
- target->AppendInstruction(new (Z) GotoInstr(dst));
+ target->AppendInstruction(new (Z) GotoInstr(dst, GetNextDeoptId()));
return target;
}
@@ -1763,8 +1769,8 @@ IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
void IRRegExpMacroAssembler::CheckPreemption() {
TAG();
- AppendInstruction(new (Z)
- CheckStackOverflowInstr(TokenPosition::kNoSource, 0));
+ AppendInstruction(new (Z) CheckStackOverflowInstr(TokenPosition::kNoSource, 0,
+ GetNextDeoptId()));
}

Powered by Google App Engine
This is Rietveld 408576698