| 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 }; | 16 enum PrototypeCheckType { CHECK_ALL_MAPS, SKIP_RECEIVER }; |
| 17 enum ReturnHolder { RETURN_HOLDER, DONT_RETURN_ANYTHING }; | 17 enum ReturnHolder { RETURN_HOLDER, DONT_RETURN_ANYTHING }; |
| 18 | 18 |
| 19 class PropertyHandlerCompiler : public PropertyAccessCompiler { | 19 class PropertyHandlerCompiler : public PropertyAccessCompiler { |
| 20 public: | 20 public: |
| 21 static Handle<Code> Find(Handle<Name> name, Handle<Map> map, Code::Kind kind, | 21 static Handle<Code> Find(Handle<Name> name, Handle<Map> map, Code::Kind kind, |
| 22 CacheHolderFlag cache_holder, Code::StubType type); | 22 CacheHolderFlag cache_holder); |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind, Handle<Map> map, | 25 PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind, Handle<Map> map, |
| 26 Handle<JSObject> holder, CacheHolderFlag cache_holder) | 26 Handle<JSObject> holder, CacheHolderFlag cache_holder) |
| 27 : PropertyAccessCompiler(isolate, kind, cache_holder), | 27 : PropertyAccessCompiler(isolate, kind, cache_holder), |
| 28 map_(map), | 28 map_(map), |
| 29 holder_(holder) {} | 29 holder_(holder) {} |
| 30 | 30 |
| 31 virtual ~PropertyHandlerCompiler() {} | 31 virtual ~PropertyHandlerCompiler() {} |
| 32 | 32 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // | 91 // |
| 92 // The scratch and holder registers are always clobbered, but the object | 92 // The scratch and holder registers are always clobbered, but the object |
| 93 // register is only clobbered if it the same as the holder register. The | 93 // register is only clobbered if it the same as the holder register. The |
| 94 // function returns a register containing the holder - either object_reg or | 94 // function returns a register containing the holder - either object_reg or |
| 95 // holder_reg. | 95 // holder_reg. |
| 96 Register CheckPrototypes(Register object_reg, Register holder_reg, | 96 Register CheckPrototypes(Register object_reg, Register holder_reg, |
| 97 Register scratch1, Register scratch2, | 97 Register scratch1, Register scratch2, |
| 98 Handle<Name> name, Label* miss, | 98 Handle<Name> name, Label* miss, |
| 99 PrototypeCheckType check, ReturnHolder return_what); | 99 PrototypeCheckType check, ReturnHolder return_what); |
| 100 | 100 |
| 101 Handle<Code> GetCode(Code::Kind kind, Code::StubType type, Handle<Name> name); | 101 Handle<Code> GetCode(Code::Kind kind, Handle<Name> name); |
| 102 void set_holder(Handle<JSObject> holder) { holder_ = holder; } | 102 void set_holder(Handle<JSObject> holder) { holder_ = holder; } |
| 103 Handle<Map> map() const { return map_; } | 103 Handle<Map> map() const { return map_; } |
| 104 void set_map(Handle<Map> map) { map_ = map; } | 104 void set_map(Handle<Map> map) { map_ = map; } |
| 105 Handle<JSObject> holder() const { return holder_; } | 105 Handle<JSObject> holder() const { return holder_; } |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 Handle<Map> map_; | 108 Handle<Map> map_; |
| 109 Handle<JSObject> holder_; | 109 Handle<JSObject> holder_; |
| 110 }; | 110 }; |
| 111 | 111 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 void CompileElementHandlers(MapHandleList* receiver_maps, | 296 void CompileElementHandlers(MapHandleList* receiver_maps, |
| 297 CodeHandleList* handlers); | 297 CodeHandleList* handlers); |
| 298 | 298 |
| 299 static void GenerateStoreSlow(MacroAssembler* masm); | 299 static void GenerateStoreSlow(MacroAssembler* masm); |
| 300 }; | 300 }; |
| 301 } // namespace internal | 301 } // namespace internal |
| 302 } // namespace v8 | 302 } // namespace v8 |
| 303 | 303 |
| 304 #endif // V8_IC_HANDLER_COMPILER_H_ | 304 #endif // V8_IC_HANDLER_COMPILER_H_ |
| OLD | NEW |