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

Unified Diff: runtime/vm/allocation.cc

Issue 296003013: - Reduce the number of Isolate::Current() calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/allocation.cc
===================================================================
--- runtime/vm/allocation.cc (revision 36483)
+++ runtime/vm/allocation.cc (working copy)
@@ -14,8 +14,8 @@
UNREACHABLE();
}
-void* ZoneAllocated::operator new(uword size) {
- Isolate* isolate = Isolate::Current();
+
+static void* Allocate(uword size, BaseIsolate* isolate) {
ASSERT(isolate != NULL);
ASSERT(isolate->current_zone() != NULL);
if (size > static_cast<uword>(kIntptrMax)) {
@@ -24,4 +24,14 @@
return reinterpret_cast<void*>(isolate->current_zone()->AllocUnsafe(size));
}
+
+void* ZoneAllocated::operator new(uword size) {
+ return Allocate(size, Isolate::Current());
+}
+
+
+void* ZoneAllocated::operator new(uword size, BaseIsolate* isolate) {
+ return Allocate(size, isolate);
+}
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698