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

Unified Diff: runtime/vm/intermediate_language.h

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/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index e017cf72e4c9b99f338f0ad972aadb7b7b4a2fb6..fdcca2fa4ea8fbe13c630dba90970158b4411fbf 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1262,8 +1262,8 @@ class BlockEntryInstr : public Instruction {
DEFINE_INSTRUCTION_TYPE_CHECK(BlockEntry)
protected:
- BlockEntryInstr(intptr_t block_id, intptr_t try_index)
- : Instruction(Thread::Current()->GetNextDeoptId()),
+ BlockEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
+ : Instruction(deopt_id),
block_id_(block_id),
try_index_(try_index),
preorder_number_(-1),
@@ -1442,8 +1442,8 @@ class GraphEntryInstr : public BlockEntryInstr {
class JoinEntryInstr : public BlockEntryInstr {
public:
- JoinEntryInstr(intptr_t block_id, intptr_t try_index)
- : BlockEntryInstr(block_id, try_index),
+ JoinEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
+ : BlockEntryInstr(block_id, try_index, deopt_id),
predecessors_(2), // Two is the assumed to be the common case.
phis_(NULL) {}
@@ -1512,8 +1512,8 @@ class PhiIterator : public ValueObject {
class TargetEntryInstr : public BlockEntryInstr {
public:
- TargetEntryInstr(intptr_t block_id, intptr_t try_index)
- : BlockEntryInstr(block_id, try_index),
+ TargetEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
+ : BlockEntryInstr(block_id, try_index, deopt_id),
predecessor_(NULL),
edge_weight_(0.0) {}
@@ -1553,8 +1553,10 @@ class IndirectEntryInstr : public JoinEntryInstr {
public:
IndirectEntryInstr(intptr_t block_id,
intptr_t indirect_id,
- intptr_t try_index)
- : JoinEntryInstr(block_id, try_index), indirect_id_(indirect_id) {}
+ intptr_t try_index,
+ intptr_t deopt_id)
+ : JoinEntryInstr(block_id, try_index, deopt_id),
+ indirect_id_(indirect_id) {}
DECLARE_INSTRUCTION(IndirectEntry)
@@ -1581,7 +1583,7 @@ class CatchBlockEntryInstr : public BlockEntryInstr {
bool needs_stacktrace,
intptr_t deopt_id,
bool should_restore_closure_context = false)
- : BlockEntryInstr(block_id, try_index),
+ : BlockEntryInstr(block_id, try_index, deopt_id),
graph_entry_(graph_entry),
predecessor_(NULL),
catch_handler_types_(Array::ZoneHandle(handler_types.raw())),
@@ -1591,9 +1593,7 @@ class CatchBlockEntryInstr : public BlockEntryInstr {
needs_stacktrace_(needs_stacktrace),
should_restore_closure_context_(should_restore_closure_context),
handler_token_pos_(handler_token_pos),
- is_generated_(is_generated) {
- deopt_id_ = deopt_id;
- }
+ is_generated_(is_generated) {}
DECLARE_INSTRUCTION(CatchBlockEntry)
@@ -2108,9 +2108,8 @@ inline Definition* Instruction::ArgumentAt(intptr_t index) const {
class ReturnInstr : public TemplateInstruction<1, NoThrow> {
public:
- ReturnInstr(TokenPosition token_pos, Value* value)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
- token_pos_(token_pos) {
+ ReturnInstr(TokenPosition token_pos, Value* value, intptr_t deopt_id)
+ : TemplateInstruction(deopt_id), token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2138,9 +2137,8 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
class ThrowInstr : public TemplateInstruction<0, Throws> {
public:
- explicit ThrowInstr(TokenPosition token_pos)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
- token_pos_(token_pos) {}
+ explicit ThrowInstr(TokenPosition token_pos, intptr_t deopt_id)
+ : TemplateInstruction(deopt_id), token_pos_(token_pos) {}
DECLARE_INSTRUCTION(Throw)
@@ -2163,8 +2161,10 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
public:
// 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
// rethrow has been artificially generated by the parser.
- ReThrowInstr(TokenPosition token_pos, intptr_t catch_try_index)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ ReThrowInstr(TokenPosition token_pos,
+ intptr_t catch_try_index,
+ intptr_t deopt_id)
+ : TemplateInstruction(deopt_id),
token_pos_(token_pos),
catch_try_index_(catch_try_index) {}
@@ -2214,8 +2214,8 @@ class StopInstr : public TemplateInstruction<0, NoThrow> {
class GotoInstr : public TemplateInstruction<0, NoThrow> {
public:
- explicit GotoInstr(JoinEntryInstr* entry)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ explicit GotoInstr(JoinEntryInstr* entry, intptr_t deopt_id)
+ : TemplateInstruction(deopt_id),
block_(NULL),
successor_(entry),
edge_weight_(0.0),
@@ -2428,10 +2428,8 @@ class TemplateComparison
class BranchInstr : public Instruction {
public:
- explicit BranchInstr(ComparisonInstr* comparison)
- : Instruction(Thread::Current()->GetNextDeoptId()),
- comparison_(comparison),
- constant_target_(NULL) {
+ explicit BranchInstr(ComparisonInstr* comparison, intptr_t deopt_id)
+ : Instruction(deopt_id), comparison_(comparison), constant_target_(NULL) {
ASSERT(comparison->env() == NULL);
for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
comparison->InputAt(i)->set_instruction(this);
@@ -2710,9 +2708,8 @@ class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
public:
- AssertBooleanInstr(TokenPosition token_pos, Value* value)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
- token_pos_(token_pos) {
+ AssertBooleanInstr(TokenPosition token_pos, Value* value, intptr_t deopt_id)
+ : TemplateDefinition(deopt_id), token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2741,8 +2738,8 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
// a computation, not a value, because it's mutable.
class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
public:
- CurrentContextInstr()
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {}
+ explicit CurrentContextInstr(intptr_t deopt_id)
+ : TemplateDefinition(deopt_id) {}
DECLARE_INSTRUCTION(CurrentContext)
virtual CompileType ComputeType() const;
@@ -2825,8 +2822,9 @@ class ClosureCallInstr : public TemplateDartCall<1> {
public:
ClosureCallInstr(Value* function,
ClosureCallNode* node,
- ZoneGrowableArray<PushArgumentInstr*>* arguments)
- : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
+ ZoneGrowableArray<PushArgumentInstr*>* arguments,
+ intptr_t deopt_id)
+ : TemplateDartCall(deopt_id,
node->arguments()->type_args_len(),
node->arguments()->names(),
arguments,
@@ -2839,8 +2837,9 @@ class ClosureCallInstr : public TemplateDartCall<1> {
ZoneGrowableArray<PushArgumentInstr*>* arguments,
intptr_t type_args_len,
const Array& argument_names,
- TokenPosition token_pos)
- : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
+ TokenPosition token_pos,
+ intptr_t deopt_id)
+ : TemplateDartCall(deopt_id,
type_args_len,
argument_names,
arguments,
@@ -2874,8 +2873,9 @@ class InstanceCallInstr : public TemplateDartCall<0> {
intptr_t type_args_len,
const Array& argument_names,
intptr_t checked_argument_count,
- const ZoneGrowableArray<const ICData*>& ic_data_array)
- : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t deopt_id)
+ : TemplateDartCall(deopt_id,
type_args_len,
argument_names,
arguments,
@@ -3033,7 +3033,8 @@ class StrictCompareInstr : public TemplateComparison<2, NoThrow, Pure> {
Token::Kind kind,
Value* left,
Value* right,
- bool needs_number_check);
+ bool needs_number_check,
+ intptr_t deopt_id);
DECLARE_INSTRUCTION(StrictCompare)
@@ -3245,8 +3246,11 @@ class RelationalOpInstr : public TemplateComparison<2, NoThrow, Pure> {
// materialization of true and false constants.
class IfThenElseInstr : public Definition {
public:
- IfThenElseInstr(ComparisonInstr* comparison, Value* if_true, Value* if_false)
- : Definition(Thread::Current()->GetNextDeoptId()),
+ IfThenElseInstr(ComparisonInstr* comparison,
+ Value* if_true,
+ Value* if_false,
+ intptr_t deopt_id)
+ : Definition(deopt_id),
comparison_(comparison),
if_true_(Smi::Cast(if_true->BoundConstant()).Value()),
if_false_(Smi::Cast(if_false->BoundConstant()).Value()) {
@@ -3328,8 +3332,9 @@ class StaticCallInstr : public TemplateDartCall<0> {
intptr_t type_args_len,
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
- const ZoneGrowableArray<const ICData*>& ic_data_array)
- : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t deopt_id)
+ : TemplateDartCall(deopt_id,
type_args_len,
argument_names,
arguments,
@@ -4049,8 +4054,10 @@ class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
public:
- StringInterpolateInstr(Value* value, TokenPosition token_pos)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ StringInterpolateInstr(Value* value,
+ TokenPosition token_pos,
+ intptr_t deopt_id)
+ : TemplateDefinition(deopt_id),
token_pos_(token_pos),
function_(Function::ZoneHandle()) {
SetInputAt(0, value);
@@ -4385,8 +4392,9 @@ class CreateArrayInstr : public TemplateDefinition<2, Throws> {
public:
CreateArrayInstr(TokenPosition token_pos,
Value* element_type,
- Value* num_elements)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ Value* num_elements,
+ intptr_t deopt_id)
+ : TemplateDefinition(deopt_id),
token_pos_(token_pos),
identity_(AliasIdentity::Unknown()) {
SetInputAt(kElementTypePos, element_type);
@@ -4594,10 +4602,9 @@ class InstantiateTypeInstr : public TemplateDefinition<2, Throws> {
InstantiateTypeInstr(TokenPosition token_pos,
const AbstractType& type,
Value* instantiator_type_arguments,
- Value* function_type_arguments)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
- token_pos_(token_pos),
- type_(type) {
+ Value* function_type_arguments,
+ intptr_t deopt_id)
+ : TemplateDefinition(deopt_id), token_pos_(token_pos), type_(type) {
ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
SetInputAt(0, instantiator_type_arguments);
SetInputAt(1, function_type_arguments);
@@ -4630,8 +4637,9 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<2, Throws> {
const TypeArguments& type_arguments,
const Class& instantiator_class,
Value* instantiator_type_arguments,
- Value* function_type_arguments)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ Value* function_type_arguments,
+ intptr_t deopt_id)
+ : TemplateDefinition(deopt_id),
token_pos_(token_pos),
type_arguments_(type_arguments),
instantiator_class_(instantiator_class) {
@@ -4692,9 +4700,8 @@ class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
public:
- InitStaticFieldInstr(Value* input, const Field& field)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
- field_(field) {
+ InitStaticFieldInstr(Value* input, const Field& field, intptr_t deopt_id)
+ : TemplateInstruction(deopt_id), field_(field) {
SetInputAt(0, input);
CheckField(field);
}
@@ -4717,9 +4724,10 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
public:
- CloneContextInstr(TokenPosition token_pos, Value* context_value)
- : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
- token_pos_(token_pos) {
+ CloneContextInstr(TokenPosition token_pos,
+ Value* context_value,
+ intptr_t deopt_id)
+ : TemplateDefinition(deopt_id), token_pos_(token_pos) {
SetInputAt(0, context_value);
}
@@ -7254,8 +7262,10 @@ class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
public:
- CheckStackOverflowInstr(TokenPosition token_pos, intptr_t loop_depth)
- : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ CheckStackOverflowInstr(TokenPosition token_pos,
+ intptr_t loop_depth,
+ intptr_t deopt_id)
+ : TemplateInstruction(deopt_id),
token_pos_(token_pos),
loop_depth_(loop_depth) {}

Powered by Google App Engine
This is Rietveld 408576698