Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef V8_IC_IC_COMPILER_H_ |
| 6 | #define V8_IC_IC_COMPILER_H_ |
| 7 | |
| 8 | #include "src/ic/access-compiler.h" |
| 9 | |
| 10 | namespace v8 { |
| 11 | namespace internal { |
| 12 | |
| 13 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 14 | class PropertyICCompiler : public PropertyAccessCompiler { |
| 15 | public: |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 16 | // Keyed |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 17 | static Handle<Code> ComputeKeyedLoadMonomorphicHandler( |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 18 | Handle<Map> receiver_map, ExtraICState extra_ic_state); |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 19 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 20 | static Handle<Code> ComputeKeyedStoreMonomorphicHandler( |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 21 | Handle<Map> receiver_map, KeyedAccessStoreMode store_mode); |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 22 | static void ComputeKeyedStorePolymorphicHandlers( |
| 23 | MapHandleList* receiver_maps, MapHandleList* transitioned_maps, |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 24 | CodeHandleList* handlers, KeyedAccessStoreMode store_mode); |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 25 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 26 | // Helpers |
| 27 | // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler |
| 28 | // and make the helpers private. |
| 29 | static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 30 | LanguageMode language_mode); |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 31 | |
| 32 | |
| 33 | private: |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 34 | explicit PropertyICCompiler(Isolate* isolate) |
| 35 | : PropertyAccessCompiler(isolate, Code::KEYED_STORE_IC, |
| 36 | kCacheOnReceiver) {} |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 37 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 38 | Handle<Code> CompileKeyedStoreMonomorphicHandler( |
| 39 | Handle<Map> receiver_map, KeyedAccessStoreMode store_mode); |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 40 | void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps, |
| 41 | MapHandleList* transitioned_maps, |
| 42 | CodeHandleList* handlers, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 43 | KeyedAccessStoreMode store_mode); |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 47 | } // namespace internal |
| 48 | } // namespace v8 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 49 | |
| 50 | #endif // V8_IC_IC_COMPILER_H_ |