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

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

Issue 641373002: Introduce FeedbackVectorSlot type - better than int. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 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
« no previous file with comments | « src/mips/lithium-codegen-mips.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TYPE_INFO_H_ 5 #ifndef V8_TYPE_INFO_H_
6 #define V8_TYPE_INFO_H_ 6 #define V8_TYPE_INFO_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/types.h" 10 #include "src/types.h"
11 #include "src/zone-inl.h" 11 #include "src/zone-inl.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 // Forward declarations. 16 // Forward declarations.
17 class SmallMapList; 17 class SmallMapList;
18 18
19 19
20 class TypeFeedbackOracle: public ZoneObject { 20 class TypeFeedbackOracle: public ZoneObject {
21 public: 21 public:
22 TypeFeedbackOracle(Handle<Code> code, 22 TypeFeedbackOracle(Handle<Code> code,
23 Handle<TypeFeedbackVector> feedback_vector, 23 Handle<TypeFeedbackVector> feedback_vector,
24 Handle<Context> native_context, Zone* zone); 24 Handle<Context> native_context, Zone* zone);
25 25
26 bool LoadIsUninitialized(TypeFeedbackId id); 26 bool LoadIsUninitialized(TypeFeedbackId id);
27 bool StoreIsUninitialized(TypeFeedbackId id); 27 bool StoreIsUninitialized(TypeFeedbackId id);
28 bool CallIsMonomorphic(int slot); 28 bool CallIsMonomorphic(FeedbackVectorSlot slot);
29 bool CallIsMonomorphic(TypeFeedbackId aid); 29 bool CallIsMonomorphic(TypeFeedbackId aid);
30 bool KeyedArrayCallIsHoley(TypeFeedbackId id); 30 bool KeyedArrayCallIsHoley(TypeFeedbackId id);
31 bool CallNewIsMonomorphic(int slot); 31 bool CallNewIsMonomorphic(FeedbackVectorSlot slot);
32 32
33 // TODO(1571) We can't use ForInStatement::ForInType as the return value due 33 // TODO(1571) We can't use ForInStatement::ForInType as the return value due
34 // to various cycles in our headers. 34 // to various cycles in our headers.
35 // TODO(rossberg): once all oracle access is removed from ast.cc, it should 35 // TODO(rossberg): once all oracle access is removed from ast.cc, it should
36 // be possible. 36 // be possible.
37 byte ForInType(int feedback_vector_slot); 37 byte ForInType(FeedbackVectorSlot feedback_vector_slot);
38 38
39 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id); 39 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id);
40 40
41 void PropertyReceiverTypes(TypeFeedbackId id, Handle<String> name, 41 void PropertyReceiverTypes(TypeFeedbackId id, Handle<String> name,
42 SmallMapList* receiver_types); 42 SmallMapList* receiver_types);
43 void KeyedPropertyReceiverTypes(TypeFeedbackId id, 43 void KeyedPropertyReceiverTypes(TypeFeedbackId id,
44 SmallMapList* receiver_types, 44 SmallMapList* receiver_types,
45 bool* is_string); 45 bool* is_string);
46 void AssignmentReceiverTypes(TypeFeedbackId id, 46 void AssignmentReceiverTypes(TypeFeedbackId id,
47 Handle<String> name, 47 Handle<String> name,
48 SmallMapList* receiver_types); 48 SmallMapList* receiver_types);
49 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, 49 void KeyedAssignmentReceiverTypes(TypeFeedbackId id,
50 SmallMapList* receiver_types, 50 SmallMapList* receiver_types,
51 KeyedAccessStoreMode* store_mode); 51 KeyedAccessStoreMode* store_mode);
52 void CountReceiverTypes(TypeFeedbackId id, 52 void CountReceiverTypes(TypeFeedbackId id,
53 SmallMapList* receiver_types); 53 SmallMapList* receiver_types);
54 54
55 void CollectReceiverTypes(TypeFeedbackId id, 55 void CollectReceiverTypes(TypeFeedbackId id,
56 SmallMapList* types); 56 SmallMapList* types);
57 57
58 static bool CanRetainOtherContext(Map* map, Context* native_context); 58 static bool CanRetainOtherContext(Map* map, Context* native_context);
59 static bool CanRetainOtherContext(JSFunction* function, 59 static bool CanRetainOtherContext(JSFunction* function,
60 Context* native_context); 60 Context* native_context);
61 61
62 Handle<JSFunction> GetCallTarget(int slot); 62 Handle<JSFunction> GetCallTarget(FeedbackVectorSlot slot);
63 Handle<AllocationSite> GetCallAllocationSite(int slot); 63 Handle<AllocationSite> GetCallAllocationSite(FeedbackVectorSlot slot);
64 Handle<JSFunction> GetCallNewTarget(int slot); 64 Handle<JSFunction> GetCallNewTarget(FeedbackVectorSlot slot);
65 Handle<AllocationSite> GetCallNewAllocationSite(int slot); 65 Handle<AllocationSite> GetCallNewAllocationSite(FeedbackVectorSlot slot);
66 66
67 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); 67 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
68 68
69 // TODO(1571) We can't use ToBooleanStub::Types as the return value because 69 // TODO(1571) We can't use ToBooleanStub::Types as the return value because
70 // of various cycles in our headers. Death to tons of implementations in 70 // of various cycles in our headers. Death to tons of implementations in
71 // headers!! :-P 71 // headers!! :-P
72 byte ToBooleanTypes(TypeFeedbackId id); 72 byte ToBooleanTypes(TypeFeedbackId id);
73 73
74 // Get type information for arithmetic operations and compares. 74 // Get type information for arithmetic operations and compares.
75 void BinaryType(TypeFeedbackId id, 75 void BinaryType(TypeFeedbackId id,
(...skipping 29 matching lines...) Expand all
105 Code* old_code, 105 Code* old_code,
106 Code* new_code); 106 Code* new_code);
107 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); 107 void ProcessRelocInfos(ZoneList<RelocInfo>* infos);
108 108
109 // Returns an element from the backing store. Returns undefined if 109 // Returns an element from the backing store. Returns undefined if
110 // there is no information. 110 // there is no information.
111 Handle<Object> GetInfo(TypeFeedbackId id); 111 Handle<Object> GetInfo(TypeFeedbackId id);
112 112
113 // Returns an element from the type feedback vector. Returns undefined 113 // Returns an element from the type feedback vector. Returns undefined
114 // if there is no information. 114 // if there is no information.
115 Handle<Object> GetInfo(int slot); 115 Handle<Object> GetInfo(FeedbackVectorSlot slot);
116 116
117 private: 117 private:
118 Handle<Context> native_context_; 118 Handle<Context> native_context_;
119 Zone* zone_; 119 Zone* zone_;
120 Handle<UnseededNumberDictionary> dictionary_; 120 Handle<UnseededNumberDictionary> dictionary_;
121 Handle<TypeFeedbackVector> feedback_vector_; 121 Handle<TypeFeedbackVector> feedback_vector_;
122 122
123 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 123 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
124 }; 124 };
125 125
126 } } // namespace v8::internal 126 } } // namespace v8::internal
127 127
128 #endif // V8_TYPE_INFO_H_ 128 #endif // V8_TYPE_INFO_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698