Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: src/ic/access-compiler-data.h

Issue 2389313002: Avoid static initializers in PropertyAccessCompiler (Closed)
Patch Set: Ports Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/access-compiler.cc ('k') | src/ic/arm/access-compiler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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_ACCESS_COMPILER_DATA_H_
6 #define V8_IC_ACCESS_COMPILER_DATA_H_
7
8 #include <memory>
9
10 #include "src/allocation.h"
11 #include "src/base/macros.h"
12
13 namespace v8 {
14 namespace internal {
15
16 class AccessCompilerData {
17 public:
18 AccessCompilerData() {}
19
20 bool IsInitialized() const { return load_calling_convention_ != nullptr; }
21 void Initialize(int load_register_count, const Register* load_registers,
22 int store_register_count, const Register* store_registers) {
23 load_calling_convention_.reset(NewArray<Register>(load_register_count));
24 for (int i = 0; i < load_register_count; ++i) {
25 load_calling_convention_[i] = load_registers[i];
26 }
27 store_calling_convention_.reset(NewArray<Register>(store_register_count));
28 for (int i = 0; i < store_register_count; ++i) {
29 store_calling_convention_[i] = store_registers[i];
30 }
31 }
32
33 Register* load_calling_convention() { return load_calling_convention_.get(); }
34 Register* store_calling_convention() {
35 return store_calling_convention_.get();
36 }
37
38 private:
39 std::unique_ptr<Register[]> load_calling_convention_;
40 std::unique_ptr<Register[]> store_calling_convention_;
41
42 DISALLOW_COPY_AND_ASSIGN(AccessCompilerData);
43 };
44
45 } // namespace internal
46 } // namespace v8
47
48 #endif // V8_IC_ACCESS_COMPILER_DATA_H_
OLDNEW
« no previous file with comments | « src/ic/access-compiler.cc ('k') | src/ic/arm/access-compiler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698