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

Side by Side Diff: runtime/lib/invocation_mirror.h

Issue 30533004: Report correct error message in case of super invocation (fix issue 8208). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/errors_patch.dart ('k') | runtime/lib/invocation_mirror_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #ifndef LIB_INVOCATION_MIRROR_H_ 5 #ifndef LIB_INVOCATION_MIRROR_H_
6 #define LIB_INVOCATION_MIRROR_H_ 6 #define LIB_INVOCATION_MIRROR_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 class InvocationMirror : public AllStatic { 12 class InvocationMirror : public AllStatic {
13 public: 13 public:
14 // These enum correspond to the constants in invocation_mirror_patch.dart. 14 // These enum correspond to the constants in invocation_mirror_patch.dart.
15 // It is used to communicate the reason for statically thrown 15 // It is used to communicate the reason for statically thrown
16 // NoSuchMethodErrors by the compiler. 16 // NoSuchMethodErrors by the compiler.
17 enum Type { 17 enum Type {
18 // Constants describing the invocation type. 18 // Constants describing the invocation type.
19 // kField cannot be generated by regular invocation mirrors. 19 // kField cannot be generated by regular invocation mirrors.
20 kMethod = 0, 20 kMethod = 0,
21 kGetter = 1, 21 kGetter = 1,
22 kSetter = 2, 22 kSetter = 2,
23 kField = 3, 23 kField = 3,
24 kTypeShift = 0, 24 kTypeShift = 0,
25 kTypeBits = 2, 25 kTypeBits = 2,
26 kTypeMask = (1 << kTypeBits) - 1 26 kTypeMask = (1 << kTypeBits) - 1
27 }; 27 };
28 28
29 enum Call { 29 enum Call {
30 // These values, except kDynamic, are only used when throwing 30 // These values, except kDynamic and kSuper, are only used when throwing
31 // NoSuchMethodError for compile-time resolution failures. 31 // NoSuchMethodError for compile-time resolution failures.
32 kDynamic = 0, 32 kDynamic = 0,
33 kStatic = 1, 33 kSuper = 1,
34 kConstructor = 2, 34 kStatic = 2,
35 kTopLevel = 3, 35 kConstructor = 3,
36 kTopLevel = 4,
36 kCallShift = kTypeBits, 37 kCallShift = kTypeBits,
37 kCallBits = 2, 38 kCallBits = 3,
38 kCallMask = (1 << kCallBits) - 1 39 kCallMask = (1 << kCallBits) - 1
39 }; 40 };
40 41
41 static int EncodeType(Call call, Type type) { 42 static int EncodeType(Call call, Type type) {
42 return (call << kCallShift) | type; 43 return (call << kCallShift) | type;
43 } 44 }
44 }; 45 };
45 46
46 } // namespace dart 47 } // namespace dart
47 48
48 #endif // LIB_INVOCATION_MIRROR_H_ 49 #endif // LIB_INVOCATION_MIRROR_H_
OLDNEW
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/lib/invocation_mirror_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698