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

Unified Diff: runtime/vm/intermediate_language.h

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 60e25a9c6fbaab92f121309c3fb37850a69d3956..2a97f0aa9b72089a0904b4a852696b57dbd45ea9 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -13,6 +13,7 @@
#include "vm/method_recognizer.h"
#include "vm/object.h"
#include "vm/parser.h"
+#include "vm/token_descriptor.h"
namespace dart {
@@ -627,7 +628,9 @@ class Instruction : public ZoneAllocated {
const ICData* GetICData(
const ZoneGrowableArray<const ICData*>& ic_data_array) const;
- virtual intptr_t token_pos() const { return Token::kNoSourcePos; }
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kNoSource;
+ }
virtual intptr_t InputCount() const = 0;
virtual Value* InputAt(intptr_t i) const = 0;
@@ -1053,8 +1056,8 @@ class ParallelMoveInstr : public TemplateInstruction<0, NoThrow> {
virtual void PrintTo(BufferFormatter* f) const;
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kParallelMove;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kParallelMove;
}
private:
@@ -1189,8 +1192,8 @@ class BlockEntryInstr : public Instruction {
return this;
}
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kControlFlow;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kControlFlow;
}
// Helper to mutate the graph during inlining. This block should be
@@ -2042,8 +2045,8 @@ class PushArgumentInstr : public TemplateDefinition<1, NoThrow> {
virtual void PrintOperandsTo(BufferFormatter* f) const;
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kPushArgument;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kPushArgument;
}
private:
@@ -2058,7 +2061,7 @@ inline Definition* Instruction::ArgumentAt(intptr_t index) const {
class ReturnInstr : public TemplateInstruction<1, NoThrow> {
public:
- ReturnInstr(intptr_t token_pos, Value* value)
+ ReturnInstr(TokenDescriptor token_pos, Value* value)
: TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, value);
@@ -2066,7 +2069,7 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
DECLARE_INSTRUCTION(Return)
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Value* value() const { return inputs_[0]; }
virtual bool CanBecomeDeoptimizationTarget() const {
@@ -2080,7 +2083,7 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(ReturnInstr);
};
@@ -2088,7 +2091,7 @@ class ReturnInstr : public TemplateInstruction<1, NoThrow> {
class ThrowInstr : public TemplateInstruction<0, Throws> {
public:
- explicit ThrowInstr(intptr_t token_pos)
+ explicit ThrowInstr(TokenDescriptor token_pos)
: TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
}
@@ -2097,14 +2100,14 @@ class ThrowInstr : public TemplateInstruction<0, Throws> {
virtual intptr_t ArgumentCount() const { return 1; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual bool CanDeoptimize() const { return true; }
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
};
@@ -2114,7 +2117,7 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
public:
// '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)
+ ReThrowInstr(TokenDescriptor token_pos, intptr_t catch_try_index)
: TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
catch_try_index_(catch_try_index) {
@@ -2124,7 +2127,7 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
virtual intptr_t ArgumentCount() const { return 2; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
intptr_t catch_try_index() const { return catch_try_index_; }
virtual bool CanDeoptimize() const { return true; }
@@ -2132,7 +2135,7 @@ class ReThrowInstr : public TemplateInstruction<0, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const intptr_t catch_try_index_;
DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
@@ -2220,8 +2223,8 @@ class GotoInstr : public TemplateInstruction<0, NoThrow> {
virtual void PrintTo(BufferFormatter* f) const;
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kControlFlow;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kControlFlow;
}
private:
@@ -2297,7 +2300,7 @@ class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
Value* left() const { return inputs_[0]; }
Value* right() const { return inputs_[1]; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Token::Kind kind() const { return kind_; }
virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right) = 0;
@@ -2332,7 +2335,7 @@ class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
DEFINE_INSTRUCTION_TYPE_CHECK(Comparison)
protected:
- ComparisonInstr(intptr_t token_pos,
+ ComparisonInstr(TokenDescriptor token_pos,
Token::Kind kind,
Value* left,
Value* right,
@@ -2348,7 +2351,7 @@ class ComparisonInstr : public TemplateDefinition<2, NoThrow, Pure> {
}
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
Token::Kind kind_;
intptr_t operation_cid_; // Set by optimizer.
@@ -2380,7 +2383,7 @@ class BranchInstr : public Instruction {
Value* InputAt(intptr_t i) const { return comparison()->InputAt(i); }
- virtual intptr_t token_pos() const { return comparison_->token_pos(); }
+ virtual TokenDescriptor token_pos() const { return comparison_->token_pos(); }
virtual bool CanDeoptimize() const {
// Branches need a deoptimization info in checked mode if they
@@ -2558,7 +2561,7 @@ class ConstraintInstr : public TemplateDefinition<1, NoThrow> {
class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> {
public:
ConstantInstr(const Object& value,
- intptr_t token_pos = ClassifyingTokenPositions::kConstant);
+ TokenDescriptor token_pos = TokenDescriptor::kConstant);
DECLARE_INSTRUCTION(Constant)
virtual CompileType ComputeType() const;
@@ -2575,11 +2578,11 @@ class ConstantInstr : public TemplateDefinition<0, NoThrow, Pure> {
virtual bool AttributesEqual(Instruction* other) const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
private:
const Object& value_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(ConstantInstr);
};
@@ -2612,7 +2615,7 @@ class UnboxedConstantInstr : public ConstantInstr {
class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> {
public:
- AssertAssignableInstr(intptr_t token_pos,
+ AssertAssignableInstr(TokenDescriptor token_pos,
Value* value,
Value* instantiator_type_arguments,
const AbstractType& dst_type,
@@ -2635,7 +2638,7 @@ class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> {
Value* value() const { return inputs_[0]; }
Value* instantiator_type_arguments() const { return inputs_[1]; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
const AbstractType& dst_type() const { return dst_type_; }
void set_dst_type(const AbstractType& dst_type) {
dst_type_ = dst_type.raw();
@@ -2657,7 +2660,7 @@ class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> {
virtual bool AttributesEqual(Instruction* other) const;
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
AbstractType& dst_type_;
const String& dst_name_;
@@ -2667,7 +2670,7 @@ class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> {
class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
public:
- AssertBooleanInstr(intptr_t token_pos, Value* value)
+ AssertBooleanInstr(TokenDescriptor token_pos, Value* value)
: TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, value);
@@ -2676,7 +2679,7 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
DECLARE_INSTRUCTION(AssertBoolean)
virtual CompileType ComputeType() const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Value* value() const { return inputs_[0]; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -2688,7 +2691,7 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
virtual bool AttributesEqual(Instruction* other) const { return true; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(AssertBooleanInstr);
};
@@ -2730,7 +2733,9 @@ class ClosureCallInstr : public TemplateDefinition<1, Throws> {
DECLARE_INSTRUCTION(ClosureCall)
const Array& argument_names() const { return ast_node_.arguments()->names(); }
- virtual intptr_t token_pos() const { return ast_node_.token_pos(); }
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor(ast_node_.token_pos());
+ }
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
@@ -2756,7 +2761,7 @@ class ClosureCallInstr : public TemplateDefinition<1, Throws> {
class InstanceCallInstr : public TemplateDefinition<0, Throws> {
public:
- InstanceCallInstr(intptr_t token_pos,
+ InstanceCallInstr(TokenDescriptor token_pos,
const String& function_name,
Token::Kind token_kind,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
@@ -2797,7 +2802,7 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
// ICData can be replaced by optimizer.
void set_ic_data(const ICData* value) { ic_data_ = value; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
const String& function_name() const { return function_name_; }
Token::Kind token_kind() const { return token_kind_; }
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
@@ -2825,7 +2830,7 @@ class InstanceCallInstr : public TemplateDefinition<0, Throws> {
private:
const ICData* ic_data_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const String& function_name_;
const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL.
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
@@ -2851,7 +2856,9 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
InstanceCallInstr* instance_call() const { return instance_call_; }
bool with_checks() const { return with_checks_; }
- virtual intptr_t token_pos() const { return instance_call_->token_pos(); }
+ virtual TokenDescriptor token_pos() const {
+ return instance_call_->token_pos();
+ }
virtual intptr_t ArgumentCount() const {
return instance_call()->ArgumentCount();
@@ -2887,7 +2894,7 @@ class PolymorphicInstanceCallInstr : public TemplateDefinition<0, Throws> {
class StrictCompareInstr : public ComparisonInstr {
public:
- StrictCompareInstr(intptr_t token_pos,
+ StrictCompareInstr(TokenDescriptor token_pos,
Token::Kind kind,
Value* left,
Value* right,
@@ -2929,7 +2936,10 @@ class StrictCompareInstr : public ComparisonInstr {
// comparison pattern.
class TestSmiInstr : public ComparisonInstr {
public:
- TestSmiInstr(intptr_t token_pos, Token::Kind kind, Value* left, Value* right)
+ TestSmiInstr(TokenDescriptor token_pos,
+ Token::Kind kind,
+ Value* left,
+ Value* right)
: ComparisonInstr(token_pos, kind, left, right) {
ASSERT(kind == Token::kEQ || kind == Token::kNE);
}
@@ -2963,7 +2973,7 @@ class TestSmiInstr : public ComparisonInstr {
// TestCidInstr needs only one argument
class TestCidsInstr : public ComparisonInstr {
public:
- TestCidsInstr(intptr_t token_pos,
+ TestCidsInstr(TokenDescriptor token_pos,
Token::Kind kind,
Value* value,
const ZoneGrowableArray<intptr_t>& cid_results,
@@ -3012,7 +3022,7 @@ class TestCidsInstr : public ComparisonInstr {
class EqualityCompareInstr : public ComparisonInstr {
public:
- EqualityCompareInstr(intptr_t token_pos,
+ EqualityCompareInstr(TokenDescriptor token_pos,
Token::Kind kind,
Value* left,
Value* right,
@@ -3053,7 +3063,7 @@ class EqualityCompareInstr : public ComparisonInstr {
class RelationalOpInstr : public ComparisonInstr {
public:
- RelationalOpInstr(intptr_t token_pos,
+ RelationalOpInstr(TokenDescriptor token_pos,
Token::Kind kind,
Value* left,
Value* right,
@@ -3176,7 +3186,7 @@ class IfThenElseInstr : public Definition {
class StaticCallInstr : public TemplateDefinition<0, Throws> {
public:
- StaticCallInstr(intptr_t token_pos,
+ StaticCallInstr(TokenDescriptor token_pos,
const Function& function,
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
@@ -3208,7 +3218,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
// Accessors forwarded to the AST node.
const Function& function() const { return function_; }
const Array& argument_names() const { return argument_names_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
virtual PushArgumentInstr* PushArgumentAt(intptr_t index) const {
@@ -3252,7 +3262,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
private:
const ICData* ic_data_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const Function& function_;
const Array& argument_names_;
ZoneGrowableArray<PushArgumentInstr*>* arguments_;
@@ -3271,7 +3281,7 @@ class StaticCallInstr : public TemplateDefinition<0, Throws> {
class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
public:
LoadLocalInstr(const LocalVariable& local,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: local_(local), is_last_(false), token_pos_(token_pos) { }
DECLARE_INSTRUCTION(LoadLocal)
@@ -3291,12 +3301,12 @@ class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
void mark_last() { is_last_ = true; }
bool is_last() const { return is_last_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
private:
const LocalVariable& local_;
bool is_last_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr);
};
@@ -3321,8 +3331,8 @@ class PushTempInstr : public TemplateDefinition<1, NoThrow> {
return EffectSet::None();
}
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kTempMove;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kTempMove;
}
private:
@@ -3367,8 +3377,8 @@ class DropTempsInstr : public Definition {
return false;
}
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kTempMove;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kTempMove;
}
private:
@@ -3387,7 +3397,7 @@ class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
public:
StoreLocalInstr(const LocalVariable& local,
Value* value,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: local_(local), is_dead_(false), is_last_(false), token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -3413,13 +3423,13 @@ class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
return EffectSet::None();
}
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
private:
const LocalVariable& local_;
bool is_dead_;
bool is_last_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr);
};
@@ -3434,7 +3444,9 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
DECLARE_INSTRUCTION(NativeCall)
- virtual intptr_t token_pos() const { return ast_node_.token_pos(); }
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor(ast_node_.token_pos());
+ }
const Function& function() const { return ast_node_.function(); }
@@ -3479,7 +3491,7 @@ class NativeCallInstr : public TemplateDefinition<0, Throws> {
class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
public:
- DebugStepCheckInstr(intptr_t token_pos,
+ DebugStepCheckInstr(TokenDescriptor token_pos,
RawPcDescriptors::Kind stub_kind)
: token_pos_(token_pos),
stub_kind_(stub_kind) {
@@ -3487,13 +3499,13 @@ class DebugStepCheckInstr : public TemplateInstruction<0, NoThrow> {
DECLARE_INSTRUCTION(DebugStepCheck)
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual bool CanDeoptimize() const { return false; }
virtual EffectSet Effects() const { return EffectSet::All(); }
virtual Instruction* Canonicalize(FlowGraph* flow_graph);
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const RawPcDescriptors::Kind stub_kind_;
DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr);
@@ -3512,7 +3524,7 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
Value* instance,
Value* value,
StoreBarrierType emit_store_barrier,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: field_(field),
offset_in_bytes_(field.Offset()),
emit_store_barrier_(emit_store_barrier),
@@ -3527,7 +3539,7 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
Value* instance,
Value* value,
StoreBarrierType emit_store_barrier,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: field_(Field::ZoneHandle()),
offset_in_bytes_(offset_in_bytes),
emit_store_barrier_(emit_store_barrier),
@@ -3560,7 +3572,7 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
bool is_object_reference_initialization() const {
return is_object_reference_initialization_;
}
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
const Field& field() const { return field_; }
intptr_t offset_in_bytes() const { return offset_in_bytes_; }
@@ -3603,7 +3615,7 @@ class StoreInstanceFieldInstr : public TemplateDefinition<2, NoThrow> {
const Field& field_;
intptr_t offset_in_bytes_;
const StoreBarrierType emit_store_barrier_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
// This may be the first store to an unboxed field.
bool is_potential_unboxed_initialization_;
// True if this store initializes an object reference field of an object that
@@ -3681,7 +3693,7 @@ class GuardFieldLengthInstr : public GuardFieldInstr {
class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
public:
- LoadStaticFieldInstr(Value* field_value, intptr_t token_pos)
+ LoadStaticFieldInstr(Value* field_value, TokenDescriptor token_pos)
: token_pos_(token_pos) {
ASSERT(field_value->BindsToConstant());
SetInputAt(0, field_value);
@@ -3703,10 +3715,10 @@ class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Dependencies() const;
virtual bool AttributesEqual(Instruction* other) const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr);
};
@@ -3716,7 +3728,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
public:
StoreStaticFieldInstr(const Field& field,
Value* value,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: field_(field),
token_pos_(token_pos) {
ASSERT(field.IsZoneHandle());
@@ -3741,7 +3753,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
// are marked as having no side-effects.
virtual EffectSet Effects() const { return EffectSet::None(); }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
private:
bool CanValueBeSmi() const {
@@ -3752,7 +3764,7 @@ class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
}
const Field& field_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(StoreStaticFieldInstr);
};
@@ -3765,7 +3777,7 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
intptr_t index_scale,
intptr_t class_id,
intptr_t deopt_id,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: TemplateDefinition(deopt_id),
index_scale_(index_scale),
class_id_(class_id),
@@ -3774,7 +3786,7 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
SetInputAt(1, index);
}
- intptr_t token_pos() const { return token_pos_; }
+ TokenDescriptor token_pos() const { return token_pos_; }
DECLARE_INSTRUCTION(LoadIndexed)
virtual CompileType ComputeType() const;
@@ -3807,7 +3819,7 @@ class LoadIndexedInstr : public TemplateDefinition<2, NoThrow> {
private:
const intptr_t index_scale_;
const intptr_t class_id_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
};
@@ -3826,7 +3838,7 @@ class LoadCodeUnitsInstr : public TemplateDefinition<2, NoThrow> {
Value* index,
intptr_t element_count,
intptr_t class_id,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: class_id_(class_id),
token_pos_(token_pos),
element_count_(element_count),
@@ -3837,7 +3849,7 @@ class LoadCodeUnitsInstr : public TemplateDefinition<2, NoThrow> {
SetInputAt(1, index);
}
- intptr_t token_pos() const { return token_pos_; }
+ TokenDescriptor token_pos() const { return token_pos_; }
DECLARE_INSTRUCTION(LoadCodeUnits)
virtual CompileType ComputeType() const;
@@ -3875,7 +3887,7 @@ class LoadCodeUnitsInstr : public TemplateDefinition<2, NoThrow> {
private:
const intptr_t class_id_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const intptr_t element_count_;
Representation representation_;
@@ -3938,7 +3950,7 @@ class StringToCharCodeInstr : public TemplateDefinition<1, NoThrow, Pure> {
class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
public:
- StringInterpolateInstr(Value* value, intptr_t token_pos)
+ StringInterpolateInstr(Value* value, TokenDescriptor token_pos)
: TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
function_(Function::ZoneHandle()) {
@@ -3946,7 +3958,7 @@ class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
}
Value* value() const { return inputs_[0]; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual CompileType ComputeType() const;
// Issues a static call to Dart code which calls toString on objects.
@@ -3960,7 +3972,7 @@ class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
DECLARE_INSTRUCTION(StringInterpolate)
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
Function& function_;
DISALLOW_COPY_AND_ASSIGN(StringInterpolateInstr);
@@ -3976,7 +3988,7 @@ class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
intptr_t index_scale,
intptr_t class_id,
intptr_t deopt_id,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: TemplateDefinition(deopt_id),
emit_store_barrier_(emit_store_barrier),
index_scale_(index_scale),
@@ -4027,7 +4039,7 @@ class StoreIndexedInstr : public TemplateDefinition<3, NoThrow> {
const StoreBarrierType emit_store_barrier_;
const intptr_t index_scale_;
const intptr_t class_id_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
};
@@ -4058,7 +4070,7 @@ class BooleanNegateInstr : public TemplateDefinition<1, NoThrow> {
class InstanceOfInstr : public TemplateDefinition<2, Throws> {
public:
- InstanceOfInstr(intptr_t token_pos,
+ InstanceOfInstr(TokenDescriptor token_pos,
Value* value,
Value* instantiator_type_arguments,
const AbstractType& type,
@@ -4081,7 +4093,7 @@ class InstanceOfInstr : public TemplateDefinition<2, Throws> {
bool negate_result() const { return negate_result_; }
const AbstractType& type() const { return type_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -4090,7 +4102,7 @@ class InstanceOfInstr : public TemplateDefinition<2, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
Value* value_;
Value* type_arguments_;
const AbstractType& type_;
@@ -4102,7 +4114,7 @@ class InstanceOfInstr : public TemplateDefinition<2, Throws> {
class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
public:
- AllocateObjectInstr(intptr_t token_pos,
+ AllocateObjectInstr(TokenDescriptor token_pos,
const Class& cls,
ZoneGrowableArray<PushArgumentInstr*>* arguments)
: token_pos_(token_pos),
@@ -4123,7 +4135,7 @@ class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
}
const Class& cls() const { return cls_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
const Function& closure_function() const { return closure_function_; }
void set_closure_function(const Function& function) {
@@ -4140,7 +4152,7 @@ class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const Class& cls_;
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
AliasIdentity identity_;
@@ -4153,7 +4165,7 @@ class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> {
class AllocateUninitializedContextInstr
: public TemplateDefinition<0, NoThrow> {
public:
- AllocateUninitializedContextInstr(intptr_t token_pos,
+ AllocateUninitializedContextInstr(TokenDescriptor token_pos,
intptr_t num_context_variables)
: token_pos_(token_pos),
num_context_variables_(num_context_variables),
@@ -4162,7 +4174,7 @@ class AllocateUninitializedContextInstr
DECLARE_INSTRUCTION(AllocateUninitializedContext)
virtual CompileType ComputeType() const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
intptr_t num_context_variables() const { return num_context_variables_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -4175,7 +4187,7 @@ class AllocateUninitializedContextInstr
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const intptr_t num_context_variables_;
AliasIdentity identity_;
@@ -4299,7 +4311,7 @@ class MaterializeObjectInstr : public Definition {
class CreateArrayInstr : public TemplateDefinition<2, Throws> {
public:
- CreateArrayInstr(intptr_t token_pos,
+ CreateArrayInstr(TokenDescriptor token_pos,
Value* element_type,
Value* num_elements)
: TemplateDefinition(Thread::Current()->GetNextDeoptId()),
@@ -4317,7 +4329,7 @@ class CreateArrayInstr : public TemplateDefinition<2, Throws> {
DECLARE_INSTRUCTION(CreateArray)
virtual CompileType ComputeType() const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Value* element_type() const { return inputs_[kElementTypePos]; }
Value* num_elements() const { return inputs_[kLengthPos]; }
@@ -4331,7 +4343,7 @@ class CreateArrayInstr : public TemplateDefinition<2, Throws> {
virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
AliasIdentity identity_;
DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
@@ -4409,7 +4421,7 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
LoadFieldInstr(Value* instance,
intptr_t offset_in_bytes,
const AbstractType& type,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: offset_in_bytes_(offset_in_bytes),
type_(type),
result_cid_(kDynamicCid),
@@ -4426,7 +4438,7 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
LoadFieldInstr(Value* instance,
const Field* field,
const AbstractType& type,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: offset_in_bytes_(field->Offset()),
type_(type),
result_cid_(kDynamicCid),
@@ -4447,7 +4459,7 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
const AbstractType& type() const { return type_; }
void set_result_cid(intptr_t value) { result_cid_ = value; }
intptr_t result_cid() const { return result_cid_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
const Field* field() const { return field_; }
@@ -4495,7 +4507,7 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
MethodRecognizer::Kind recognized_kind_;
const Field* field_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr);
};
@@ -4503,7 +4515,7 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
public:
- InstantiateTypeInstr(intptr_t token_pos,
+ InstantiateTypeInstr(TokenDescriptor token_pos,
const AbstractType& type,
const Class& instantiator_class,
Value* instantiator)
@@ -4521,7 +4533,7 @@ class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
const AbstractType& type() const { return type_;
}
const Class& instantiator_class() const { return instantiator_class_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -4530,7 +4542,7 @@ class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const AbstractType& type_;
const Class& instantiator_class_;
@@ -4540,7 +4552,7 @@ class InstantiateTypeInstr : public TemplateDefinition<1, Throws> {
class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
public:
- InstantiateTypeArgumentsInstr(intptr_t token_pos,
+ InstantiateTypeArgumentsInstr(TokenDescriptor token_pos,
const TypeArguments& type_arguments,
const Class& instantiator_class,
Value* instantiator)
@@ -4559,7 +4571,7 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
return type_arguments_;
}
const Class& instantiator_class() const { return instantiator_class_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -4570,7 +4582,7 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
virtual Definition* Canonicalize(FlowGraph* flow_graph);
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const TypeArguments& type_arguments_;
const Class& instantiator_class_;
@@ -4580,7 +4592,7 @@ class InstantiateTypeArgumentsInstr : public TemplateDefinition<1, Throws> {
class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
public:
- AllocateContextInstr(intptr_t token_pos,
+ AllocateContextInstr(TokenDescriptor token_pos,
intptr_t num_context_variables)
: token_pos_(token_pos),
num_context_variables_(num_context_variables) { }
@@ -4588,7 +4600,7 @@ class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
DECLARE_INSTRUCTION(AllocateContext)
virtual CompileType ComputeType() const;
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
intptr_t num_context_variables() const { return num_context_variables_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -4598,7 +4610,7 @@ class AllocateContextInstr : public TemplateDefinition<0, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const intptr_t num_context_variables_;
DISALLOW_COPY_AND_ASSIGN(AllocateContextInstr);
@@ -4613,7 +4625,9 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
SetInputAt(0, input);
}
- virtual intptr_t token_pos() const { return field_.token_pos(); }
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor(field_.token_pos());
+ }
const Field& field() const { return field_; }
DECLARE_INSTRUCTION(InitStaticField)
@@ -4631,13 +4645,13 @@ class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
public:
- CloneContextInstr(intptr_t token_pos, Value* context_value)
+ CloneContextInstr(TokenDescriptor token_pos, Value* context_value)
: TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos) {
SetInputAt(0, context_value);
}
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Value* context_value() const { return inputs_[0]; }
DECLARE_INSTRUCTION(CloneContext)
@@ -4648,7 +4662,7 @@ class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(CloneContextInstr);
};
@@ -4768,8 +4782,8 @@ class BoxInstr : public TemplateDefinition<1, NoThrow, Pure> {
Definition* Canonicalize(FlowGraph* flow_graph);
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kBox;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kBox;
}
protected:
@@ -4894,8 +4908,8 @@ class UnboxInstr : public TemplateDefinition<1, NoThrow, Pure> {
return GetDeoptId();
}
- virtual intptr_t token_pos() const {
- return ClassifyingTokenPositions::kBox;
+ virtual TokenDescriptor token_pos() const {
+ return TokenDescriptor::kBox;
}
protected:
@@ -5214,7 +5228,7 @@ class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
Value* left,
Value* right,
intptr_t deopt_id,
- intptr_t token_pos)
+ TokenDescriptor token_pos)
: TemplateDefinition(deopt_id),
op_kind_(op_kind),
token_pos_(token_pos) {
@@ -5227,7 +5241,7 @@ class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
Token::Kind op_kind() const { return op_kind_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -5259,7 +5273,7 @@ class BinaryDoubleOpInstr : public TemplateDefinition<2, NoThrow, Pure> {
private:
const Token::Kind op_kind_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(BinaryDoubleOpInstr);
};
@@ -7165,13 +7179,13 @@ class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
public:
- CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth)
+ CheckStackOverflowInstr(TokenDescriptor token_pos, intptr_t loop_depth)
: TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
loop_depth_(loop_depth) {
}
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
bool in_loop() const { return loop_depth_ > 0; }
intptr_t loop_depth() const { return loop_depth_; }
@@ -7184,7 +7198,7 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
virtual void PrintOperandsTo(BufferFormatter* f) const;
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
const intptr_t loop_depth_;
DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr);
@@ -7194,13 +7208,13 @@ class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
// TODO(vegorov): remove this instruction in favor of Int32ToDouble.
class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
public:
- SmiToDoubleInstr(Value* value, intptr_t token_pos)
+ SmiToDoubleInstr(Value* value, TokenDescriptor token_pos)
: token_pos_(token_pos) {
SetInputAt(0, value);
}
Value* value() const { return inputs_[0]; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
DECLARE_INSTRUCTION(SmiToDouble)
virtual CompileType ComputeType() const;
@@ -7214,7 +7228,7 @@ class SmiToDoubleInstr : public TemplateDefinition<1, NoThrow, Pure> {
virtual bool AttributesEqual(Instruction* other) const { return true; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr);
};
@@ -7461,7 +7475,7 @@ class InvokeMathCFunctionInstr : public PureDefinition {
InvokeMathCFunctionInstr(ZoneGrowableArray<Value*>* inputs,
intptr_t deopt_id,
MethodRecognizer::Kind recognized_kind,
- intptr_t token_pos);
+ TokenDescriptor token_pos);
static intptr_t ArgumentCountFor(MethodRecognizer::Kind recognized_kind_);
@@ -7469,7 +7483,7 @@ class InvokeMathCFunctionInstr : public PureDefinition {
MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
DECLARE_INSTRUCTION(InvokeMathCFunction)
virtual CompileType ComputeType() const;
@@ -7514,7 +7528,7 @@ class InvokeMathCFunctionInstr : public PureDefinition {
ZoneGrowableArray<Value*>* inputs_;
const MethodRecognizer::Kind recognized_kind_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(InvokeMathCFunctionInstr);
};
@@ -7675,13 +7689,13 @@ class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
CheckClassInstr(Value* value,
intptr_t deopt_id,
const ICData& unary_checks,
- intptr_t token_pos);
+ TokenDescriptor token_pos);
DECLARE_INSTRUCTION(CheckClass)
virtual bool CanDeoptimize() const { return true; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
Value* value() const { return inputs_[0]; }
@@ -7717,7 +7731,7 @@ class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
const ICData& unary_checks_;
GrowableArray<intptr_t> cids_; // Sorted, lowest first.
bool licm_hoisted_;
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
DISALLOW_COPY_AND_ASSIGN(CheckClassInstr);
};
@@ -7725,7 +7739,7 @@ class CheckClassInstr : public TemplateInstruction<1, NoThrow> {
class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
public:
- CheckSmiInstr(Value* value, intptr_t deopt_id, intptr_t token_pos)
+ CheckSmiInstr(Value* value, intptr_t deopt_id, TokenDescriptor token_pos)
: TemplateInstruction(deopt_id),
token_pos_(token_pos),
licm_hoisted_(false) {
@@ -7733,7 +7747,7 @@ class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
}
Value* value() const { return inputs_[0]; }
- virtual intptr_t token_pos() const { return token_pos_; }
+ virtual TokenDescriptor token_pos() const { return token_pos_; }
DECLARE_INSTRUCTION(CheckSmi)
@@ -7746,7 +7760,7 @@ class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> {
void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
private:
- const intptr_t token_pos_;
+ const TokenDescriptor token_pos_;
bool licm_hoisted_;
DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr);

Powered by Google App Engine
This is Rietveld 408576698