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

Side by Side Diff: runtime/vm/service_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/service.cc ('k') | runtime/vm/snapshot.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 growable ^= result.At(5); 70 growable ^= result.At(5);
71 // Append dummy isolate id to parameter values. 71 // Append dummy isolate id to parameter values.
72 growable.Add(dummy_isolate_id); 72 growable.Add(dummy_isolate_id);
73 array = Array::MakeArray(growable); 73 array = Array::MakeArray(growable);
74 result.SetAt(5, array); 74 result.SetAt(5, array);
75 return result.raw(); 75 return result.raw();
76 } 76 }
77 77
78 78
79 static RawArray* EvalF(Dart_Handle lib, const char* fmt, ...) { 79 static RawArray* EvalF(Dart_Handle lib, const char* fmt, ...) {
80 Isolate* isolate = Isolate::Current();
81
82 va_list args; 80 va_list args;
83 va_start(args, fmt); 81 va_start(args, fmt);
84 intptr_t len = OS::VSNPrint(NULL, 0, fmt, args); 82 intptr_t len = OS::VSNPrint(NULL, 0, fmt, args);
85 va_end(args); 83 va_end(args);
86 84
87 char* buffer = isolate->current_zone()->Alloc<char>(len + 1); 85 char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
88 va_list args2; 86 va_list args2;
89 va_start(args2, fmt); 87 va_start(args2, fmt);
90 OS::VSNPrint(buffer, (len + 1), fmt, args2); 88 OS::VSNPrint(buffer, (len + 1), fmt, args2);
91 va_end(args2); 89 va_end(args2);
92 90
93 return Eval(lib, buffer); 91 return Eval(lib, buffer);
94 } 92 }
95 93
96 94
97 static RawFunction* GetFunction(const Class& cls, const char* name) { 95 static RawFunction* GetFunction(const Class& cls, const char* name) {
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]"); 626 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]");
629 Service::HandleIsolateMessage(isolate, service_msg); 627 Service::HandleIsolateMessage(isolate, service_msg);
630 handler.HandleNextMessage(); 628 handler.HandleNextMessage();
631 // Expect error. 629 // Expect error.
632 EXPECT_SUBSTRING("\"error\"", handler.msg()); 630 EXPECT_SUBSTRING("\"error\"", handler.msg());
633 } 631 }
634 632
635 #endif // !defined(TARGET_ARCH_ARM64) 633 #endif // !defined(TARGET_ARCH_ARM64)
636 634
637 } // namespace dart 635 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698