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

Unified Diff: runtime/lib/string.cc

Issue 10878037: - GET_NATIVE_ARGUMENT uses the isolate which is passed in to allocate the handle. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string.cc
===================================================================
--- runtime/lib/string.cc (revision 11263)
+++ runtime/lib/string.cc (working copy)
@@ -14,23 +14,22 @@
DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) {
GET_NATIVE_ARGUMENT(Array, a, arguments->At(0));
// TODO(srdjan): Check that parameterized type is an int.
- Zone* zone = Isolate::Current()->current_zone();
+ Zone* zone = isolate->current_zone();
intptr_t len = a.Length();
// Unbox the array and determine the maximum element width.
bool is_one_byte_string = true;
bool is_two_byte_string = true;
uint32_t* temp = zone->Alloc<uint32_t>(len);
- Smi& element = Smi::Handle();
+ Object& index_object = Object::Handle(isolate);
for (intptr_t i = 0; i < len; i++) {
- const Object& index_object = Object::Handle(a.At(i));
+ index_object = a.At(i);
if (!index_object.IsSmi()) {
GrowableArray<const Object*> args;
args.Add(&index_object);
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
}
- element ^= index_object.raw();
- intptr_t value = element.Value();
+ intptr_t value = Smi::Cast(index_object).Value();
if (value < 0) {
GrowableArray<const Object*> args;
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
@@ -42,7 +41,7 @@
}
temp[i] = value;
}
- String& result = String::Handle();
+ String& result = String::Handle(isolate);
if (is_one_byte_string) {
result ^= OneByteString::New(temp, len, Heap::kNew);
} else if (is_two_byte_string) {
@@ -63,7 +62,7 @@
intptr_t end = end_obj.Value();
const String& result = String::Handle(
- String::SubString(receiver, start, (end - start)));
+ isolate, String::SubString(receiver, start, (end - start)));
arguments->SetReturn(result);
}
« no previous file with comments | « no previous file | runtime/lib/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698