OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 struct Entry { | 49 struct Entry { |
50 String* key; | 50 String* key; |
51 Code* value; | 51 Code* value; |
52 }; | 52 }; |
53 | 53 |
54 | 54 |
55 static void Initialize(bool create_heap_objects); | 55 static void Initialize(bool create_heap_objects); |
56 | 56 |
57 // Computes the right stub matching. Inserts the result in the | 57 // Computes the right stub matching. Inserts the result in the |
58 // cache before returning. This might compile a stub if needed. | 58 // cache before returning. This might compile a stub if needed. |
59 static Object* ComputeLoadNonexistent(String* name, JSObject* receiver); | 59 NOIGNORE static Object* ComputeLoadNonexistent(String* name, |
| 60 JSObject* receiver); |
60 | 61 |
61 static Object* ComputeLoadField(String* name, | 62 NOIGNORE static Object* ComputeLoadField(String* name, |
62 JSObject* receiver, | 63 JSObject* receiver, |
63 JSObject* holder, | 64 JSObject* holder, |
64 int field_index); | 65 int field_index); |
65 | 66 |
66 static Object* ComputeLoadCallback(String* name, | 67 NOIGNORE static Object* ComputeLoadCallback(String* name, |
67 JSObject* receiver, | 68 JSObject* receiver, |
68 JSObject* holder, | 69 JSObject* holder, |
69 AccessorInfo* callback); | 70 AccessorInfo* callback); |
70 | 71 |
71 static Object* ComputeLoadConstant(String* name, | 72 NOIGNORE static Object* ComputeLoadConstant(String* name, |
72 JSObject* receiver, | 73 JSObject* receiver, |
73 JSObject* holder, | 74 JSObject* holder, |
74 Object* value); | 75 Object* value); |
75 | 76 |
76 static Object* ComputeLoadInterceptor(String* name, | 77 NOIGNORE static Object* ComputeLoadInterceptor(String* name, |
77 JSObject* receiver, | 78 JSObject* receiver, |
78 JSObject* holder); | 79 JSObject* holder); |
79 | 80 |
80 static Object* ComputeLoadNormal(); | 81 NOIGNORE static Object* ComputeLoadNormal(); |
81 | 82 |
82 | 83 |
83 static Object* ComputeLoadGlobal(String* name, | 84 NOIGNORE static Object* ComputeLoadGlobal(String* name, |
84 JSObject* receiver, | 85 JSObject* receiver, |
85 GlobalObject* holder, | 86 GlobalObject* holder, |
86 JSGlobalPropertyCell* cell, | 87 JSGlobalPropertyCell* cell, |
87 bool is_dont_delete); | 88 bool is_dont_delete); |
88 | 89 |
89 | 90 |
90 // --- | 91 // --- |
91 | 92 |
92 static Object* ComputeKeyedLoadField(String* name, | 93 NOIGNORE static Object* ComputeKeyedLoadField(String* name, |
93 JSObject* receiver, | 94 JSObject* receiver, |
94 JSObject* holder, | 95 JSObject* holder, |
95 int field_index); | 96 int field_index); |
96 | 97 |
97 static Object* ComputeKeyedLoadCallback(String* name, | 98 NOIGNORE static Object* ComputeKeyedLoadCallback(String* name, |
98 JSObject* receiver, | 99 JSObject* receiver, |
99 JSObject* holder, | 100 JSObject* holder, |
100 AccessorInfo* callback); | 101 AccessorInfo* callback); |
101 | 102 |
102 static Object* ComputeKeyedLoadConstant(String* name, JSObject* receiver, | 103 NOIGNORE static Object* ComputeKeyedLoadConstant(String* name, |
103 JSObject* holder, Object* value); | 104 JSObject* receiver, |
| 105 JSObject* holder, |
| 106 Object* value); |
104 | 107 |
105 static Object* ComputeKeyedLoadInterceptor(String* name, | 108 NOIGNORE static Object* ComputeKeyedLoadInterceptor(String* name, |
106 JSObject* receiver, | 109 JSObject* receiver, |
107 JSObject* holder); | 110 JSObject* holder); |
108 | 111 |
109 static Object* ComputeKeyedLoadArrayLength(String* name, JSArray* receiver); | 112 NOIGNORE static Object* ComputeKeyedLoadArrayLength(String* name, |
| 113 JSArray* receiver); |
110 | 114 |
111 static Object* ComputeKeyedLoadStringLength(String* name, | 115 NOIGNORE static Object* ComputeKeyedLoadStringLength(String* name, |
112 String* receiver); | 116 String* receiver); |
113 | 117 |
114 static Object* ComputeKeyedLoadFunctionPrototype(String* name, | 118 NOIGNORE static Object* ComputeKeyedLoadFunctionPrototype(String* name, |
115 JSFunction* receiver); | 119 JSFunction* receiver); |
116 | 120 |
117 // --- | 121 // --- |
118 | 122 |
119 static Object* ComputeStoreField(String* name, | 123 NOIGNORE static Object* ComputeStoreField(String* name, |
120 JSObject* receiver, | 124 JSObject* receiver, |
121 int field_index, | 125 int field_index, |
122 Map* transition = NULL); | 126 Map* transition = NULL); |
123 | 127 |
124 static Object* ComputeStoreNormal(); | 128 NOIGNORE static Object* ComputeStoreNormal(); |
125 | 129 |
126 static Object* ComputeStoreGlobal(String* name, | 130 NOIGNORE static Object* ComputeStoreGlobal(String* name, |
127 GlobalObject* receiver, | 131 GlobalObject* receiver, |
128 JSGlobalPropertyCell* cell); | 132 JSGlobalPropertyCell* cell); |
129 | 133 |
130 static Object* ComputeStoreCallback(String* name, | 134 NOIGNORE static Object* ComputeStoreCallback(String* name, |
131 JSObject* receiver, | 135 JSObject* receiver, |
132 AccessorInfo* callback); | 136 AccessorInfo* callback); |
133 | 137 |
134 static Object* ComputeStoreInterceptor(String* name, JSObject* receiver); | 138 NOIGNORE static Object* ComputeStoreInterceptor(String* name, |
| 139 JSObject* receiver); |
135 | 140 |
136 // --- | 141 // --- |
137 | 142 |
138 static Object* ComputeKeyedStoreField(String* name, | 143 NOIGNORE static Object* ComputeKeyedStoreField(String* name, |
139 JSObject* receiver, | 144 JSObject* receiver, |
140 int field_index, | 145 int field_index, |
141 Map* transition = NULL); | 146 Map* transition = NULL); |
142 | 147 |
143 // --- | 148 // --- |
144 | 149 |
145 static Object* ComputeCallField(int argc, | 150 NOIGNORE static Object* ComputeCallField(int argc, |
146 InLoopFlag in_loop, | 151 InLoopFlag in_loop, |
147 Code::Kind, | 152 Code::Kind, |
148 String* name, | 153 String* name, |
149 Object* object, | 154 Object* object, |
150 JSObject* holder, | 155 JSObject* holder, |
151 int index); | 156 int index); |
152 | 157 |
153 static Object* ComputeCallConstant(int argc, | 158 NOIGNORE static Object* ComputeCallConstant(int argc, |
154 InLoopFlag in_loop, | 159 InLoopFlag in_loop, |
155 Code::Kind, | 160 Code::Kind, |
156 String* name, | 161 String* name, |
157 Object* object, | 162 Object* object, |
158 JSObject* holder, | 163 JSObject* holder, |
159 JSFunction* function); | 164 JSFunction* function); |
160 | 165 |
161 static Object* ComputeCallNormal(int argc, | 166 NOIGNORE static Object* ComputeCallNormal(int argc, |
162 InLoopFlag in_loop, | 167 InLoopFlag in_loop, |
163 Code::Kind, | 168 Code::Kind, |
164 String* name, | 169 String* name, |
165 JSObject* receiver); | 170 JSObject* receiver); |
166 | 171 |
167 static Object* ComputeCallInterceptor(int argc, | 172 NOIGNORE static Object* ComputeCallInterceptor(int argc, |
168 Code::Kind, | 173 Code::Kind, |
169 String* name, | 174 String* name, |
170 Object* object, | 175 Object* object, |
171 JSObject* holder); | 176 JSObject* holder); |
172 | 177 |
173 static Object* ComputeCallGlobal(int argc, | 178 NOIGNORE static Object* ComputeCallGlobal(int argc, |
174 InLoopFlag in_loop, | 179 InLoopFlag in_loop, |
175 Code::Kind, | 180 Code::Kind, |
176 String* name, | 181 String* name, |
177 JSObject* receiver, | 182 JSObject* receiver, |
178 GlobalObject* holder, | 183 GlobalObject* holder, |
179 JSGlobalPropertyCell* cell, | 184 JSGlobalPropertyCell* cell, |
180 JSFunction* function); | 185 JSFunction* function); |
181 | 186 |
182 // --- | 187 // --- |
183 | 188 |
184 static Object* ComputeCallInitialize(int argc, | 189 NOIGNORE static Object* ComputeCallInitialize(int argc, |
185 InLoopFlag in_loop, | 190 InLoopFlag in_loop, |
186 Code::Kind kind); | 191 Code::Kind kind); |
187 | 192 |
188 static Object* ComputeCallPreMonomorphic(int argc, | 193 NOIGNORE static Object* ComputeCallPreMonomorphic(int argc, |
| 194 InLoopFlag in_loop, |
| 195 Code::Kind kind); |
| 196 |
| 197 NOIGNORE static Object* ComputeCallNormal(int argc, |
| 198 InLoopFlag in_loop, |
| 199 Code::Kind kind); |
| 200 |
| 201 NOIGNORE static Object* ComputeCallMegamorphic(int argc, |
| 202 InLoopFlag in_loop, |
| 203 Code::Kind kind); |
| 204 |
| 205 NOIGNORE static Object* ComputeCallMiss(int argc, Code::Kind kind); |
| 206 |
| 207 // Finds the Code object stored in the Heap::non_monomorphic_cache(). |
| 208 NOIGNORE static Code* FindCallInitialize(int argc, |
189 InLoopFlag in_loop, | 209 InLoopFlag in_loop, |
190 Code::Kind kind); | 210 Code::Kind kind); |
191 | 211 |
192 static Object* ComputeCallNormal(int argc, | 212 #ifdef ENABLE_DEBUGGER_SUPPORT |
193 InLoopFlag in_loop, | 213 NOIGNORE static Object* ComputeCallDebugBreak(int argc, Code::Kind kind); |
194 Code::Kind kind); | |
195 | 214 |
196 static Object* ComputeCallMegamorphic(int argc, | 215 NOIGNORE static Object* ComputeCallDebugPrepareStepIn(int argc, |
197 InLoopFlag in_loop, | 216 Code::Kind kind); |
198 Code::Kind kind); | |
199 | |
200 static Object* ComputeCallMiss(int argc, Code::Kind kind); | |
201 | |
202 // Finds the Code object stored in the Heap::non_monomorphic_cache(). | |
203 static Code* FindCallInitialize(int argc, | |
204 InLoopFlag in_loop, | |
205 Code::Kind kind); | |
206 | |
207 #ifdef ENABLE_DEBUGGER_SUPPORT | |
208 static Object* ComputeCallDebugBreak(int argc, Code::Kind kind); | |
209 | |
210 static Object* ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind); | |
211 #endif | 217 #endif |
212 | 218 |
213 // Update cache for entry hash(name, map). | 219 // Update cache for entry hash(name, map). |
214 static Code* Set(String* name, Map* map, Code* code); | 220 static Code* Set(String* name, Map* map, Code* code); |
215 | 221 |
216 // Clear the lookup table (@ mark compact collection). | 222 // Clear the lookup table (@ mark compact collection). |
217 static void Clear(); | 223 static void Clear(); |
218 | 224 |
219 // Generate code for probing the stub cache table. | 225 // Generate code for probing the stub cache table. |
220 // If extra != no_reg it might be used as am extra scratch register. | 226 // If extra != no_reg it might be used as am extra scratch register. |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 747 |
742 JSFunction* constant_function_; | 748 JSFunction* constant_function_; |
743 bool is_simple_api_call_; | 749 bool is_simple_api_call_; |
744 FunctionTemplateInfo* expected_receiver_type_; | 750 FunctionTemplateInfo* expected_receiver_type_; |
745 CallHandlerInfo* api_call_info_; | 751 CallHandlerInfo* api_call_info_; |
746 }; | 752 }; |
747 | 753 |
748 } } // namespace v8::internal | 754 } } // namespace v8::internal |
749 | 755 |
750 #endif // V8_STUB_CACHE_H_ | 756 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |