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

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

Issue 8343045: Reorganize dart_api.h and add a bunch of documentation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | « runtime/include/dart_api.h ('k') | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 } 1853 }
1854 1854
1855 1855
1856 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 1856 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
1857 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); 1857 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size);
1858 return reinterpret_cast<uint8_t*>(new_ptr); 1858 return reinterpret_cast<uint8_t*>(new_ptr);
1859 } 1859 }
1860 1860
1861 1861
1862 DART_EXPORT bool Dart_PostIntArray(Dart_Port port, 1862 DART_EXPORT bool Dart_PostIntArray(Dart_Port port,
1863 int field_count, 1863 intptr_t len,
1864 intptr_t* data) { 1864 intptr_t* data) {
1865 uint8_t* buffer = NULL; 1865 uint8_t* buffer = NULL;
1866 MessageWriter writer(&buffer, &allocator); 1866 MessageWriter writer(&buffer, &allocator);
1867 1867
1868 writer.WriteMessage(field_count, data); 1868 writer.WriteMessage(len, data);
1869 1869
1870 // Post the message at the given port. 1870 // Post the message at the given port.
1871 return PortMap::PostMessage(port, kNoReplyPort, buffer); 1871 return PortMap::PostMessage(port, kNoReplyPort, buffer);
1872 } 1872 }
1873 1873
1874 1874
1875 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle handle) { 1875 DART_EXPORT bool Dart_Post(Dart_Port port, Dart_Handle handle) {
1876 Zone zone; // Setup a VM zone as we are creating some handles. 1876 Zone zone; // Setup a VM zone as we are creating some handles.
1877 HandleScope scope; // Setup a VM handle scope. 1877 HandleScope scope; // Setup a VM handle scope.
1878 const Object& object = Object::Handle(Api::UnwrapHandle(handle)); 1878 const Object& object = Object::Handle(Api::UnwrapHandle(handle));
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 ASSERT(isolate != NULL); 1999 ASSERT(isolate != NULL);
2000 ApiState* state = isolate->api_state(); 2000 ApiState* state = isolate->api_state();
2001 ASSERT(state != NULL); 2001 ASSERT(state != NULL);
2002 ApiLocalScope* scope = state->top_scope(); 2002 ApiLocalScope* scope = state->top_scope();
2003 ASSERT(scope != NULL); 2003 ASSERT(scope != NULL);
2004 return scope->zone().Reallocate(ptr, old_size, new_size); 2004 return scope->zone().Reallocate(ptr, old_size, new_size);
2005 } 2005 }
2006 2006
2007 2007
2008 } // namespace dart 2008 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698