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

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

Issue 26823006: Record a correct deoptimization environment for slow-path code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use an environment value's representation to decide its size. Created 7 years, 2 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 6735 matching lines...) Expand 10 before | Expand all | Expand 10 after
6746 } 6746 }
6747 return env->ValueAt(index); 6747 return env->ValueAt(index);
6748 } 6748 }
6749 6749
6750 intptr_t fixed_parameter_count() const { 6750 intptr_t fixed_parameter_count() const {
6751 return fixed_parameter_count_; 6751 return fixed_parameter_count_;
6752 } 6752 }
6753 6753
6754 const Function& function() const { return function_; } 6754 const Function& function() const { return function_; }
6755 6755
6756 Environment* DeepCopy() const { return DeepCopy(Length()); }
6757
6756 void DeepCopyTo(Instruction* instr) const; 6758 void DeepCopyTo(Instruction* instr) const;
6757 void DeepCopyToOuter(Instruction* instr) const; 6759 void DeepCopyToOuter(Instruction* instr) const;
6758 6760
6759 void PrintTo(BufferFormatter* f) const; 6761 void PrintTo(BufferFormatter* f) const;
6760 6762
6761 private: 6763 private:
6762 friend class ShallowIterator; 6764 friend class ShallowIterator;
6763 6765
6764 Environment(intptr_t length, 6766 Environment(intptr_t length,
6765 intptr_t fixed_parameter_count, 6767 intptr_t fixed_parameter_count,
6766 intptr_t deopt_id, 6768 intptr_t deopt_id,
6767 const Function& function, 6769 const Function& function,
6768 Environment* outer) 6770 Environment* outer)
6769 : values_(length), 6771 : values_(length),
6770 locations_(NULL), 6772 locations_(NULL),
6771 fixed_parameter_count_(fixed_parameter_count), 6773 fixed_parameter_count_(fixed_parameter_count),
6772 deopt_id_(deopt_id), 6774 deopt_id_(deopt_id),
6773 function_(function), 6775 function_(function),
6774 outer_(outer) { } 6776 outer_(outer) { }
6775 6777
6776 // Deep copy an environment. A 'length' parameter can be given, which may 6778 // Deep copy an environment. The 'length' parameter may be less than the
6777 // be less than the environment's length in order to drop values (e.g., 6779 // environment's length in order to drop values (e.g., passed arguments)
6778 // passed arguments) from the copy. 6780 // from the copy.
6779 Environment* DeepCopy() const { return DeepCopy(Length()); }
6780 Environment* DeepCopy(intptr_t length) const; 6781 Environment* DeepCopy(intptr_t length) const;
6781 6782
6782 GrowableArray<Value*> values_; 6783 GrowableArray<Value*> values_;
6783 Location* locations_; 6784 Location* locations_;
6784 const intptr_t fixed_parameter_count_; 6785 const intptr_t fixed_parameter_count_;
6785 intptr_t deopt_id_; 6786 intptr_t deopt_id_;
6786 const Function& function_; 6787 const Function& function_;
6787 Environment* outer_; 6788 Environment* outer_;
6788 6789
6789 DISALLOW_COPY_AND_ASSIGN(Environment); 6790 DISALLOW_COPY_AND_ASSIGN(Environment);
(...skipping 30 matching lines...) Expand all
6820 ForwardInstructionIterator* current_iterator_; 6821 ForwardInstructionIterator* current_iterator_;
6821 6822
6822 private: 6823 private:
6823 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 6824 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
6824 }; 6825 };
6825 6826
6826 6827
6827 } // namespace dart 6828 } // namespace dart
6828 6829
6829 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 6830 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698