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 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 class CallOptimization; | 14 class CallOptimization; |
15 | 15 |
16 enum PrototypeCheckType { CHECK_ALL_MAPS, SKIP_RECEIVER }; | |
17 enum ReturnHolder { RETURN_HOLDER, DONT_RETURN_ANYTHING }; | 16 enum ReturnHolder { RETURN_HOLDER, DONT_RETURN_ANYTHING }; |
18 | 17 |
19 class PropertyHandlerCompiler : public PropertyAccessCompiler { | 18 class PropertyHandlerCompiler : public PropertyAccessCompiler { |
20 public: | 19 public: |
21 static Handle<Code> Find(Handle<Name> name, Handle<Map> map, Code::Kind kind, | 20 static Handle<Code> Find(Handle<Name> name, Handle<Map> map, Code::Kind kind, |
22 CacheHolderFlag cache_holder); | 21 CacheHolderFlag cache_holder); |
23 | 22 |
24 protected: | 23 protected: |
25 PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind, Handle<Map> map, | 24 PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind, Handle<Map> map, |
26 Handle<JSObject> holder, CacheHolderFlag cache_holder) | 25 Handle<JSObject> holder, CacheHolderFlag cache_holder) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // code for security check in case of global object holders. Helps to make | 91 // code for security check in case of global object holders. Helps to make |
93 // sure that the current IC is still valid. | 92 // sure that the current IC is still valid. |
94 // | 93 // |
95 // The scratch and holder registers are always clobbered, but the object | 94 // The scratch and holder registers are always clobbered, but the object |
96 // register is only clobbered if it the same as the holder register. The | 95 // register is only clobbered if it the same as the holder register. The |
97 // function returns a register containing the holder - either object_reg or | 96 // function returns a register containing the holder - either object_reg or |
98 // holder_reg. | 97 // holder_reg. |
99 Register CheckPrototypes(Register object_reg, Register holder_reg, | 98 Register CheckPrototypes(Register object_reg, Register holder_reg, |
100 Register scratch1, Register scratch2, | 99 Register scratch1, Register scratch2, |
101 Handle<Name> name, Label* miss, | 100 Handle<Name> name, Label* miss, |
102 PrototypeCheckType check, ReturnHolder return_what); | 101 ReturnHolder return_what); |
103 | 102 |
104 Handle<Code> GetCode(Code::Kind kind, Handle<Name> name); | 103 Handle<Code> GetCode(Code::Kind kind, Handle<Name> name); |
105 void set_holder(Handle<JSObject> holder) { holder_ = holder; } | 104 void set_holder(Handle<JSObject> holder) { holder_ = holder; } |
106 Handle<Map> map() const { return map_; } | 105 Handle<Map> map() const { return map_; } |
107 void set_map(Handle<Map> map) { map_ = map; } | 106 void set_map(Handle<Map> map) { map_ = map; } |
108 Handle<JSObject> holder() const { return holder_; } | 107 Handle<JSObject> holder() const { return holder_; } |
109 | 108 |
110 private: | 109 private: |
111 Handle<Map> map_; | 110 Handle<Map> map_; |
112 Handle<JSObject> holder_; | 111 Handle<JSObject> holder_; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 290 |
292 static Handle<Object> GetKeyedLoadHandler(Handle<Map> receiver_map, | 291 static Handle<Object> GetKeyedLoadHandler(Handle<Map> receiver_map, |
293 Isolate* isolate); | 292 Isolate* isolate); |
294 void CompileElementHandlers(MapHandleList* receiver_maps, | 293 void CompileElementHandlers(MapHandleList* receiver_maps, |
295 List<Handle<Object>>* handlers); | 294 List<Handle<Object>>* handlers); |
296 }; | 295 }; |
297 } // namespace internal | 296 } // namespace internal |
298 } // namespace v8 | 297 } // namespace v8 |
299 | 298 |
300 #endif // V8_IC_HANDLER_COMPILER_H_ | 299 #endif // V8_IC_HANDLER_COMPILER_H_ |
OLD | NEW |