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

Unified Diff: runtime/lib/invocation_mirror.h

Issue 12328019: - Improve the message for NoSuchMethodErrors that are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/lib/invocation_mirror_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/invocation_mirror.h
===================================================================
--- runtime/lib/invocation_mirror.h (revision 0)
+++ runtime/lib/invocation_mirror.h (revision 0)
@@ -0,0 +1,48 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef LIB_INVOCATION_MIRROR_H_
+#define LIB_INVOCATION_MIRROR_H_
+
+#include "vm/allocation.h"
+
+namespace dart {
+
+class InvocationMirror : public AllStatic {
+ public:
+ // These enum correspond to the constants in invocation_mirror_patch.dart.
+ // It is used to communicate the reason for statically thrown
+ // NoSuchMethodErrors by the compiler.
+ enum Type {
+ // Constants describing the invocation type.
+ // kField cannot be generated by regular invocation mirrors.
+ kMethod = 0,
+ kGetter = 1,
+ kSetter = 2,
+ kField = 3,
+ kTypeShift = 0,
+ kTypeBits = 2,
+ kTypeMask = (1 << kTypeBits) - 1
+ };
+
+ enum Call {
+ // These values, except kDynamic, are only used when throwing
+ // NoSuchMethodError for compile-time resolution failures.
+ kDynamic = 0,
+ kStatic = 1,
+ kConstructor = 2,
+ kTopLevel = 3,
+ kCallShift = kTypeBits,
+ kCallBits = 2,
+ kCallMask = (1 << kCallBits) - 1
+ };
+
+ static int EncodeType(Call call, Type type) {
+ return (call << kCallShift) | type;
+ }
+};
+
+} // namespace dart
+
+#endif // LIB_INVOCATION_MIRROR_H_
« 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