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

Side by Side Diff: src/deoptimizer.h

Issue 177293009: Handle arguments objects in frame when materializing arguments (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « no previous file | src/deoptimizer.cc » ('j') | src/deoptimizer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 TAGGED, 787 TAGGED,
788 INT32, 788 INT32,
789 UINT32, 789 UINT32,
790 DOUBLE, 790 DOUBLE,
791 LITERAL, 791 LITERAL,
792 DEFERRED_OBJECT, // Object captured by the escape analysis. 792 DEFERRED_OBJECT, // Object captured by the escape analysis.
793 // The number of nested objects can be obtained 793 // The number of nested objects can be obtained
794 // with the DeferredObjectLength() method 794 // with the DeferredObjectLength() method
795 // (the SlotRefs of the nested objects follow 795 // (the SlotRefs of the nested objects follow
796 // this SlotRef in the depth-first order.) 796 // this SlotRef in the depth-first order.)
797 DUPLICATE_OBJECT // Duplicated object of a deferred object. 797 DUPLICATE_OBJECT, // Duplicated object of a deferred object.
798 ARGUMENTS_OBJECT // Arguments object - only used to keep indexing
799 // in sync, it should not be materialized.
798 }; 800 };
799 801
800 SlotRef() 802 SlotRef()
801 : addr_(NULL), representation_(UNKNOWN) { } 803 : addr_(NULL), representation_(UNKNOWN) { }
802 804
803 SlotRef(Address addr, SlotRepresentation representation) 805 SlotRef(Address addr, SlotRepresentation representation)
804 : addr_(addr), representation_(representation) { } 806 : addr_(addr), representation_(representation) { }
805 807
806 SlotRef(Isolate* isolate, Object* literal) 808 SlotRef(Isolate* isolate, Object* literal)
807 : literal_(literal, isolate), representation_(LITERAL) { } 809 : literal_(literal, isolate), representation_(LITERAL) { }
808 810
811 static SlotRef NewArgumentsObject(int length) {
812 SlotRef slot;
813 slot.representation_ = ARGUMENTS_OBJECT;
814 slot.deferred_object_length_ = length;
815 return slot;
816 }
817
809 static SlotRef NewDeferredObject(int length) { 818 static SlotRef NewDeferredObject(int length) {
810 SlotRef slot; 819 SlotRef slot;
811 slot.representation_ = DEFERRED_OBJECT; 820 slot.representation_ = DEFERRED_OBJECT;
812 slot.deferred_object_length_ = length; 821 slot.deferred_object_length_ = length;
813 return slot; 822 return slot;
814 } 823 }
815 824
816 SlotRepresentation Representation() { return representation_; } 825 SlotRepresentation Representation() { return representation_; }
817 826
818 static SlotRef NewDuplicateObject(int id) { 827 static SlotRef NewDuplicateObject(int id) {
819 SlotRef slot; 828 SlotRef slot;
820 slot.representation_ = DUPLICATE_OBJECT; 829 slot.representation_ = DUPLICATE_OBJECT;
821 slot.duplicate_object_id_ = id; 830 slot.duplicate_object_id_ = id;
822 return slot; 831 return slot;
823 } 832 }
824 833
825 int DeferredObjectLength() { return deferred_object_length_; } 834 int GetChildrenCount() {
835 if (representation_ == DEFERRED_OBJECT ||
836 representation_ == ARGUMENTS_OBJECT) {
837 return deferred_object_length_;
838 } else {
839 return 0;
840 }
841 }
826 842
827 int DuplicateObjectId() { return duplicate_object_id_; } 843 int DuplicateObjectId() { return duplicate_object_id_; }
828 844
829 Handle<Object> GetValue(Isolate* isolate); 845 Handle<Object> GetValue(Isolate* isolate);
830 846
831 private: 847 private:
832 Address addr_; 848 Address addr_;
833 Handle<Object> literal_; 849 Handle<Object> literal_;
834 SlotRepresentation representation_; 850 SlotRepresentation representation_;
835 int deferred_object_length_; 851 int deferred_object_length_;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 Object** expression_stack_; 989 Object** expression_stack_;
974 int source_position_; 990 int source_position_;
975 991
976 friend class Deoptimizer; 992 friend class Deoptimizer;
977 }; 993 };
978 #endif 994 #endif
979 995
980 } } // namespace v8::internal 996 } } // namespace v8::internal
981 997
982 #endif // V8_DEOPTIMIZER_H_ 998 #endif // V8_DEOPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/deoptimizer.cc » ('j') | src/deoptimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698