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

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

Issue 23510006: - More use of pre-allocated read-only handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/mirrors.cc ('k') | runtime/vm/assembler_x64.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/heap.h" 8 #include "vm/heap.h"
9 #include "vm/native_entry.h" 9 #include "vm/native_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } else { 180 } else {
181 type_name = type.UserVisibleName(); 181 type_name = type.UserVisibleName();
182 } 182 }
183 String& malformed_error_message = String::Handle(); 183 String& malformed_error_message = String::Handle();
184 if (malformed_error.IsNull()) { 184 if (malformed_error.IsNull()) {
185 const String& dst_name = String::ZoneHandle( 185 const String& dst_name = String::ZoneHandle(
186 Symbols::New(Exceptions::kCastErrorDstName)); 186 Symbols::New(Exceptions::kCastErrorDstName));
187 187
188 Exceptions::CreateAndThrowTypeError( 188 Exceptions::CreateAndThrowTypeError(
189 location, instance_type_name, type_name, 189 location, instance_type_name, type_name,
190 dst_name, String::Handle()); 190 dst_name, Object::null_string());
191 } else { 191 } else {
192 ASSERT(FLAG_enable_type_checks); 192 ASSERT(FLAG_enable_type_checks);
193 malformed_error_message = String::New(malformed_error.ToErrorCString()); 193 malformed_error_message = String::New(malformed_error.ToErrorCString());
194 Exceptions::CreateAndThrowTypeError( 194 Exceptions::CreateAndThrowTypeError(
195 location, instance_type_name, Symbols::Empty(), 195 location, instance_type_name, Symbols::Empty(),
196 Symbols::Empty(), malformed_error_message); 196 Symbols::Empty(), malformed_error_message);
197 } 197 }
198 UNREACHABLE(); 198 UNREACHABLE();
199 } 199 }
200 return instance.raw(); 200 return instance.raw();
201 } 201 }
202 202
203 203
204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { 204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) {
205 const AbstractType& type = 205 const AbstractType& type =
206 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); 206 AbstractType::CheckedHandle(arguments->NativeArgAt(0));
207 return type.UserVisibleName(); 207 return type.UserVisibleName();
208 } 208 }
209 209
210 } // namespace dart 210 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698