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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 8372094: Renaming Array -> List in the VM API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 701c92a68a1f80ab55192c0b330a7bb5dd62e198..26b02752a12b2979518b4a0f220a3773903f0494 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -871,17 +871,17 @@ static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) {
}
-DART_EXPORT bool Dart_IsArray(Dart_Handle object) {
+DART_EXPORT bool Dart_IsList(Dart_Handle object) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
const Object& obj = Object::Handle(Api::UnwrapHandle(object));
// TODO(5526318): Make access to GrowableObjectArray more efficient.
- return (obj.IsArray() || (GetListInstance(Isolate::Current(), obj) !=
- Instance::null()));
+ return (obj.IsArray() ||
+ (GetListInstance(Isolate::Current(), obj) != Instance::null()));
}
-DART_EXPORT Dart_Handle Dart_NewArray(intptr_t length) {
+DART_EXPORT Dart_Handle Dart_NewList(intptr_t length) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
const Array& obj = Array::Handle(Array::New(length));
@@ -889,10 +889,10 @@ DART_EXPORT Dart_Handle Dart_NewArray(intptr_t length) {
}
-DART_EXPORT Dart_Handle Dart_GetLength(Dart_Handle array, intptr_t* len) {
+DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* len) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
- const Object& obj = Object::Handle(Api::UnwrapHandle(array));
+ const Object& obj = Object::Handle(Api::UnwrapHandle(list));
if (obj.IsArray()) {
Array& array_obj = Array::Handle();
array_obj ^= obj.raw();
@@ -949,11 +949,11 @@ DART_EXPORT Dart_Handle Dart_GetLength(Dart_Handle array, intptr_t* len) {
}
-static RawObject* GetArrayAt(Isolate* isolate,
- const Instance& instance,
- const Integer& index,
- const Function& function,
- Dart_Handle* result) {
+static RawObject* GetListAt(Isolate* isolate,
+ const Instance& instance,
+ const Integer& index,
+ const Function& function,
+ Dart_Handle* result) {
ASSERT(isolate != NULL);
ASSERT(result != NULL);
LongJump* base = isolate->long_jump_base();
@@ -982,13 +982,13 @@ static RawObject* GetArrayAt(Isolate* isolate,
}
-DART_EXPORT Dart_Handle Dart_ArrayGet(Dart_Handle array,
- intptr_t offset,
- uint8_t* native_array,
- intptr_t length) {
+DART_EXPORT Dart_Handle Dart_ListGetAsBytes(Dart_Handle list,
+ intptr_t offset,
+ uint8_t* native_array,
+ intptr_t length) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
- const Object& obj = Object::Handle(Api::UnwrapHandle(array));
+ const Object& obj = Object::Handle(Api::UnwrapHandle(list));
if (obj.IsArray()) {
Array& array_obj = Array::Handle();
array_obj ^= obj.raw();
@@ -1021,7 +1021,7 @@ DART_EXPORT Dart_Handle Dart_ArrayGet(Dart_Handle array,
Dart_Handle result;
for (int i = 0; i < length; i++) {
intobj = Integer::New(offset + i);
- element = GetArrayAt(isolate, instance, intobj, function, &result);
+ element = GetListAt(isolate, instance, intobj, function, &result);
if (!Dart_IsValid(result)) {
return result; // Error condition.
}
@@ -1038,10 +1038,10 @@ DART_EXPORT Dart_Handle Dart_ArrayGet(Dart_Handle array,
}
-DART_EXPORT Dart_Handle Dart_ArrayGetAt(Dart_Handle array, intptr_t index) {
+DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
- const Object& obj = Object::Handle(Api::UnwrapHandle(array));
+ const Object& obj = Object::Handle(Api::UnwrapHandle(list));
if (obj.IsArray()) {
Array& array_obj = Array::Handle();
array_obj ^= obj.raw();
@@ -1064,7 +1064,7 @@ DART_EXPORT Dart_Handle Dart_ArrayGetAt(Dart_Handle array, intptr_t index) {
Integer& indexobj = Integer::Handle();
Dart_Handle result;
indexobj = Integer::New(index);
- element = GetArrayAt(isolate, instance, indexobj, function, &result);
+ element = GetListAt(isolate, instance, indexobj, function, &result);
if (!Dart_IsValid(result)) {
return result; // Error condition.
}
@@ -1075,12 +1075,12 @@ DART_EXPORT Dart_Handle Dart_ArrayGetAt(Dart_Handle array, intptr_t index) {
}
-static void SetArrayAt(Isolate* isolate,
- const Instance& instance,
- const Integer& index,
- const Object& value,
- const Function& function,
- Dart_Handle* result) {
+static void SetListAt(Isolate* isolate,
+ const Instance& instance,
+ const Integer& index,
+ const Object& value,
+ const Function& function,
+ Dart_Handle* result) {
ASSERT(isolate != NULL);
ASSERT(result != NULL);
LongJump* base = isolate->long_jump_base();
@@ -1108,13 +1108,13 @@ static void SetArrayAt(Isolate* isolate,
}
-DART_EXPORT Dart_Handle Dart_ArraySet(Dart_Handle array,
- intptr_t offset,
- uint8_t* native_array,
- intptr_t length) {
+DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list,
+ intptr_t offset,
+ uint8_t* native_array,
+ intptr_t length) {
Zone zone;
HandleScope scope;
- const Object& obj = Object::Handle(Api::UnwrapHandle(array));
+ const Object& obj = Object::Handle(Api::UnwrapHandle(list));
if (obj.IsArray()) {
Array& array_obj = Array::Handle();
array_obj ^= obj.raw();
@@ -1143,7 +1143,7 @@ DART_EXPORT Dart_Handle Dart_ArraySet(Dart_Handle array,
for (int i = 0; i < length; i++) {
indexobj = Integer::New(offset + i);
valueobj ^= Integer::New(native_array[i]);
- SetArrayAt(isolate, instance, indexobj, valueobj, function, &result);
+ SetListAt(isolate, instance, indexobj, valueobj, function, &result);
if (!Dart_IsValid(result)) {
return result; // Error condition.
}
@@ -1155,12 +1155,12 @@ DART_EXPORT Dart_Handle Dart_ArraySet(Dart_Handle array,
}
-DART_EXPORT Dart_Handle Dart_ArraySetAt(Dart_Handle array,
- intptr_t index,
- Dart_Handle value) {
+DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list,
+ intptr_t index,
+ Dart_Handle value) {
Zone zone; // Setup a VM zone as we are creating some handles.
HandleScope scope; // Setup a VM handle scope.
- const Object& obj = Object::Handle(Api::UnwrapHandle(array));
+ const Object& obj = Object::Handle(Api::UnwrapHandle(list));
if (obj.IsArray()) {
Array& array_obj = Array::Handle();
array_obj ^= obj.raw();
@@ -1183,7 +1183,7 @@ DART_EXPORT Dart_Handle Dart_ArraySetAt(Dart_Handle array,
Dart_Handle result;
const Integer& index_obj = Integer::Handle(Integer::New(index));
const Object& value_obj = Object::Handle(Api::UnwrapHandle(value));
- SetArrayAt(isolate, instance, index_obj, value_obj, function, &result);
+ SetListAt(isolate, instance, index_obj, value_obj, function, &result);
return result;
}
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698