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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1457383003: Alternative fix for the js-interop crash. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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 part of ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 final SsaCodeGeneratorTask generator; 8 final SsaCodeGeneratorTask generator;
9 final SsaBuilderTask builder; 9 final SsaBuilderTask builder;
10 final SsaOptimizerTask optimizer; 10 final SsaOptimizerTask optimizer;
(...skipping 5920 matching lines...) Expand 10 before | Expand all | Expand 10 after
5931 argsStub.add('#'); 5931 argsStub.add('#');
5932 } 5932 }
5933 5933
5934 if (element.isConstructor) { 5934 if (element.isConstructor) {
5935 codeTemplate = js.js.parseForeignJS("new #(${argsStub.join(",")})"); 5935 codeTemplate = js.js.parseForeignJS("new #(${argsStub.join(",")})");
5936 } else { 5936 } else {
5937 codeTemplate = js.js.parseForeignJS("#(${argsStub.join(",")})"); 5937 codeTemplate = js.js.parseForeignJS("#(${argsStub.join(",")})");
5938 } 5938 }
5939 } 5939 }
5940 5940
5941 DartType type = backend.helpers.jsJavaScriptObjectClass.thisType;
5941 var nativeBehavior = new native.NativeBehavior() 5942 var nativeBehavior = new native.NativeBehavior()
5942 ..codeTemplate = codeTemplate 5943 ..codeTemplate = codeTemplate
5943 ..typesReturned.add( 5944 ..typesReturned.add(type)
5944 helpers.jsJavaScriptObjectClass.thisType) 5945 ..typesInstantiated.add(type)
5945 ..typesInstantiated.add(
5946 helpers.jsJavaScriptObjectClass.thisType)
5947 ..sideEffects.setAllSideEffects(); 5946 ..sideEffects.setAllSideEffects();
5948 return new HForeignCode( 5947 return new HForeignCode(
5949 codeTemplate, 5948 codeTemplate,
5950 backend.dynamicType, inputs, 5949 backend.dynamicType, inputs,
5951 nativeBehavior: nativeBehavior) 5950 nativeBehavior: nativeBehavior)
5952 ..sourceInformation = sourceInformation; 5951 ..sourceInformation = sourceInformation;
5953 } 5952 }
5954 5953
5955 void pushInvokeStatic(ast.Node location, 5954 void pushInvokeStatic(ast.Node location,
5956 Element element, 5955 Element element,
(...skipping 3204 matching lines...) Expand 10 before | Expand all | Expand 10 after
9161 if (unaliased is TypedefType) throw 'unable to unalias $type'; 9160 if (unaliased is TypedefType) throw 'unable to unalias $type';
9162 unaliased.accept(this, builder); 9161 unaliased.accept(this, builder);
9163 } 9162 }
9164 9163
9165 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9164 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9166 JavaScriptBackend backend = builder.compiler.backend; 9165 JavaScriptBackend backend = builder.compiler.backend;
9167 ClassElement cls = backend.helpers.DynamicRuntimeType; 9166 ClassElement cls = backend.helpers.DynamicRuntimeType;
9168 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9167 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9169 } 9168 }
9170 } 9169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698