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

Side by Side Diff: vm/object.cc

Issue 12036098: First set of changes towards cleaning up the bytearray access APIs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 10 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 | « vm/dart_entry.cc ('k') | vm/snapshot_test.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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 } 1274 }
1275 #endif 1275 #endif
1276 } 1276 }
1277 1277
1278 1278
1279 RawObject* Object::Allocate(intptr_t cls_id, 1279 RawObject* Object::Allocate(intptr_t cls_id,
1280 intptr_t size, 1280 intptr_t size,
1281 Heap::Space space) { 1281 Heap::Space space) {
1282 ASSERT(Utils::IsAligned(size, kObjectAlignment)); 1282 ASSERT(Utils::IsAligned(size, kObjectAlignment));
1283 Isolate* isolate = Isolate::Current(); 1283 Isolate* isolate = Isolate::Current();
1284 ASSERT(isolate->no_callback_scope_depth() == 0);
1284 Heap* heap = isolate->heap(); 1285 Heap* heap = isolate->heap();
1285 1286
1286 uword address = heap->Allocate(size, space); 1287 uword address = heap->Allocate(size, space);
1287 if (address == 0) { 1288 if (address == 0) {
1288 // Use the preallocated out of memory exception to avoid calling 1289 // Use the preallocated out of memory exception to avoid calling
1289 // into dart code or allocating any code. 1290 // into dart code or allocating any code.
1290 const Instance& exception = 1291 const Instance& exception =
1291 Instance::Handle(isolate->object_store()->out_of_memory()); 1292 Instance::Handle(isolate->object_store()->out_of_memory());
1292 Exceptions::Throw(exception); 1293 Exceptions::Throw(exception);
1293 UNREACHABLE(); 1294 UNREACHABLE();
(...skipping 11511 matching lines...) Expand 10 before | Expand all | Expand 10 after
12805 } 12806 }
12806 return result.raw(); 12807 return result.raw();
12807 } 12808 }
12808 12809
12809 12810
12810 const char* WeakProperty::ToCString() const { 12811 const char* WeakProperty::ToCString() const {
12811 return "_WeakProperty"; 12812 return "_WeakProperty";
12812 } 12813 }
12813 12814
12814 } // namespace dart 12815 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_entry.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698