blob: 9d8884fb8a32e6fa8c8c067bad617d121c54db13 [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// 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
10namespace v8 {
11namespace internal {
12
13
Ben Murdochb8a8cc12014-11-26 15:28:44 +000014class PropertyICCompiler : public PropertyAccessCompiler {
15 public:
Ben Murdochb8a8cc12014-11-26 15:28:44 +000016 // Keyed
Emily Bernierd0a1eb72015-03-24 16:35:39 -040017 static Handle<Code> ComputeKeyedLoadMonomorphicHandler(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000018 Handle<Map> receiver_map, ExtraICState extra_ic_state);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000019
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000020 static Handle<Code> ComputeKeyedStoreMonomorphicHandler(
Ben Murdochc5610432016-08-08 18:44:38 +010021 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000022 static void ComputeKeyedStorePolymorphicHandlers(
23 MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
Ben Murdochc5610432016-08-08 18:44:38 +010024 CodeHandleList* handlers, KeyedAccessStoreMode store_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000025
Ben Murdochb8a8cc12014-11-26 15:28:44 +000026 // 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 Murdoch4a90d5f2016-03-22 12:00:34 +000030 LanguageMode language_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000031
32
33 private:
Ben Murdochc5610432016-08-08 18:44:38 +010034 explicit PropertyICCompiler(Isolate* isolate)
35 : PropertyAccessCompiler(isolate, Code::KEYED_STORE_IC,
36 kCacheOnReceiver) {}
Ben Murdochb8a8cc12014-11-26 15:28:44 +000037
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000038 Handle<Code> CompileKeyedStoreMonomorphicHandler(
39 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000040 void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps,
41 MapHandleList* transitioned_maps,
42 CodeHandleList* handlers,
Ben Murdochb8a8cc12014-11-26 15:28:44 +000043 KeyedAccessStoreMode store_mode);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000044};
45
46
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000047} // namespace internal
48} // namespace v8
Ben Murdochb8a8cc12014-11-26 15:28:44 +000049
50#endif // V8_IC_IC_COMPILER_H_