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

Side by Side Diff: dart/runtime/lib/object_patch.dart

Issue 14066019: Change memberName and namedArguments in Invocation to use Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class Object { 5 patch class Object {
6 6
7 // Helpers used to implement hashCode. If a hashCode is used we remember it 7 // Helpers used to implement hashCode. If a hashCode is used we remember it
8 // using an Expando object. A new hashCode value is calculated using a Random 8 // using an Expando object. A new hashCode value is calculated using a Random
9 // number generator. 9 // number generator.
10 static Expando _hashCodeExp = new Expando("Object.hashCode"); 10 static Expando _hashCodeExp = new Expando("Object.hashCode");
(...skipping 17 matching lines...) Expand all
28 28
29 _noSuchMethod(bool isMethod, 29 _noSuchMethod(bool isMethod,
30 String memberName, 30 String memberName,
31 int type, 31 int type,
32 List arguments, 32 List arguments,
33 Map<String, dynamic> namedArguments) 33 Map<String, dynamic> namedArguments)
34 native "Object_noSuchMethod"; 34 native "Object_noSuchMethod";
35 35
36 /* patch */ noSuchMethod(Invocation invocation) { 36 /* patch */ noSuchMethod(Invocation invocation) {
37 return _noSuchMethod(invocation.isMethod, 37 return _noSuchMethod(invocation.isMethod,
38 invocation.memberName, 38 _collection_dev.Symbol.getName(invocation.memberName),
39 invocation._type, 39 invocation._type,
40 invocation.positionalArguments, 40 invocation.positionalArguments,
41 invocation.namedArguments); 41 _symbolMapToStringMap(invocation.namedArguments));
42 } 42 }
43 43
44 /* patch */ Type get runtimeType native "Object_runtimeType"; 44 /* patch */ Type get runtimeType native "Object_runtimeType";
45 45
46 // Call this function instead of inlining instanceof, thus collecting 46 // Call this function instead of inlining instanceof, thus collecting
47 // type feedback and reducing code size of unoptimized code. 47 // type feedback and reducing code size of unoptimized code.
48 bool _instanceOf(instantiator, 48 bool _instanceOf(instantiator,
49 instantiator_type_arguments, 49 instantiator_type_arguments,
50 type, 50 type,
51 bool negate) 51 bool negate)
52 native "Object_instanceOf"; 52 native "Object_instanceOf";
53 53
54 // Call this function instead of inlining 'as', thus collecting type 54 // Call this function instead of inlining 'as', thus collecting type
55 // feedback. Returns receiver. 55 // feedback. Returns receiver.
56 _as(instantiator, instantiator_type_arguments, type) native "Object_as"; 56 _as(instantiator, instantiator_type_arguments, type) native "Object_as";
57
58 static _symbolMapToStringMap(Map<Symbol, dynamic> map) {
59 var result = new Map<String, dynamic>();
60 map.forEach((Symbol key, value) {
61 result[_collection_dev.Symbol.getName(key)] = value;
62 });
63 return result;
64 }
57 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698