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

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

Issue 8474014: Allow allocation of four byte strings through the Dart API. (Closed) Base URL: https://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 | « no previous file | 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 HandleScope scope; // Setup a VM handle scope. 743 HandleScope scope; // Setup a VM handle scope.
744 const String& obj = String::Handle(String::New(codepoints, length)); 744 const String& obj = String::Handle(String::New(codepoints, length));
745 return Api::NewLocalHandle(obj); 745 return Api::NewLocalHandle(obj);
746 } 746 }
747 747
748 748
749 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, 749 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints,
750 intptr_t length) { 750 intptr_t length) {
751 Zone zone; // Setup a VM zone as we are creating some handles. 751 Zone zone; // Setup a VM zone as we are creating some handles.
752 HandleScope scope; // Setup a VM handle scope. 752 HandleScope scope; // Setup a VM handle scope.
753 UNIMPLEMENTED();
754 const String& obj = String::Handle(String::New(codepoints, length)); 753 const String& obj = String::Handle(String::New(codepoints, length));
755 return Api::NewLocalHandle(obj); 754 return Api::NewLocalHandle(obj);
756 } 755 }
757 756
758 757
759 DART_EXPORT bool Dart_IsString8(Dart_Handle object) { 758 DART_EXPORT bool Dart_IsString8(Dart_Handle object) {
760 Zone zone; // Setup a VM zone as we are creating some handles. 759 Zone zone; // Setup a VM zone as we are creating some handles.
761 HandleScope scope; // Setup a VM handle scope. 760 HandleScope scope; // Setup a VM handle scope.
762 const Object& obj = Object::Handle(Api::UnwrapHandle(object)); 761 const Object& obj = Object::Handle(Api::UnwrapHandle(object));
763 return obj.IsOneByteString(); 762 return obj.IsOneByteString();
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 ASSERT(isolate != NULL); 1998 ASSERT(isolate != NULL);
2000 ApiState* state = isolate->api_state(); 1999 ApiState* state = isolate->api_state();
2001 ASSERT(state != NULL); 2000 ASSERT(state != NULL);
2002 ApiLocalScope* scope = state->top_scope(); 2001 ApiLocalScope* scope = state->top_scope();
2003 ASSERT(scope != NULL); 2002 ASSERT(scope != NULL);
2004 return scope->zone().Reallocate(ptr, old_size, new_size); 2003 return scope->zone().Reallocate(ptr, old_size, new_size);
2005 } 2004 }
2006 2005
2007 2006
2008 } // namespace dart 2007 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698