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

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

Issue 197283004: Generate smaller unoptimized code for certain expressions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | 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 3412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3423 virtual bool MayThrow() const { 3423 virtual bool MayThrow() const {
3424 UNREACHABLE(); 3424 UNREACHABLE();
3425 return false; 3425 return false;
3426 } 3426 }
3427 3427
3428 private: 3428 private:
3429 DISALLOW_COPY_AND_ASSIGN(PushTempInstr); 3429 DISALLOW_COPY_AND_ASSIGN(PushTempInstr);
3430 }; 3430 };
3431 3431
3432 3432
3433 class DropTempsInstr : public TemplateDefinition<1> { 3433 class DropTempsInstr : public Definition {
3434 public: 3434 public:
3435 explicit DropTempsInstr(intptr_t num_temps, Value* value) 3435 explicit DropTempsInstr(intptr_t num_temps, Value* value = NULL)
3436 : num_temps_(num_temps) { 3436 : num_temps_(num_temps), value_(NULL) {
3437 SetInputAt(0, value); 3437 if (value != NULL) {
3438 SetInputAt(0, value);
3439 }
3438 } 3440 }
3439 3441
3440 DECLARE_INSTRUCTION(DropTemps) 3442 DECLARE_INSTRUCTION(DropTemps)
3441 3443
3442 Value* value() const { return inputs_[0]; } 3444 virtual intptr_t InputCount() const { return value_ != NULL ? 1 : 0; }
3445 virtual Value* InputAt(intptr_t i) const {
3446 ASSERT((value_ != NULL) && (i == 0));
3447 return value_;
3448 }
3449
3450 Value* value() const { return value_; }
3443 3451
3444 intptr_t num_temps() const { return num_temps_; } 3452 intptr_t num_temps() const { return num_temps_; }
3445 3453
3446 virtual CompileType* ComputeInitialType() const; 3454 virtual CompileType* ComputeInitialType() const;
3447 3455
3448 virtual void PrintOperandsTo(BufferFormatter* f) const; 3456 virtual void PrintOperandsTo(BufferFormatter* f) const;
3449 3457
3450 virtual bool CanDeoptimize() const { return false; } 3458 virtual bool CanDeoptimize() const { return false; }
3451 3459
3452 virtual EffectSet Effects() const { 3460 virtual EffectSet Effects() const {
3453 UNREACHABLE(); // Eliminated by SSA construction. 3461 UNREACHABLE(); // Eliminated by SSA construction.
3454 return EffectSet::None(); 3462 return EffectSet::None();
3455 } 3463 }
3456 3464
3457 virtual bool MayThrow() const { 3465 virtual bool MayThrow() const {
3458 UNREACHABLE(); 3466 UNREACHABLE();
3459 return false; 3467 return false;
3460 } 3468 }
3461 3469
3462 private: 3470 private:
3463 intptr_t num_temps_; 3471 virtual void RawSetInputAt(intptr_t i, Value* value) {
3472 value_ = value;
3473 }
3474
3475 const intptr_t num_temps_;
3476 Value* value_;
3464 3477
3465 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr); 3478 DISALLOW_COPY_AND_ASSIGN(DropTempsInstr);
3466 }; 3479 };
3467 3480
3468 3481
3469 class StoreLocalInstr : public TemplateDefinition<1> { 3482 class StoreLocalInstr : public TemplateDefinition<1> {
3470 public: 3483 public:
3471 StoreLocalInstr(const LocalVariable& local, Value* value) 3484 StoreLocalInstr(const LocalVariable& local, Value* value)
3472 : local_(local), is_dead_(false), is_last_(false) { 3485 : local_(local), is_dead_(false), is_last_(false) {
3473 SetInputAt(0, value); 3486 SetInputAt(0, value);
(...skipping 4230 matching lines...) Expand 10 before | Expand all | Expand 10 after
7704 ForwardInstructionIterator* current_iterator_; 7717 ForwardInstructionIterator* current_iterator_;
7705 7718
7706 private: 7719 private:
7707 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7720 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7708 }; 7721 };
7709 7722
7710 7723
7711 } // namespace dart 7724 } // namespace dart
7712 7725
7713 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7726 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698