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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 11858017: Nice messages on uncaught exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments and fix a type error Created 7 years, 11 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 | « dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index da67629d995a221537e84d42d5c342b0cecaa421..670acbc72910fca08cffc6f3e136c68046be1898 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3079,16 +3079,16 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
}
}
- void handleForeignDartClosureToJs(Send node) {
+ FunctionSignature handleForeignRawFunctionRef(Send node, String name) {
ahe 2013/01/15 10:34:30 Found a type error during testing.
if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
- compiler.cancel('Exactly one argument required',
+ compiler.cancel('$name requires exactly one argument',
node: node.argumentsNode);
}
Node closure = node.arguments.head;
Element element = elements[closure];
if (!Elements.isStaticOrTopLevelFunction(element)) {
compiler.cancel(
- 'JS_TO_CLOSURE requires a static or top-level method',
+ '$name requires a static or top-level method',
node: closure);
}
FunctionElement function = element;
@@ -3099,10 +3099,15 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
FunctionSignature params = implementation.computeSignature(compiler);
if (params.optionalParameterCount != 0) {
compiler.cancel(
- 'JS_TO_CLOSURE does not handle closure with optional parameters',
+ '$name does not handle closure with optional parameters',
node: closure);
}
visit(closure);
+ return params;
+ }
+
+ void handleForeignDartClosureToJs(Send node, String name) {
+ FunctionSignature params = handleForeignRawFunctionRef(node, name);
List<HInstruction> inputs = <HInstruction>[pop()];
String invocationName = backend.namer.closureInvocationName(
new Selector.callClosure(params.requiredParameterCount));
@@ -3148,7 +3153,9 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
} else if (name == const SourceString('JS_CALL_IN_ISOLATE')) {
handleForeignJsCallInIsolate(node);
} else if (name == const SourceString('DART_CLOSURE_TO_JS')) {
- handleForeignDartClosureToJs(node);
+ handleForeignDartClosureToJs(node, 'DART_CLOSURE_TO_JS');
+ } else if (name == const SourceString('RAW_DART_FUNCTION_REF')) {
+ handleForeignRawFunctionRef(node, 'RAW_DART_FUNCTION_REF');
} else if (name == const SourceString('JS_SET_CURRENT_ISOLATE')) {
handleForeignSetCurrentIsolate(node);
} else if (name == const SourceString('JS_CREATE_ISOLATE')) {
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698