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

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

Issue 11411215: Generate parameter stubs using ASTs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 202fb6e34606cd6c61706cfa16c3393d45d6146f..2e1ca1d9650e7933f22d0f3eac1fd6586cd0f969 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -73,7 +73,8 @@ class SsaCodeGeneratorTask extends CompilerTask {
FunctionElement element = work.element;
js.Block body;
ClassElement enclosingClass = element.getEnclosingClass();
- bool allowVariableMinification;
+ bool allowVariableMinification = !codegen.visitedForeignCode;
+
if (element.isInstanceMember()
&& enclosingClass.isNative()
&& native.isOverriddenMethod(
@@ -83,18 +84,13 @@ class SsaCodeGeneratorTask extends CompilerTask {
// and needs to know if the method is overridden.
nativeEmitter.overriddenMethods.add(element);
StringBuffer buffer = new StringBuffer();
- String codeString = prettyPrint(codegen.body).toString();
- String parametersString =
- Strings.join(codegen.parameterNames.values, ", ");
- native.generateMethodWithPrototypeCheckForElement(
- compiler, buffer, element, codeString, parametersString);
- js.Node nativeCode = new js.LiteralStatement(buffer.toString());
- body = new js.Block(<js.Statement>[nativeCode]);
- allowVariableMinification = false;
+ body =
+ nativeEmitter.generateMethodBodyWithPrototypeCheckForElement(
+ element, codegen.body, codegen.parameters);
} else {
body = codegen.body;
- allowVariableMinification = !codegen.visitedForeignCode;
}
+
js.Fun fun = buildJavaScriptFunction(element, codegen.parameters, body);
return prettyPrint(fun,
allowVariableMinification: allowVariableMinification);

Powered by Google App Engine
This is Rietveld 408576698