OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_IC_HANDLER_COMPILER_H_ | 5 #ifndef V8_IC_HANDLER_COMPILER_H_ |
6 #define V8_IC_HANDLER_COMPILER_H_ | 6 #define V8_IC_HANDLER_COMPILER_H_ |
7 | 7 |
8 #include "src/ic/access-compiler.h" | 8 #include "src/ic/access-compiler.h" |
9 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 virtual ~PropertyHandlerCompiler() {} | 31 virtual ~PropertyHandlerCompiler() {} |
32 | 32 |
33 virtual Register FrontendHeader(Register object_reg, Handle<Name> name, | 33 virtual Register FrontendHeader(Register object_reg, Handle<Name> name, |
34 Label* miss) { | 34 Label* miss) { |
35 UNREACHABLE(); | 35 UNREACHABLE(); |
36 return receiver(); | 36 return receiver(); |
37 } | 37 } |
38 | 38 |
39 virtual void FrontendFooter(Handle<Name> name, Label* miss) { UNREACHABLE(); } | 39 virtual void FrontendFooter(Handle<Name> name, Label* miss) { UNREACHABLE(); } |
40 | 40 |
41 Register Frontend(Register object_reg, Handle<Name> name); | 41 // Frontend loads from receiver(), returns holder register which may be |
| 42 // different. |
| 43 Register Frontend(Handle<Name> name); |
42 void NonexistentFrontendHeader(Handle<Name> name, Label* miss, | 44 void NonexistentFrontendHeader(Handle<Name> name, Label* miss, |
43 Register scratch1, Register scratch2); | 45 Register scratch1, Register scratch2); |
44 | 46 |
| 47 // When FLAG_vector_ics is true, handlers that have the possibility of missing |
| 48 // will need to save and pass these to miss handlers. |
| 49 void PushVectorAndSlot() { PushVectorAndSlot(vector(), slot()); } |
| 50 void PushVectorAndSlot(Register vector, Register slot); |
| 51 void PopVectorAndSlot() { PopVectorAndSlot(vector(), slot()); } |
| 52 void PopVectorAndSlot(Register vector, Register slot); |
| 53 |
| 54 void DiscardVectorAndSlot(); |
| 55 |
45 // TODO(verwaest): Make non-static. | 56 // TODO(verwaest): Make non-static. |
46 static void GenerateFastApiCall(MacroAssembler* masm, | 57 static void GenerateFastApiCall(MacroAssembler* masm, |
47 const CallOptimization& optimization, | 58 const CallOptimization& optimization, |
48 Handle<Map> receiver_map, Register receiver, | 59 Handle<Map> receiver_map, Register receiver, |
49 Register scratch, bool is_store, int argc, | 60 Register scratch, bool is_store, int argc, |
50 Register* values); | 61 Register* values); |
51 | 62 |
52 // Helper function used to check that the dictionary doesn't contain | 63 // Helper function used to check that the dictionary doesn't contain |
53 // the property. This function may return false negatives, so miss_label | 64 // the property. This function may return false negatives, so miss_label |
54 // must always call a backup property check that is complete. | 65 // must always call a backup property check that is complete. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 174 |
164 virtual void FrontendFooter(Handle<Name> name, Label* miss); | 175 virtual void FrontendFooter(Handle<Name> name, Label* miss); |
165 | 176 |
166 private: | 177 private: |
167 Handle<Code> CompileLoadNonexistent(Handle<Name> name); | 178 Handle<Code> CompileLoadNonexistent(Handle<Name> name); |
168 void GenerateLoadConstant(Handle<Object> value); | 179 void GenerateLoadConstant(Handle<Object> value); |
169 void GenerateLoadCallback(Register reg, | 180 void GenerateLoadCallback(Register reg, |
170 Handle<ExecutableAccessorInfo> callback); | 181 Handle<ExecutableAccessorInfo> callback); |
171 void GenerateLoadCallback(const CallOptimization& call_optimization, | 182 void GenerateLoadCallback(const CallOptimization& call_optimization, |
172 Handle<Map> receiver_map); | 183 Handle<Map> receiver_map); |
| 184 |
| 185 // Helper emits no code if vector-ics are disabled. |
| 186 void InterceptorVectorSlotPush(Register holder_reg); |
| 187 enum PopMode { POP, DISCARD }; |
| 188 void InterceptorVectorSlotPop(Register holder_reg, PopMode mode = POP); |
| 189 |
173 void GenerateLoadInterceptor(Register holder_reg); | 190 void GenerateLoadInterceptor(Register holder_reg); |
174 void GenerateLoadInterceptorWithFollowup(LookupIterator* it, | 191 void GenerateLoadInterceptorWithFollowup(LookupIterator* it, |
175 Register holder_reg); | 192 Register holder_reg); |
176 void GenerateLoadPostInterceptor(LookupIterator* it, Register reg); | 193 void GenerateLoadPostInterceptor(LookupIterator* it, Register reg); |
177 | 194 |
178 // Generates prototype loading code that uses the objects from the | 195 // Generates prototype loading code that uses the objects from the |
179 // context we were in when this function was called. If the context | 196 // context we were in when this function was called. If the context |
180 // has changed, a jump to miss is performed. This ties the generated | 197 // has changed, a jump to miss is performed. This ties the generated |
181 // code to a particular context and so must not be used in cases | 198 // code to a particular context and so must not be used in cases |
182 // where the generated code is not allowed to have references to | 199 // where the generated code is not allowed to have references to |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 285 |
269 void CompileElementHandlers(MapHandleList* receiver_maps, | 286 void CompileElementHandlers(MapHandleList* receiver_maps, |
270 CodeHandleList* handlers); | 287 CodeHandleList* handlers); |
271 | 288 |
272 static void GenerateStoreSlow(MacroAssembler* masm); | 289 static void GenerateStoreSlow(MacroAssembler* masm); |
273 }; | 290 }; |
274 } | 291 } |
275 } // namespace v8::internal | 292 } // namespace v8::internal |
276 | 293 |
277 #endif // V8_IC_HANDLER_COMPILER_H_ | 294 #endif // V8_IC_HANDLER_COMPILER_H_ |
OLD | NEW |