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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart

Issue 1245833003: dart2js: Support checked setters in the program builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix bad copy/paste. Created 5 years, 5 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/js_emitter/model.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
index a526b4813b03469f451cc6831f12e495f308e072..7174c460f4565a065a9dd3cca15ce35fa6412063 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
@@ -350,7 +350,7 @@ class ProgramBuilder {
js.Name name = namer.className(element);
return new Class(
- element, name, null, [], instanceFields, [], [], [], [], [], null,
+ element, name, null, [], instanceFields, [], [], [], [], [], [], null,
isDirectlyInstantiated: true,
onlyForRti: false,
isNative: element.isNative);
@@ -430,6 +430,18 @@ class ProgramBuilder {
element,
storeFunctionTypeInMetadata: _storeFunctionTypesInMetadata);
+ List<StubMethod> checkedSetters = <StubMethod>[];
+ for (Field field in instanceFields) {
+ if (field.needsCheckedSetter) {
+ assert(!field.needsUncheckedSetter);
+ Element element = field.element;
+ js.Expression code = backend.generatedCode[element];
+ assert(code != null);
+ js.Name name = namer.deriveSetterName(field.accessorName);
+ checkedSetters.add(_buildStubMethod(name, code, element: element));
+ }
+ }
+
List<StubMethod> isChecks = <StubMethod>[];
typeTests.properties.forEach((js.Name name, js.Node code) {
isChecks.add(_buildStubMethod(name, code));
@@ -454,6 +466,7 @@ class ProgramBuilder {
staticFieldsForReflection,
callStubs,
typeVariableReaderStubs,
+ checkedSetters,
isChecks,
typeTests.functionTypeIndex,
isDirectlyInstantiated: isInstantiated,
@@ -465,6 +478,7 @@ class ProgramBuilder {
callStubs,
typeVariableReaderStubs,
noSuchMethodStubs,
+ checkedSetters,
isChecks,
typeTests.functionTypeIndex,
isDirectlyInstantiated: isInstantiated,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698