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

Side by Side Diff: src/type-info.h

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
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 | « src/transitions-inl.h ('k') | src/type-info.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 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 27 matching lines...) Expand all
38 38
39 // Forward declarations. 39 // Forward declarations.
40 class ICStub; 40 class ICStub;
41 class SmallMapList; 41 class SmallMapList;
42 42
43 43
44 class TypeFeedbackOracle: public ZoneObject { 44 class TypeFeedbackOracle: public ZoneObject {
45 public: 45 public:
46 TypeFeedbackOracle(Handle<Code> code, 46 TypeFeedbackOracle(Handle<Code> code,
47 Handle<Context> native_context, 47 Handle<Context> native_context,
48 Isolate* isolate,
49 Zone* zone); 48 Zone* zone);
50 49
51 bool LoadIsUninitialized(TypeFeedbackId id); 50 bool LoadIsUninitialized(TypeFeedbackId id);
52 bool LoadIsPreMonomorphic(TypeFeedbackId id);
53 bool StoreIsUninitialized(TypeFeedbackId id); 51 bool StoreIsUninitialized(TypeFeedbackId id);
54 bool StoreIsPreMonomorphic(TypeFeedbackId id);
55 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); 52 bool StoreIsKeyedPolymorphic(TypeFeedbackId id);
53 bool CallIsMonomorphic(int slot);
56 bool CallIsMonomorphic(TypeFeedbackId aid); 54 bool CallIsMonomorphic(TypeFeedbackId aid);
57 bool KeyedArrayCallIsHoley(TypeFeedbackId id); 55 bool KeyedArrayCallIsHoley(TypeFeedbackId id);
58 bool CallNewIsMonomorphic(TypeFeedbackId id); 56 bool CallNewIsMonomorphic(int slot);
59 57
60 // TODO(1571) We can't use ForInStatement::ForInType as the return value due 58 // TODO(1571) We can't use ForInStatement::ForInType as the return value due
61 // to various cycles in our headers. 59 // to various cycles in our headers.
62 // TODO(rossberg): once all oracle access is removed from ast.cc, it should 60 // TODO(rossberg): once all oracle access is removed from ast.cc, it should
63 // be possible. 61 // be possible.
64 byte ForInType(TypeFeedbackId id); 62 byte ForInType(int feedback_vector_slot);
65 63
66 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id); 64 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id);
67 65
68 void CallReceiverTypes(TypeFeedbackId id,
69 Handle<String> name,
70 int arity,
71 SmallMapList* types);
72 void PropertyReceiverTypes(TypeFeedbackId id, 66 void PropertyReceiverTypes(TypeFeedbackId id,
73 Handle<String> name, 67 Handle<String> name,
74 SmallMapList* receiver_types, 68 SmallMapList* receiver_types,
75 bool* is_prototype); 69 bool* is_prototype);
76 void KeyedPropertyReceiverTypes(TypeFeedbackId id, 70 void KeyedPropertyReceiverTypes(TypeFeedbackId id,
77 SmallMapList* receiver_types, 71 SmallMapList* receiver_types,
78 bool* is_string); 72 bool* is_string);
79 void AssignmentReceiverTypes(TypeFeedbackId id, 73 void AssignmentReceiverTypes(TypeFeedbackId id,
80 Handle<String> name, 74 Handle<String> name,
81 SmallMapList* receiver_types); 75 SmallMapList* receiver_types);
82 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, 76 void KeyedAssignmentReceiverTypes(TypeFeedbackId id,
83 SmallMapList* receiver_types, 77 SmallMapList* receiver_types,
84 KeyedAccessStoreMode* store_mode); 78 KeyedAccessStoreMode* store_mode);
85 void CountReceiverTypes(TypeFeedbackId id, 79 void CountReceiverTypes(TypeFeedbackId id,
86 SmallMapList* receiver_types); 80 SmallMapList* receiver_types);
87 81
88 void CollectReceiverTypes(TypeFeedbackId id, 82 void CollectReceiverTypes(TypeFeedbackId id,
89 SmallMapList* types); 83 SmallMapList* types);
90 84
91 static bool CanRetainOtherContext(Map* map, Context* native_context); 85 static bool CanRetainOtherContext(Map* map, Context* native_context);
92 static bool CanRetainOtherContext(JSFunction* function, 86 static bool CanRetainOtherContext(JSFunction* function,
93 Context* native_context); 87 Context* native_context);
94 88
95 CheckType GetCallCheckType(TypeFeedbackId id); 89 Handle<JSFunction> GetCallTarget(int slot);
96 Handle<JSFunction> GetCallTarget(TypeFeedbackId id); 90 Handle<JSFunction> GetCallNewTarget(int slot);
97 Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id); 91 Handle<AllocationSite> GetCallNewAllocationSite(int slot);
98 Handle<Cell> GetCallNewAllocationInfoCell(TypeFeedbackId id);
99 92
100 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); 93 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
101 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); 94 bool LoadIsStub(TypeFeedbackId id, ICStub* stub);
102 95
103 // TODO(1571) We can't use ToBooleanStub::Types as the return value because 96 // TODO(1571) We can't use ToBooleanStub::Types as the return value because
104 // of various cycles in our headers. Death to tons of implementations in 97 // of various cycles in our headers. Death to tons of implementations in
105 // headers!! :-P 98 // headers!! :-P
106 byte ToBooleanTypes(TypeFeedbackId id); 99 byte ToBooleanTypes(TypeFeedbackId id);
107 100
108 // Get type information for arithmetic operations and compares. 101 // Get type information for arithmetic operations and compares.
109 void BinaryType(TypeFeedbackId id, 102 void BinaryType(TypeFeedbackId id,
110 Handle<Type>* left, 103 Type** left,
111 Handle<Type>* right, 104 Type** right,
112 Handle<Type>* result, 105 Type** result,
113 Maybe<int>* fixed_right_arg, 106 Maybe<int>* fixed_right_arg,
114 Handle<AllocationSite>* allocation_site, 107 Handle<AllocationSite>* allocation_site,
115 Token::Value operation); 108 Token::Value operation);
116 109
117 void CompareType(TypeFeedbackId id, 110 void CompareType(TypeFeedbackId id,
118 Handle<Type>* left, 111 Type** left,
119 Handle<Type>* right, 112 Type** right,
120 Handle<Type>* combined); 113 Type** combined);
121 114
122 Handle<Type> CountType(TypeFeedbackId id); 115 Type* CountType(TypeFeedbackId id);
123 116
124 Zone* zone() const { return zone_; } 117 Zone* zone() const { return zone_; }
125 Isolate* isolate() const { return isolate_; } 118 Isolate* isolate() const { return zone_->isolate(); }
126 119
127 private: 120 private:
128 void CollectReceiverTypes(TypeFeedbackId id, 121 void CollectReceiverTypes(TypeFeedbackId id,
129 Handle<String> name, 122 Handle<String> name,
130 Code::Flags flags, 123 Code::Flags flags,
131 SmallMapList* types); 124 SmallMapList* types);
132 125
133 void SetInfo(TypeFeedbackId id, Object* target); 126 void SetInfo(TypeFeedbackId id, Object* target);
134 127
135 void BuildDictionary(Handle<Code> code); 128 void BuildDictionary(Handle<Code> code);
136 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); 129 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos);
137 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); 130 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos);
138 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, 131 void RelocateRelocInfos(ZoneList<RelocInfo>* infos,
139 byte* old_start, 132 byte* old_start,
140 byte* new_start); 133 byte* new_start);
141 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); 134 void ProcessRelocInfos(ZoneList<RelocInfo>* infos);
142 void ProcessTypeFeedbackCells(Handle<Code> code);
143 135
144 // Returns an element from the backing store. Returns undefined if 136 // Returns an element from the backing store. Returns undefined if
145 // there is no information. 137 // there is no information.
146 Handle<Object> GetInfo(TypeFeedbackId id); 138 Handle<Object> GetInfo(TypeFeedbackId id);
147 139
148 // Return the cell that contains type feedback. 140 // Returns an element from the type feedback vector. Returns undefined
149 Handle<Cell> GetInfoCell(TypeFeedbackId id); 141 // if there is no information.
142 Handle<Object> GetInfo(int slot);
150 143
151 private: 144 private:
152 Handle<Context> native_context_; 145 Handle<Context> native_context_;
153 Isolate* isolate_;
154 Zone* zone_; 146 Zone* zone_;
155 Handle<UnseededNumberDictionary> dictionary_; 147 Handle<UnseededNumberDictionary> dictionary_;
148 Handle<FixedArray> feedback_vector_;
156 149
157 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 150 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
158 }; 151 };
159 152
160 } } // namespace v8::internal 153 } } // namespace v8::internal
161 154
162 #endif // V8_TYPE_INFO_H_ 155 #endif // V8_TYPE_INFO_H_
OLDNEW
« no previous file with comments | « src/transitions-inl.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698