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

Side by Side Diff: runtime/lib/string.cc

Issue 11028145: Changed StackZone and ApiZone to be containers for Zone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor tweak to use RawError instead of RawObject. Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/regexp_jsc.cc ('k') | runtime/vm/assembler.cc » ('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) 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 "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) { 14 DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) {
15 GET_NATIVE_ARGUMENT(Array, a, arguments->At(0)); 15 GET_NATIVE_ARGUMENT(Array, a, arguments->At(0));
16 // TODO(srdjan): Check that parameterized type is an int. 16 // TODO(srdjan): Check that parameterized type is an int.
17 StackZone* zone = isolate->current_zone(); 17 Zone* zone = isolate->current_zone();
18 intptr_t len = a.Length(); 18 intptr_t len = a.Length();
19 19
20 // Unbox the array and determine the maximum element width. 20 // Unbox the array and determine the maximum element width.
21 bool is_one_byte_string = true; 21 bool is_one_byte_string = true;
22 bool is_two_byte_string = true; 22 bool is_two_byte_string = true;
23 uint32_t* temp = zone->Alloc<uint32_t>(len); 23 uint32_t* temp = zone->Alloc<uint32_t>(len);
24 Object& index_object = Object::Handle(isolate); 24 Object& index_object = Object::Handle(isolate);
25 for (intptr_t i = 0; i < len; i++) { 25 for (intptr_t i = 0; i < len; i++) {
26 index_object = a.At(i); 26 index_object = a.At(i);
27 if (!index_object.IsSmi()) { 27 if (!index_object.IsSmi()) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 if (!elem.IsString()) { 151 if (!elem.IsString()) {
152 GrowableArray<const Object*> args; 152 GrowableArray<const Object*> args;
153 args.Add(&elem); 153 args.Add(&elem);
154 Exceptions::ThrowByType(Exceptions::kArgument, args); 154 Exceptions::ThrowByType(Exceptions::kArgument, args);
155 } 155 }
156 } 156 }
157 return String::ConcatAll(strings); 157 return String::ConcatAll(strings);
158 } 158 }
159 159
160 } // namespace dart 160 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/regexp_jsc.cc ('k') | runtime/vm/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698