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

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

Issue 137403009: Adding a type vector to replace type cells. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed feedback. Created 6 years, 10 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/scopes.cc ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 Zone* zone); 48 Zone* zone);
49 49
50 bool LoadIsUninitialized(TypeFeedbackId id); 50 bool LoadIsUninitialized(TypeFeedbackId id);
51 bool StoreIsUninitialized(TypeFeedbackId id); 51 bool StoreIsUninitialized(TypeFeedbackId id);
52 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); 52 bool StoreIsKeyedPolymorphic(TypeFeedbackId id);
53 bool CallIsMonomorphic(int slot);
53 bool CallIsMonomorphic(TypeFeedbackId aid); 54 bool CallIsMonomorphic(TypeFeedbackId aid);
54 bool CallNewIsMonomorphic(TypeFeedbackId id); 55 bool KeyedArrayCallIsHoley(TypeFeedbackId id);
56 bool CallNewIsMonomorphic(int slot);
55 57
56 // 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
57 // to various cycles in our headers. 59 // to various cycles in our headers.
58 // 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
59 // be possible. 61 // be possible.
60 byte ForInType(TypeFeedbackId id); 62 byte ForInType(int feedback_vector_slot);
61 63
62 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id); 64 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id);
63 65
64 void PropertyReceiverTypes(TypeFeedbackId id, 66 void PropertyReceiverTypes(TypeFeedbackId id,
65 Handle<String> name, 67 Handle<String> name,
66 SmallMapList* receiver_types, 68 SmallMapList* receiver_types,
67 bool* is_prototype); 69 bool* is_prototype);
68 void KeyedPropertyReceiverTypes(TypeFeedbackId id, 70 void KeyedPropertyReceiverTypes(TypeFeedbackId id,
69 SmallMapList* receiver_types, 71 SmallMapList* receiver_types,
70 bool* is_string); 72 bool* is_string);
71 void AssignmentReceiverTypes(TypeFeedbackId id, 73 void AssignmentReceiverTypes(TypeFeedbackId id,
72 Handle<String> name, 74 Handle<String> name,
73 SmallMapList* receiver_types); 75 SmallMapList* receiver_types);
74 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, 76 void KeyedAssignmentReceiverTypes(TypeFeedbackId id,
75 SmallMapList* receiver_types, 77 SmallMapList* receiver_types,
76 KeyedAccessStoreMode* store_mode); 78 KeyedAccessStoreMode* store_mode);
77 void CountReceiverTypes(TypeFeedbackId id, 79 void CountReceiverTypes(TypeFeedbackId id,
78 SmallMapList* receiver_types); 80 SmallMapList* receiver_types);
79 81
80 void CollectReceiverTypes(TypeFeedbackId id, 82 void CollectReceiverTypes(TypeFeedbackId id,
81 SmallMapList* types); 83 SmallMapList* types);
82 84
83 static bool CanRetainOtherContext(Map* map, Context* native_context); 85 static bool CanRetainOtherContext(Map* map, Context* native_context);
84 static bool CanRetainOtherContext(JSFunction* function, 86 static bool CanRetainOtherContext(JSFunction* function,
85 Context* native_context); 87 Context* native_context);
86 88
87 Handle<JSFunction> GetCallTarget(TypeFeedbackId id); 89 Handle<JSFunction> GetCallTarget(int slot);
88 Handle<JSFunction> GetCallNewTarget(TypeFeedbackId id); 90 Handle<JSFunction> GetCallNewTarget(int slot);
89 Handle<AllocationSite> GetCallNewAllocationSite(TypeFeedbackId id); 91 Handle<AllocationSite> GetCallNewAllocationSite(int slot);
90 92
91 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); 93 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
92 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); 94 bool LoadIsStub(TypeFeedbackId id, ICStub* stub);
93 95
94 // 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
95 // 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
96 // headers!! :-P 98 // headers!! :-P
97 byte ToBooleanTypes(TypeFeedbackId id); 99 byte ToBooleanTypes(TypeFeedbackId id);
98 100
99 // Get type information for arithmetic operations and compares. 101 // Get type information for arithmetic operations and compares.
(...skipping 23 matching lines...) Expand all
123 125
124 void SetInfo(TypeFeedbackId id, Object* target); 126 void SetInfo(TypeFeedbackId id, Object* target);
125 127
126 void BuildDictionary(Handle<Code> code); 128 void BuildDictionary(Handle<Code> code);
127 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); 129 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos);
128 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); 130 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos);
129 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, 131 void RelocateRelocInfos(ZoneList<RelocInfo>* infos,
130 byte* old_start, 132 byte* old_start,
131 byte* new_start); 133 byte* new_start);
132 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); 134 void ProcessRelocInfos(ZoneList<RelocInfo>* infos);
133 void ProcessTypeFeedbackCells(Handle<Code> code);
134 135
135 // Returns an element from the backing store. Returns undefined if 136 // Returns an element from the backing store. Returns undefined if
136 // there is no information. 137 // there is no information.
137 Handle<Object> GetInfo(TypeFeedbackId id); 138 Handle<Object> GetInfo(TypeFeedbackId id);
138 139
140 // Returns an element from the type feedback vector. Returns undefined
141 // if there is no information.
142 Handle<Object> GetInfo(int slot);
143
139 private: 144 private:
140 Handle<Context> native_context_; 145 Handle<Context> native_context_;
141 Zone* zone_; 146 Zone* zone_;
142 Handle<UnseededNumberDictionary> dictionary_; 147 Handle<UnseededNumberDictionary> dictionary_;
148 Handle<FixedArray> feedback_vector_;
143 149
144 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 150 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
145 }; 151 };
146 152
147 } } // namespace v8::internal 153 } } // namespace v8::internal
148 154
149 #endif // V8_TYPE_INFO_H_ 155 #endif // V8_TYPE_INFO_H_
OLDNEW
« no previous file with comments | « src/scopes.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698