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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 1569613002: Add a token position to LoadLocal, StoreLocal, and LoadStaticField instructions (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 unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 bool is_native_list_factory_; 3244 bool is_native_list_factory_;
3245 3245
3246 AliasIdentity identity_; 3246 AliasIdentity identity_;
3247 3247
3248 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); 3248 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr);
3249 }; 3249 };
3250 3250
3251 3251
3252 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> { 3252 class LoadLocalInstr : public TemplateDefinition<0, NoThrow> {
3253 public: 3253 public:
3254 explicit LoadLocalInstr(const LocalVariable& local) 3254 LoadLocalInstr(const LocalVariable& local,
3255 : local_(local), is_last_(false) { } 3255 intptr_t token_pos = Scanner::kNoSourcePos)
3256 : local_(local), is_last_(false), token_pos_(token_pos) { }
3256 3257
3257 DECLARE_INSTRUCTION(LoadLocal) 3258 DECLARE_INSTRUCTION(LoadLocal)
3258 virtual CompileType ComputeType() const; 3259 virtual CompileType ComputeType() const;
3259 3260
3260 const LocalVariable& local() const { return local_; } 3261 const LocalVariable& local() const { return local_; }
3261 3262
3262 virtual void PrintOperandsTo(BufferFormatter* f) const; 3263 virtual void PrintOperandsTo(BufferFormatter* f) const;
3263 3264
3264 virtual bool CanDeoptimize() const { return false; } 3265 virtual bool CanDeoptimize() const { return false; }
3265 3266
3266 virtual EffectSet Effects() const { 3267 virtual EffectSet Effects() const {
3267 UNREACHABLE(); // Eliminated by SSA construction. 3268 UNREACHABLE(); // Eliminated by SSA construction.
3268 return EffectSet::None(); 3269 return EffectSet::None();
3269 } 3270 }
3270 3271
3271 void mark_last() { is_last_ = true; } 3272 void mark_last() { is_last_ = true; }
3272 bool is_last() const { return is_last_; } 3273 bool is_last() const { return is_last_; }
3273 3274
3275 virtual intptr_t token_pos() const { return token_pos_; }
3276
3274 private: 3277 private:
3275 const LocalVariable& local_; 3278 const LocalVariable& local_;
3276 bool is_last_; 3279 bool is_last_;
3280 intptr_t token_pos_;
3277 3281
3278 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); 3282 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr);
3279 }; 3283 };
3280 3284
3281 3285
3282 class PushTempInstr : public TemplateDefinition<1, NoThrow> { 3286 class PushTempInstr : public TemplateDefinition<1, NoThrow> {
3283 public: 3287 public:
3284 explicit PushTempInstr(Value* value) { 3288 explicit PushTempInstr(Value* value) {
3285 SetInputAt(0, value); 3289 SetInputAt(0, value);
3286 } 3290 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3347 3351
3348 const intptr_t num_temps_; 3352 const intptr_t num_temps_;
3349 Value* value_; 3353 Value* value_;
3350 3354
3351 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr); 3355 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr);
3352 }; 3356 };
3353 3357
3354 3358
3355 class StoreLocalInstr : public TemplateDefinition<1, NoThrow> { 3359 class StoreLocalInstr : public TemplateDefinition<1, NoThrow> {
3356 public: 3360 public:
3357 StoreLocalInstr(const LocalVariable& local, Value* value) 3361 StoreLocalInstr(const LocalVariable& local,
3358 : local_(local), is_dead_(false), is_last_(false) { 3362 Value* value,
3363 intptr_t token_pos = Scanner::kNoSourcePos)
3364 : local_(local), is_dead_(false), is_last_(false), token_pos_(token_pos) {
3359 SetInputAt(0, value); 3365 SetInputAt(0, value);
3360 } 3366 }
3361 3367
3362 DECLARE_INSTRUCTION(StoreLocal) 3368 DECLARE_INSTRUCTION(StoreLocal)
3363 virtual CompileType ComputeType() const; 3369 virtual CompileType ComputeType() const;
3364 3370
3365 const LocalVariable& local() const { return local_; } 3371 const LocalVariable& local() const { return local_; }
3366 Value* value() const { return inputs_[0]; } 3372 Value* value() const { return inputs_[0]; }
3367 3373
3368 virtual void PrintOperandsTo(BufferFormatter* f) const; 3374 virtual void PrintOperandsTo(BufferFormatter* f) const;
3369 3375
3370 virtual bool CanDeoptimize() const { return false; } 3376 virtual bool CanDeoptimize() const { return false; }
3371 3377
3372 void mark_dead() { is_dead_ = true; } 3378 void mark_dead() { is_dead_ = true; }
3373 bool is_dead() const { return is_dead_; } 3379 bool is_dead() const { return is_dead_; }
3374 3380
3375 void mark_last() { is_last_ = true; } 3381 void mark_last() { is_last_ = true; }
3376 bool is_last() const { return is_last_; } 3382 bool is_last() const { return is_last_; }
3377 3383
3378 virtual EffectSet Effects() const { 3384 virtual EffectSet Effects() const {
3379 UNREACHABLE(); // Eliminated by SSA construction. 3385 UNREACHABLE(); // Eliminated by SSA construction.
3380 return EffectSet::None(); 3386 return EffectSet::None();
3381 } 3387 }
3382 3388
3389 virtual intptr_t token_pos() const { return token_pos_; }
3390
3383 private: 3391 private:
3384 const LocalVariable& local_; 3392 const LocalVariable& local_;
3385 bool is_dead_; 3393 bool is_dead_;
3386 bool is_last_; 3394 bool is_last_;
3395 intptr_t token_pos_;
3387 3396
3388 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); 3397 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr);
3389 }; 3398 };
3390 3399
3391 3400
3392 class NativeCallInstr : public TemplateDefinition<0, Throws> { 3401 class NativeCallInstr : public TemplateDefinition<0, Throws> {
3393 public: 3402 public:
3394 explicit NativeCallInstr(NativeBodyNode* node) 3403 explicit NativeCallInstr(NativeBodyNode* node)
3395 : ast_node_(*node), 3404 : ast_node_(*node),
3396 native_c_function_(NULL), 3405 native_c_function_(NULL),
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
3638 3647
3639 virtual bool AttributesEqual(Instruction* other) const; 3648 virtual bool AttributesEqual(Instruction* other) const;
3640 3649
3641 private: 3650 private:
3642 DISALLOW_COPY_AND_ASSIGN(GuardFieldLengthInstr); 3651 DISALLOW_COPY_AND_ASSIGN(GuardFieldLengthInstr);
3643 }; 3652 };
3644 3653
3645 3654
3646 class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> { 3655 class LoadStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
3647 public: 3656 public:
3648 explicit LoadStaticFieldInstr(Value* field_value) { 3657 LoadStaticFieldInstr(Value* field_value, intptr_t token_pos)
3658 : token_pos_(token_pos) {
3649 ASSERT(field_value->BindsToConstant()); 3659 ASSERT(field_value->BindsToConstant());
3650 SetInputAt(0, field_value); 3660 SetInputAt(0, field_value);
3651 } 3661 }
3652 3662
3653 DECLARE_INSTRUCTION(LoadStaticField) 3663 DECLARE_INSTRUCTION(LoadStaticField)
3654 virtual CompileType ComputeType() const; 3664 virtual CompileType ComputeType() const;
3655 3665
3656 const Field& StaticField() const; 3666 const Field& StaticField() const;
3657 3667
3658 Value* field_value() const { return inputs_[0]; } 3668 Value* field_value() const { return inputs_[0]; }
3659 3669
3660 virtual void PrintOperandsTo(BufferFormatter* f) const; 3670 virtual void PrintOperandsTo(BufferFormatter* f) const;
3661 3671
3662 virtual bool CanDeoptimize() const { return false; } 3672 virtual bool CanDeoptimize() const { return false; }
3663 3673
3664 virtual bool AllowsCSE() const { return StaticField().is_final(); } 3674 virtual bool AllowsCSE() const { return StaticField().is_final(); }
3665 virtual EffectSet Effects() const { return EffectSet::None(); } 3675 virtual EffectSet Effects() const { return EffectSet::None(); }
3666 virtual EffectSet Dependencies() const; 3676 virtual EffectSet Dependencies() const;
3667 virtual bool AttributesEqual(Instruction* other) const; 3677 virtual bool AttributesEqual(Instruction* other) const;
3668 3678
3679 virtual intptr_t token_pos() const { return token_pos_; }
3680
3669 private: 3681 private:
3682 intptr_t token_pos_;
3683
3670 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); 3684 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr);
3671 }; 3685 };
3672 3686
3673 3687
3674 class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> { 3688 class StoreStaticFieldInstr : public TemplateDefinition<1, NoThrow> {
3675 public: 3689 public:
3676 StoreStaticFieldInstr(const Field& field, Value* value) 3690 StoreStaticFieldInstr(const Field& field, Value* value)
3677 : field_(field) { 3691 : field_(field) {
3678 ASSERT(field.IsZoneHandle()); 3692 ASSERT(field.IsZoneHandle());
3679 SetInputAt(kValuePos, value); 3693 SetInputAt(kValuePos, value);
(...skipping 4440 matching lines...) Expand 10 before | Expand all | Expand 10 after
8120 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8134 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8121 UNIMPLEMENTED(); \ 8135 UNIMPLEMENTED(); \
8122 return NULL; \ 8136 return NULL; \
8123 } \ 8137 } \
8124 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8138 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8125 8139
8126 8140
8127 } // namespace dart 8141 } // namespace dart
8128 8142
8129 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8143 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698