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

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

Issue 10979058: - Implement first class types in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/lib_sources.gypi ('k') | runtime/lib/object_patch.dart » ('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 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Skip receiver. 48 // Skip receiver.
49 for (int i = 1; i < total_num_parameters; i++) { 49 for (int i = 1; i < total_num_parameters; i++) {
50 array.SetAt(i - 1, String::Handle(function.ParameterNameAt(i))); 50 array.SetAt(i - 1, String::Handle(function.ParameterNameAt(i)));
51 } 51 }
52 dart_arguments.Add(&array); 52 dart_arguments.Add(&array);
53 } 53 }
54 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments); 54 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments);
55 return Object::null(); 55 return Object::null();
56 } 56 }
57 57
58
59 DEFINE_NATIVE_ENTRY(Object_runtimeType, 1) {
60 const Instance& instance = Instance::CheckedHandle(arguments->At(0));
61 const Type& type = Type::Handle(instance.GetType());
62 return type.Canonicalize();
63 }
64
65
66 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) {
67 const AbstractType& type = AbstractType::CheckedHandle(arguments->At(0));
68 return type.Name();
regis 2012/09/27 21:12:40 You may consider returning UserVisibleName() inste
Ivan Posva 2012/09/27 21:25:12 I specifically chose Name and not UserVisibleName
69 }
70
58 } // namespace dart 71 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/lib_sources.gypi ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698