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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1408043002: Move native and js interop properties from the element model to the JS backend (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 9f2ad07848b1c694769e936095049a85586fa190..d9a32cb132aa7e0ea6c7f8c581a6c380227e1f3e 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -440,7 +440,7 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
SourceInformation source = sourceInformationBuilder.buildReturn(node);
if (node.beginToken.value == 'native') {
FunctionElement function = irBuilder.state.currentElement;
- assert(function.isNative);
+ assert(compiler.backend.isNative(function));
ast.Node nativeBody = node.expression;
if (nativeBody != null) {
ast.LiteralString jsCode = nativeBody.asLiteralString();
@@ -454,7 +454,9 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
'functions with zero parameters.'));
irBuilder.buildNativeFunctionBody(function, javaScriptCode);
} else {
- irBuilder.buildRedirectingNativeFunctionBody(function, source);
+ JavaScriptBackend backend = compiler.backend;
+ String name = backend.getFixedBackendName(function);
+ irBuilder.buildRedirectingNativeFunctionBody(function, name, source);
}
} else {
irBuilder.buildReturn(
@@ -2792,7 +2794,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
if (value != null) {
instanceArguments.add(value);
} else {
- assert(Elements.isNativeOrExtendsNative(c));
+ assert(backend.isNativeOrExtendsNative(c));
// Native fields are initialized elsewhere.
}
}, includeSuperAndInjectedMembers: true);
@@ -2857,7 +2859,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
if (field.initializer != null) {
fieldValues[field] = inlineExpression(field, field.initializer);
} else {
- if (Elements.isNativeOrExtendsNative(c)) {
+ if (backend.isNativeOrExtendsNative(c)) {
// Native field is initialized elsewhere.
} else {
// Fields without an initializer default to null.
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698