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

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

Issue 14942010: Eliminate temporary locals for some expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: cleaned up Created 7 years, 6 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 | Annotate | Revision Log
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 M(AssertAssignable) \ 522 M(AssertAssignable) \
523 M(AssertBoolean) \ 523 M(AssertBoolean) \
524 M(ArgumentDefinitionTest) \ 524 M(ArgumentDefinitionTest) \
525 M(CurrentContext) \ 525 M(CurrentContext) \
526 M(StoreContext) \ 526 M(StoreContext) \
527 M(ClosureCall) \ 527 M(ClosureCall) \
528 M(InstanceCall) \ 528 M(InstanceCall) \
529 M(PolymorphicInstanceCall) \ 529 M(PolymorphicInstanceCall) \
530 M(StaticCall) \ 530 M(StaticCall) \
531 M(LoadLocal) \ 531 M(LoadLocal) \
532 M(PushTemp) \
533 M(DropTemps) \
532 M(StoreLocal) \ 534 M(StoreLocal) \
533 M(StrictCompare) \ 535 M(StrictCompare) \
534 M(EqualityCompare) \ 536 M(EqualityCompare) \
535 M(RelationalOp) \ 537 M(RelationalOp) \
536 M(NativeCall) \ 538 M(NativeCall) \
537 M(LoadIndexed) \ 539 M(LoadIndexed) \
538 M(StoreIndexed) \ 540 M(StoreIndexed) \
539 M(StoreInstanceField) \ 541 M(StoreInstanceField) \
540 M(LoadStaticField) \ 542 M(LoadStaticField) \
541 M(StoreStaticField) \ 543 M(StoreStaticField) \
(...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 } 3140 }
3139 3141
3140 private: 3142 private:
3141 const LocalVariable& local_; 3143 const LocalVariable& local_;
3142 bool is_last_; 3144 bool is_last_;
3143 3145
3144 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); 3146 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr);
3145 }; 3147 };
3146 3148
3147 3149
3150 class PushTempInstr : public TemplateDefinition<1> {
3151 public:
3152 explicit PushTempInstr(Value* value) {
3153 SetInputAt(0, value);
3154 }
3155
3156 DECLARE_INSTRUCTION(PushTemp)
3157
3158 Value* value() const { return inputs_[0]; }
3159
3160 virtual CompileType ComputeType() const;
3161
3162 virtual bool CanDeoptimize() const { return false; }
3163
3164 virtual EffectSet Effects() const {
3165 UNREACHABLE(); // Eliminated by SSA construction.
3166 return EffectSet::None();
3167 }
3168
3169 virtual bool MayThrow() const {
3170 UNREACHABLE();
3171 return false;
3172 }
3173
srdjan 2013/05/28 13:30:43 private:
Florian Schneider 2013/05/30 09:29:31 Done.
3174 DISALLOW_COPY_AND_ASSIGN(PushTempInstr);
3175 };
3176
3177
3178 class DropTempsInstr : public TemplateDefinition<1> {
3179 public:
3180 explicit DropTempsInstr(intptr_t num_temps, Value* value)
3181 : num_temps_(num_temps) {
3182 SetInputAt(0, value);
3183 }
3184
3185 DECLARE_INSTRUCTION(DropTemps)
3186
3187 Value* value() const { return inputs_[0]; }
3188
3189 intptr_t num_temps() const { return num_temps_; }
3190
3191 virtual CompileType ComputeType() const;
3192
3193 virtual bool CanDeoptimize() const { return false; }
3194
3195 virtual EffectSet Effects() const {
3196 UNREACHABLE(); // Eliminated by SSA construction.
3197 return EffectSet::None();
3198 }
3199
3200 virtual bool MayThrow() const {
3201 UNREACHABLE();
3202 return false;
3203 }
3204
3205 private:
3206 intptr_t num_temps_;
3207
3208 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr);
3209 };
3210
3211
3148 class StoreLocalInstr : public TemplateDefinition<1> { 3212 class StoreLocalInstr : public TemplateDefinition<1> {
3149 public: 3213 public:
3150 StoreLocalInstr(const LocalVariable& local, Value* value) 3214 StoreLocalInstr(const LocalVariable& local, Value* value)
3151 : local_(local), is_dead_(false), is_last_(false) { 3215 : local_(local), is_dead_(false), is_last_(false) {
3152 SetInputAt(0, value); 3216 SetInputAt(0, value);
3153 } 3217 }
3154 3218
3155 DECLARE_INSTRUCTION(StoreLocal) 3219 DECLARE_INSTRUCTION(StoreLocal)
3156 virtual CompileType* ComputeInitialType() const; 3220 virtual CompileType* ComputeInitialType() const;
3157 3221
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after
6410 ForwardInstructionIterator* current_iterator_; 6474 ForwardInstructionIterator* current_iterator_;
6411 6475
6412 private: 6476 private:
6413 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6477 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
6414 }; 6478 };
6415 6479
6416 6480
6417 } // namespace dart 6481 } // namespace dart
6418 6482
6419 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6483 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698