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

Unified Diff: runtime/vm/intermediate_language.h

Issue 595673002: Reduce number of times a deopt-id is computed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/code_descriptors.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
===================================================================
--- runtime/vm/intermediate_language.h (revision 40639)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -601,7 +601,7 @@
#undef DECLARE_TAG
Instruction()
- : deopt_id_(Isolate::Current()->GetNextDeoptId()),
+ : deopt_id_(Isolate::kNoDeoptId),
lifetime_position_(-1),
previous_(NULL),
next_(NULL),
@@ -924,6 +924,29 @@
friend class BinaryIntegerOpInstr;
friend class DeoptimizeInstr;
+ // deopt_id_ access.
Florian Schneider 2014/09/25 09:55:34 How about moving deopt_id_ out of Instruction and
srdjan 2014/09/25 17:42:16 That is a much more invasive change, but should re
+ friend class InstanceCallInstr;
+ friend class StaticCallInstr;
+ friend class GotoInstr;
+ friend class ReturnInstr;
+ friend class BranchInstr;
+ friend class AssertAssignableInstr;
+ friend class TestSmiInstr;
+ friend class IfThenElseInstr;
+ friend class StrictCompareInstr;
+ friend class ThrowInstr;
+ friend class ReThrowInstr;
+ friend class AssertBooleanInstr;
+ friend class CurrentContextInstr;
+ friend class ClosureCallInstr;
+ friend class StringInterpolateInstr;
+ friend class CreateArrayInstr;
+ friend class InstantiateTypeInstr;
+ friend class InstantiateTypeArgumentsInstr;
+ friend class InitStaticFieldInstr;
+ friend class CloneContextInstr;
+ friend class CheckStackOverflowInstr;
+
virtual void RawSetInputAt(intptr_t i, Value* value) = 0;
enum {
@@ -1203,7 +1226,9 @@
dominated_blocks_(1),
last_instruction_(NULL),
parallel_move_(NULL),
- loop_info_(NULL) { }
+ loop_info_(NULL) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ }
private:
virtual void RawSetInputAt(intptr_t i, Value* value) { UNREACHABLE(); }
@@ -1438,8 +1463,7 @@
TargetEntryInstr(intptr_t block_id, intptr_t try_index)
: BlockEntryInstr(block_id, try_index),
predecessor_(NULL),
- edge_weight_(0.0) {
- }
+ edge_weight_(0.0) { }
DECLARE_INSTRUCTION(TargetEntry)
@@ -2001,6 +2025,7 @@
public:
ReturnInstr(intptr_t token_pos, Value* value)
: token_pos_(token_pos) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, value);
}
@@ -2032,7 +2057,9 @@
class ThrowInstr : public TemplateInstruction<0> {
public:
- explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) { }
+ explicit ThrowInstr(intptr_t token_pos) : token_pos_(token_pos) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ }
DECLARE_INSTRUCTION(Throw)
@@ -2058,7 +2085,9 @@
// 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
// rethrow has been artifically generated by the parser.
ReThrowInstr(intptr_t token_pos, intptr_t catch_try_index)
- : token_pos_(token_pos), catch_try_index_(catch_try_index) {}
+ : token_pos_(token_pos), catch_try_index_(catch_try_index) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ }
DECLARE_INSTRUCTION(ReThrow)
@@ -2087,6 +2116,7 @@
: successor_(entry),
edge_weight_(0.0),
parallel_move_(NULL) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
}
DECLARE_INSTRUCTION(Goto)
@@ -2199,6 +2229,7 @@
is_checked_(false),
constrained_type_(NULL),
constant_target_(NULL) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
ASSERT(comparison->env() == NULL);
for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
comparison->InputAt(i)->set_instruction(this);
@@ -2509,6 +2540,7 @@
: token_pos_(token_pos),
dst_type_(AbstractType::ZoneHandle(dst_type.raw())),
dst_name_(dst_name) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
ASSERT(!dst_type.IsNull());
ASSERT(!dst_name.IsNull());
SetInputAt(0, value);
@@ -2563,6 +2595,7 @@
public:
AssertBooleanInstr(intptr_t token_pos, Value* value)
: token_pos_(token_pos) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, value);
}
@@ -2596,7 +2629,9 @@
// a computation, not a value, because it's mutable.
class CurrentContextInstr : public TemplateDefinition<0> {
public:
- CurrentContextInstr() { }
+ CurrentContextInstr() {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ }
DECLARE_INSTRUCTION(CurrentContext)
virtual CompileType ComputeType() const;
@@ -2621,6 +2656,7 @@
ZoneGrowableArray<PushArgumentInstr*>* arguments)
: ast_node_(*node),
arguments_(arguments) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, function);
}
@@ -2662,13 +2698,15 @@
const Array& argument_names,
intptr_t checked_argument_count,
const ZoneGrowableArray<const ICData*>& ic_data_array)
- : ic_data_(GetICData(ic_data_array)),
+ : ic_data_(NULL),
token_pos_(token_pos),
function_name_(function_name),
token_kind_(token_kind),
arguments_(arguments),
argument_names_(argument_names),
checked_argument_count_(checked_argument_count) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ ic_data_ = GetICData(ic_data_array);
ASSERT(function_name.IsNotTemporaryScopedHandle());
ASSERT(!arguments->is_empty());
ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
@@ -2842,6 +2880,7 @@
public:
TestSmiInstr(intptr_t token_pos, Token::Kind kind, Value* left, Value* right)
: ComparisonInstr(token_pos, kind, left, right) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
ASSERT(kind == Token::kEQ || kind == Token::kNE);
}
@@ -3072,6 +3111,7 @@
: comparison_(comparison),
if_true_(Smi::Cast(if_true->BoundConstant()).Value()),
if_false_(Smi::Cast(if_false->BoundConstant()).Value()) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
// Adjust uses at the comparison.
ASSERT(comparison->env() == NULL);
for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
@@ -3149,7 +3189,7 @@
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
const ZoneGrowableArray<const ICData*>& ic_data_array)
- : ic_data_(GetICData(ic_data_array)),
+ : ic_data_(NULL),
token_pos_(token_pos),
function_(function),
argument_names_(argument_names),
@@ -3158,6 +3198,8 @@
is_known_list_constructor_(false),
is_native_list_factory_(false),
identity_(AliasIdentity::Unknown()) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ ic_data_ = GetICData(ic_data_array);
ASSERT(function.IsZoneHandle());
ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
}
@@ -3834,6 +3876,7 @@
public:
StringInterpolateInstr(Value* value, intptr_t token_pos)
: token_pos_(token_pos), function_(Function::Handle()) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, value);
}
@@ -4150,6 +4193,7 @@
Value* element_type,
Value* num_elements)
: token_pos_(token_pos), identity_(AliasIdentity::Unknown()) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(kElementTypePos, element_type);
SetInputAt(kLengthPos, num_elements);
}
@@ -4356,6 +4400,7 @@
: token_pos_(token_pos),
type_(type),
instantiator_class_(instantiator_class) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
ASSERT(type.IsZoneHandle());
SetInputAt(0, instantiator);
}
@@ -4394,6 +4439,7 @@
: token_pos_(token_pos),
type_arguments_(type_arguments),
instantiator_class_(instantiator_class) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
ASSERT(type_arguments.IsZoneHandle());
SetInputAt(0, instantiator);
}
@@ -4459,6 +4505,7 @@
public:
InitStaticFieldInstr(Value* input, const Field& field)
: field_(field) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, input);
}
@@ -4513,6 +4560,7 @@
public:
CloneContextInstr(intptr_t token_pos, Value* context_value)
: token_pos_(token_pos) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
SetInputAt(0, context_value);
}
@@ -6770,8 +6818,7 @@
UnarySmiOpInstr(Token::Kind op_kind,
Value* value,
intptr_t deopt_id)
- : UnaryIntegerOpInstr(op_kind, value, deopt_id) {
- }
+ : UnaryIntegerOpInstr(op_kind, value, deopt_id) {}
virtual bool CanDeoptimize() const { return op_kind() == Token::kNEGATE; }
@@ -7181,7 +7228,9 @@
class CheckStackOverflowInstr : public TemplateInstruction<0> {
public:
CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth)
- : token_pos_(token_pos), loop_depth_(loop_depth) {}
+ : token_pos_(token_pos), loop_depth_(loop_depth) {
+ deopt_id_ = Isolate::Current()->GetNextDeoptId();
+ }
virtual intptr_t token_pos() const { return token_pos_; }
bool in_loop() const { return loop_depth_ > 0; }
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698