| OLD | NEW |
| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 M(ParallelMove) \ | 430 M(ParallelMove) \ |
| 431 M(PushArgument) \ | 431 M(PushArgument) \ |
| 432 M(Return) \ | 432 M(Return) \ |
| 433 M(Throw) \ | 433 M(Throw) \ |
| 434 M(ReThrow) \ | 434 M(ReThrow) \ |
| 435 M(Goto) \ | 435 M(Goto) \ |
| 436 M(Branch) \ | 436 M(Branch) \ |
| 437 M(AssertAssignable) \ | 437 M(AssertAssignable) \ |
| 438 M(AssertBoolean) \ | 438 M(AssertBoolean) \ |
| 439 M(CurrentContext) \ | 439 M(CurrentContext) \ |
| 440 M(StoreContext) \ | |
| 441 M(ClosureCall) \ | 440 M(ClosureCall) \ |
| 442 M(InstanceCall) \ | 441 M(InstanceCall) \ |
| 443 M(PolymorphicInstanceCall) \ | 442 M(PolymorphicInstanceCall) \ |
| 444 M(StaticCall) \ | 443 M(StaticCall) \ |
| 445 M(LoadLocal) \ | 444 M(LoadLocal) \ |
| 446 M(PushTemp) \ | 445 M(PushTemp) \ |
| 447 M(DropTemps) \ | 446 M(DropTemps) \ |
| 448 M(StoreLocal) \ | 447 M(StoreLocal) \ |
| 449 M(StrictCompare) \ | 448 M(StrictCompare) \ |
| 450 M(EqualityCompare) \ | 449 M(EqualityCompare) \ |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 } | 718 } |
| 720 | 719 |
| 721 virtual LocationSummary* MakeLocationSummary(Isolate* isolate, | 720 virtual LocationSummary* MakeLocationSummary(Isolate* isolate, |
| 722 bool is_optimizing) const = 0; | 721 bool is_optimizing) const = 0; |
| 723 | 722 |
| 724 void InitializeLocationSummary(Isolate* isolate, bool optimizing) { | 723 void InitializeLocationSummary(Isolate* isolate, bool optimizing) { |
| 725 ASSERT(locs_ == NULL); | 724 ASSERT(locs_ == NULL); |
| 726 locs_ = MakeLocationSummary(isolate, optimizing); | 725 locs_ = MakeLocationSummary(isolate, optimizing); |
| 727 } | 726 } |
| 728 | 727 |
| 729 static LocationSummary* MakeCallSummary(); | 728 static LocationSummary* MakeCallSummary(Isolate* isolate); |
| 730 | 729 |
| 731 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 730 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 732 UNIMPLEMENTED(); | 731 UNIMPLEMENTED(); |
| 733 } | 732 } |
| 734 | 733 |
| 735 Environment* env() const { return env_; } | 734 Environment* env() const { return env_; } |
| 736 void SetEnvironment(Environment* deopt_env); | 735 void SetEnvironment(Environment* deopt_env); |
| 737 void RemoveEnvironment(); | 736 void RemoveEnvironment(); |
| 738 | 737 |
| 739 intptr_t lifetime_position() const { return lifetime_position_; } | 738 intptr_t lifetime_position() const { return lifetime_position_; } |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1351 virtual intptr_t PredecessorCount() const { return predecessors_.length(); } | 1350 virtual intptr_t PredecessorCount() const { return predecessors_.length(); } |
| 1352 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 1351 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 1353 return predecessors_[index]; | 1352 return predecessors_[index]; |
| 1354 } | 1353 } |
| 1355 | 1354 |
| 1356 // Returns -1 if pred is not in the list. | 1355 // Returns -1 if pred is not in the list. |
| 1357 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const; | 1356 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const; |
| 1358 | 1357 |
| 1359 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; } | 1358 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; } |
| 1360 | 1359 |
| 1361 void InsertPhi(intptr_t var_index, intptr_t var_count); | 1360 PhiInstr* InsertPhi(intptr_t var_index, intptr_t var_count); |
| 1362 void RemoveDeadPhis(Definition* replacement); | 1361 void RemoveDeadPhis(Definition* replacement); |
| 1363 | 1362 |
| 1364 void InsertPhi(PhiInstr* phi); | 1363 void InsertPhi(PhiInstr* phi); |
| 1365 void RemovePhi(PhiInstr* phi); | 1364 void RemovePhi(PhiInstr* phi); |
| 1366 | 1365 |
| 1367 virtual void PrintTo(BufferFormatter* f) const; | 1366 virtual void PrintTo(BufferFormatter* f) const; |
| 1368 | 1367 |
| 1369 virtual EffectSet Effects() const { return EffectSet::None(); } | 1368 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 1370 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 1369 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 1371 | 1370 |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 TargetEntryInstr* false_successor_; | 2322 TargetEntryInstr* false_successor_; |
| 2324 ComparisonInstr* comparison_; | 2323 ComparisonInstr* comparison_; |
| 2325 bool is_checked_; | 2324 bool is_checked_; |
| 2326 ConstrainedCompileType* constrained_type_; | 2325 ConstrainedCompileType* constrained_type_; |
| 2327 TargetEntryInstr* constant_target_; | 2326 TargetEntryInstr* constant_target_; |
| 2328 | 2327 |
| 2329 DISALLOW_COPY_AND_ASSIGN(BranchInstr); | 2328 DISALLOW_COPY_AND_ASSIGN(BranchInstr); |
| 2330 }; | 2329 }; |
| 2331 | 2330 |
| 2332 | 2331 |
| 2333 class StoreContextInstr : public TemplateInstruction<1, NoThrow> { | |
| 2334 public: | |
| 2335 explicit StoreContextInstr(Value* value) { | |
| 2336 SetInputAt(kValuePos, value); | |
| 2337 } | |
| 2338 | |
| 2339 enum { | |
| 2340 kValuePos = 0 | |
| 2341 }; | |
| 2342 | |
| 2343 DECLARE_INSTRUCTION(StoreContext) | |
| 2344 | |
| 2345 virtual intptr_t ArgumentCount() const { return 0; } | |
| 2346 | |
| 2347 Value* value() const { return inputs_[kValuePos]; } | |
| 2348 | |
| 2349 virtual bool CanDeoptimize() const { return false; } | |
| 2350 | |
| 2351 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 2352 | |
| 2353 private: | |
| 2354 DISALLOW_COPY_AND_ASSIGN(StoreContextInstr); | |
| 2355 }; | |
| 2356 | |
| 2357 | |
| 2358 class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> { | 2332 class DeoptimizeInstr : public TemplateInstruction<0, NoThrow, Pure> { |
| 2359 public: | 2333 public: |
| 2360 DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id) | 2334 DeoptimizeInstr(ICData::DeoptReasonId deopt_reason, intptr_t deopt_id) |
| 2361 : TemplateInstruction(deopt_id), | 2335 : TemplateInstruction(deopt_id), |
| 2362 deopt_reason_(deopt_reason) { | 2336 deopt_reason_(deopt_reason) { |
| 2363 } | 2337 } |
| 2364 | 2338 |
| 2365 virtual intptr_t ArgumentCount() const { return 0; } | 2339 virtual intptr_t ArgumentCount() const { return 0; } |
| 2366 | 2340 |
| 2367 virtual bool CanDeoptimize() const { return true; } | 2341 virtual bool CanDeoptimize() const { return true; } |
| (...skipping 5551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7919 Isolate* isolate, bool opt) const { \ | 7893 Isolate* isolate, bool opt) const { \ |
| 7920 UNIMPLEMENTED(); \ | 7894 UNIMPLEMENTED(); \ |
| 7921 return NULL; \ | 7895 return NULL; \ |
| 7922 } \ | 7896 } \ |
| 7923 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 7897 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 7924 | 7898 |
| 7925 | 7899 |
| 7926 } // namespace dart | 7900 } // namespace dart |
| 7927 | 7901 |
| 7928 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7902 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |