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

Side by Side Diff: runtime/vm/snapshot_test.cc

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "include/dart_tools_api.h" 7 #include "include/dart_tools_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 55
56 static uint8_t* malloc_allocator( 56 static uint8_t* malloc_allocator(
57 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 57 uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
58 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size)); 58 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size));
59 } 59 }
60 60
61 61
62 static uint8_t* zone_allocator( 62 static uint8_t* zone_allocator(
63 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 63 uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
64 Zone* zone = Isolate::Current()->current_zone(); 64 Zone* zone = Thread::Current()->zone();
65 return zone->Realloc<uint8_t>(ptr, old_size, new_size); 65 return zone->Realloc<uint8_t>(ptr, old_size, new_size);
66 } 66 }
67 67
68 68
69 // Compare two Dart_CObject object graphs rooted in first and 69 // Compare two Dart_CObject object graphs rooted in first and
70 // second. The second graph will be destroyed by this operation no matter 70 // second. The second graph will be destroyed by this operation no matter
71 // whether the graphs are equal or not. 71 // whether the graphs are equal or not.
72 static void CompareDartCObjects(Dart_CObject* first, Dart_CObject* second) { 72 static void CompareDartCObjects(Dart_CObject* first, Dart_CObject* second) {
73 // Return immediately if entering a cycle. 73 // Return immediately if entering a cycle.
74 if (second->type == Dart_CObject_kNumberOfTypes) return; 74 if (second->type == Dart_CObject_kNumberOfTypes) return;
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 StackZone zone(Isolate::Current()); 2907 StackZone zone(Isolate::Current());
2908 uint8_t* buffer; 2908 uint8_t* buffer;
2909 MessageWriter writer(&buffer, &zone_allocator, true); 2909 MessageWriter writer(&buffer, &zone_allocator, true);
2910 writer.WriteInlinedObjectHeader(kOmittedObjectId); 2910 writer.WriteInlinedObjectHeader(kOmittedObjectId);
2911 // For performance, we'd like single-byte headers when ids are omitted. 2911 // For performance, we'd like single-byte headers when ids are omitted.
2912 // If this starts failing, consider renumbering the snapshot ids. 2912 // If this starts failing, consider renumbering the snapshot ids.
2913 EXPECT_EQ(1, writer.BytesWritten()); 2913 EXPECT_EQ(1, writer.BytesWritten());
2914 } 2914 }
2915 2915
2916 } // namespace dart 2916 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698