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

Unified Diff: runtime/vm/isolate.h

Issue 16174008: - Create isolate specific resuable handles and use them in the hot lookup paths. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
Index: runtime/vm/isolate.h
===================================================================
--- runtime/vm/isolate.h (revision 24061)
+++ runtime/vm/isolate.h (working copy)
@@ -11,6 +11,7 @@
#include "vm/base_isolate.h"
#include "vm/class_table.h"
#include "vm/gc_callbacks.h"
+#include "vm/handles.h"
#include "vm/megamorphic_cache_table.h"
#include "vm/store_buffer.h"
#include "vm/timer.h"
@@ -18,9 +19,13 @@
namespace dart {
// Forward declarations.
+class AbstractType;
class ApiState;
+class Array;
+class Class;
class CodeIndexTable;
class Debugger;
+class Field;
class Function;
class HandleScope;
class HandleVisitor;
@@ -30,6 +35,7 @@
class LongJump;
class MessageHandler;
class Mutex;
+class Object;
class ObjectPointerVisitor;
class ObjectStore;
class RawInstance;
@@ -40,12 +46,14 @@
class RawObject;
class RawInteger;
class RawError;
+class RawFloat32x4;
+class RawUint32x4;
class Simulator;
class StackResource;
class StackZone;
class StubCode;
-class RawFloat32x4;
-class RawUint32x4;
+class TypeArguments;
+class TypeParameter;
class ObjectHistogram;
@@ -218,6 +226,19 @@
};
+#define REUSABLE_HANDLE_LIST(V) \
+ V(Object) \
+ V(Array) \
+ V(String) \
+ V(Instance) \
+ V(Function) \
+ V(Field) \
+ V(Class) \
+ V(AbstractType) \
+ V(TypeParameter) \
+ V(TypeArguments) \
+
+
class Isolate : public BaseIsolate {
public:
~Isolate();
@@ -581,6 +602,15 @@
// were eliminated by AllocationSinking pass.
void MaterializeDeferredObjects();
+#define REUSABLE_HANDLE_ACCESSORS(object) \
+ object& object##Handle() { \
+ ASSERT(object##_handle_ != NULL); \
+ return *object##_handle_; \
+ } \
+
+ REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ACCESSORS)
+#undef REUSABLE_HANDLE_ACCESSORS
+
static char* GetStatus(const char* request);
private:
@@ -595,6 +625,7 @@
char* GetStatusStacktrace();
char* GetStatusStackFrame(intptr_t index);
char* DoStacktraceInterrupt(Dart_IsolateInterruptCallback cb);
+ template<class T> T* AllocateReusableHandle();
static ThreadLocalKey isolate_key;
StoreBuffer store_buffer_;
@@ -643,6 +674,14 @@
intptr_t stack_frame_index_;
ObjectHistogram* object_histogram_;
+ // Reusable handles support.
+#define REUSABLE_HANDLE_FIELDS(object) \
+ object* object##_handle_; \
+
+ REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS)
+#undef REUSABLE_HANDLE_FIELDS
+ VMHandles handles_;
+
static Dart_IsolateCreateCallback create_callback_;
static Dart_IsolateInterruptCallback interrupt_callback_;
static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_;
« runtime/vm/handles.h ('K') | « runtime/vm/handles.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698