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

Side by Side Diff: runtime/lib/isolate.cc

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/regexp_jsc.cc » ('j') | runtime/vm/allocation.cc » ('J')
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/assert.h" 5 #include "platform/assert.h"
6 #include "vm/bootstrap_natives.h" 6 #include "vm/bootstrap_natives.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 const Library& library = 244 const Library& library =
245 Library::Handle(isolate->object_store()->root_library()); 245 Library::Handle(isolate->object_store()->root_library());
246 ASSERT(!library.IsNull()); 246 ASSERT(!library.IsNull());
247 const String& script_name = String::Handle(library.url()); 247 const String& script_name = String::Handle(library.url());
248 return isolate->current_zone()->MakeCopyOfString(script_name.ToCString()); 248 return isolate->current_zone()->MakeCopyOfString(script_name.ToCString());
249 } 249 }
250 250
251 251
252 static char* BuildMainName(const char* class_name) { 252 static char* BuildMainName(const char* class_name) {
253 intptr_t len = OS::SNPrint(NULL, 0, "%s.main", class_name) + 1; 253 intptr_t len = OS::SNPrint(NULL, 0, "%s.main", class_name) + 1;
254 char* chars = reinterpret_cast<char*>( 254 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
255 Isolate::Current()->current_zone()->Allocate(len));
256 OS::SNPrint(chars, len, "%s.main", class_name); 255 OS::SNPrint(chars, len, "%s.main", class_name);
257 return chars; 256 return chars;
258 } 257 }
259 258
260 259
261 DEFINE_NATIVE_ENTRY(IsolateNatives_start, 2) { 260 DEFINE_NATIVE_ENTRY(IsolateNatives_start, 2) {
262 Isolate* preserved_isolate = Isolate::Current(); 261 Isolate* preserved_isolate = Isolate::Current();
263 GET_NATIVE_ARGUMENT(Instance, runnable, arguments->At(0)); 262 GET_NATIVE_ARGUMENT(Instance, runnable, arguments->At(0));
264 // arguments->At(1) unused. 263 // arguments->At(1) unused.
265 const Class& runnable_class = Class::Handle(runnable.clazz()); 264 const Class& runnable_class = Class::Handle(runnable.clazz());
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 647
649 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { 648 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) {
650 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); 649 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port()));
651 if (port.IsError()) { 650 if (port.IsError()) {
652 Exceptions::PropagateError(Error::Cast(port)); 651 Exceptions::PropagateError(Error::Cast(port));
653 } 652 }
654 arguments->SetReturn(port); 653 arguments->SetReturn(port);
655 } 654 }
656 655
657 } // namespace dart 656 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/regexp_jsc.cc » ('j') | runtime/vm/allocation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698