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

Unified Diff: runtime/vm/assembler_x64.h

Issue 23723008: Fixes slow object pool search on x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | « runtime/tests/vm/vm.status ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.h
===================================================================
--- runtime/vm/assembler_x64.h (revision 27303)
+++ runtime/vm/assembler_x64.h (working copy)
@@ -12,6 +12,7 @@
#include "platform/assert.h"
#include "platform/utils.h"
#include "vm/constants_x64.h"
+#include "vm/hash_map.h"
namespace dart {
@@ -837,6 +838,35 @@
// Patchability of pool entries.
GrowableArray<Patchability> patchable_pool_entries_;
+ // Pair type parameter for DirectChainedHashMap.
+ class ObjIndexPair {
+ public:
+ typedef RawObject* Key;
Florian Schneider 2013/09/09 19:03:11 The hash map contains raw pointers, but won't be v
zra 2013/09/13 16:49:34 After discussion with Ivan and fixing up the asser
+ typedef intptr_t Value;
+ typedef ObjIndexPair Pair;
+
+ ObjIndexPair(Key key, Value value) : key_(key), value_(value) { }
+
+ static Key KeyOf(Pair kv) { return kv.key_; }
+
+ static Value ValueOf(Pair kv) { return kv.value_; }
+
+ static intptr_t Hashcode(Key key) {
+ return String::Hash(reinterpret_cast<uint8_t*>(&key), sizeof(&key));
+ }
+
+ static inline bool IsKeyEqual(Pair kv, Key key) {
+ return kv.key_ == key;
+ }
+
+ private:
+ Key key_;
+ Value value_;
+ };
+
+ // Hashmap for fast lookup in object pool.
+ DirectChainedHashMap<ObjIndexPair> object_pool_index_table_;
+
int prologue_offset_;
class CodeComment : public ZoneAllocated {
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698