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

Side by Side Diff: vm/dart_api_impl.cc

Issue 11443005: Issue - 7123 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | vm/object.h » ('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 "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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 1567
1568 1568
1569 DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array, 1569 DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array,
1570 intptr_t length) { 1570 intptr_t length) {
1571 Isolate* isolate = Isolate::Current(); 1571 Isolate* isolate = Isolate::Current();
1572 DARTSCOPE(isolate); 1572 DARTSCOPE(isolate);
1573 if (utf16_array == NULL && length != 0) { 1573 if (utf16_array == NULL && length != 0) {
1574 RETURN_NULL_ERROR(utf16_array); 1574 RETURN_NULL_ERROR(utf16_array);
1575 } 1575 }
1576 CHECK_LENGTH(length, String::kMaxElements); 1576 CHECK_LENGTH(length, String::kMaxElements);
1577 return Api::NewHandle(isolate, String::New(utf16_array, length)); 1577 return Api::NewHandle(isolate, String::FromUTF16(utf16_array, length));
1578 } 1578 }
1579 1579
1580 1580
1581 DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t* utf32_array, 1581 DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t* utf32_array,
1582 intptr_t length) { 1582 intptr_t length) {
1583 Isolate* isolate = Isolate::Current(); 1583 Isolate* isolate = Isolate::Current();
1584 DARTSCOPE(isolate); 1584 DARTSCOPE(isolate);
1585 if (utf32_array == NULL && length != 0) { 1585 if (utf32_array == NULL && length != 0) {
1586 RETURN_NULL_ERROR(utf32_array); 1586 RETURN_NULL_ERROR(utf32_array);
1587 } 1587 }
1588 CHECK_LENGTH(length, String::kMaxElements); 1588 CHECK_LENGTH(length, String::kMaxElements);
1589 return Api::NewHandle(isolate, String::New(utf32_array, length)); 1589 return Api::NewHandle(isolate, String::FromUTF32(utf32_array, length));
1590 } 1590 }
1591 1591
1592 1592
1593 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object) { 1593 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object) {
1594 return RawObject::IsExternalStringClassId(Api::ClassId(object)); 1594 return RawObject::IsExternalStringClassId(Api::ClassId(object));
1595 } 1595 }
1596 1596
1597 1597
1598 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object, 1598 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object,
1599 void** peer) { 1599 void** peer) {
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
4453 } 4453 }
4454 { 4454 {
4455 NoGCScope no_gc; 4455 NoGCScope no_gc;
4456 RawObject* raw_obj = obj.raw(); 4456 RawObject* raw_obj = obj.raw();
4457 isolate->heap()->SetPeer(raw_obj, peer); 4457 isolate->heap()->SetPeer(raw_obj, peer);
4458 } 4458 }
4459 return Api::Success(isolate); 4459 return Api::Success(isolate);
4460 } 4460 }
4461 4461
4462 } // namespace dart 4462 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698