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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/access-compiler-data.h
diff --git a/src/ic/access-compiler-data.h b/src/ic/access-compiler-data.h
new file mode 100644
index 0000000000000000000000000000000000000000..dffcac7d055458997fb4e708e0a4d1d186c7849a
--- /dev/null
+++ b/src/ic/access-compiler-data.h
@@ -0,0 +1,48 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_IC_ACCESS_COMPILER_DATA_H_
+#define V8_IC_ACCESS_COMPILER_DATA_H_
+
+#include <memory>
+
+#include "src/allocation.h"
+#include "src/base/macros.h"
+
+namespace v8 {
+namespace internal {
+
+class AccessCompilerData {
+ public:
+ AccessCompilerData() {}
+
+ bool IsInitialized() const { return load_calling_convention_ != nullptr; }
+ void Initialize(int load_register_count, const Register* load_registers,
+ int store_register_count, const Register* store_registers) {
+ load_calling_convention_.reset(NewArray<Register>(load_register_count));
+ for (int i = 0; i < load_register_count; ++i) {
+ load_calling_convention_[i] = load_registers[i];
+ }
+ store_calling_convention_.reset(NewArray<Register>(store_register_count));
+ for (int i = 0; i < store_register_count; ++i) {
+ store_calling_convention_[i] = store_registers[i];
+ }
+ }
+
+ Register* load_calling_convention() { return load_calling_convention_.get(); }
+ Register* store_calling_convention() {
+ return store_calling_convention_.get();
+ }
+
+ private:
+ std::unique_ptr<Register[]> load_calling_convention_;
+ std::unique_ptr<Register[]> store_calling_convention_;
+
+ DISALLOW_COPY_AND_ASSIGN(AccessCompilerData);
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_IC_ACCESS_COMPILER_DATA_H_
« 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