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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2896903002: Shuffle around deopt id allocation to give the flow graph builder a chance to record other data as … (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
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 806acfc938972dd5e3044a300d466e5d3db1665d..bb2728b63549ad589f420822683131a1e37c7ca3 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1257,8 +1257,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),
@@ -1437,8 +1437,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) {}
@@ -1507,8 +1507,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) {}
@@ -1548,8 +1548,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)
@@ -1576,7 +1578,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())),
@@ -1586,9 +1588,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)
@@ -2103,9 +2103,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);
}
@@ -2133,9 +2132,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)
@@ -2158,8 +2156,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) {}
@@ -2209,8 +2209,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),
@@ -2423,10 +2423,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);
@@ -2705,9 +2703,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);
}
@@ -2736,8 +2733,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;
@@ -2820,8 +2817,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,
@@ -2834,8 +2832,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,
@@ -2869,8 +2868,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,
@@ -3025,7 +3025,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)
@@ -3237,8 +3238,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()) {
@@ -3320,8 +3324,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,
@@ -4021,8 +4026,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);
@@ -4357,8 +4364,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);
@@ -4559,10 +4567,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);
@@ -4595,8 +4602,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) {
@@ -4657,9 +4665,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);
}
@@ -4682,9 +4689,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);
}
@@ -7204,8 +7212,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) {}
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698