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

Unified Diff: runtime/vm/assembler.h

Issue 886173003: VM: Align implementations of assembler constant pools. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | « no previous file | runtime/vm/assembler.cc » ('j') | runtime/vm/assembler_arm.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler.h
===================================================================
--- runtime/vm/assembler.h (revision 43497)
+++ runtime/vm/assembler.h (working copy)
@@ -9,6 +9,7 @@
#include "vm/allocation.h"
#include "vm/globals.h"
#include "vm/growable_array.h"
+#include "vm/hash_map.h"
#include "vm/object.h"
namespace dart {
@@ -256,6 +257,36 @@
Value value_;
};
+
+enum Patchability {
+ kPatchable,
+ kNotPatchable,
+};
+
+
+class ObjectPool : public ValueObject {
+ public:
+ ObjectPool() : object_pool_(GrowableObjectArray::Handle()) { }
+
+ intptr_t AddObject(const Object& obj, Patchability patchable);
+ intptr_t AddExternalLabel(const ExternalLabel* label,
+ Patchability patchable);
+
+ intptr_t FindObject(const Object& obj, Patchability patchable);
+ intptr_t FindExternalLabel(const ExternalLabel* label,
+ Patchability patchable);
+ const GrowableObjectArray& data() const { return object_pool_; }
+ private:
+ // Objects and jump targets.
+ GrowableObjectArray& object_pool_;
+
+ // Patchability of pool entries.
+ GrowableArray<Patchability> patchable_pool_entries_;
+
+ // Hashmap for fast lookup in object pool.
+ DirectChainedHashMap<ObjIndexPair> object_pool_index_table_;
+};
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/assembler.cc » ('j') | runtime/vm/assembler_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698