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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class InterceptorStubGenerator { 7 class InterceptorStubGenerator {
8 final Compiler compiler; 8 final Compiler compiler;
9 final Namer namer; 9 final Namer namer;
10 final JavaScriptBackend backend; 10 final JavaScriptBackend backend;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 bool containsString = classes.contains(helpers.jsStringClass); 239 bool containsString = classes.contains(helpers.jsStringClass);
240 bool containsJsIndexable = 240 bool containsJsIndexable =
241 helpers.jsIndexingBehaviorInterface.isResolved && classes.any((cls) { 241 helpers.jsIndexingBehaviorInterface.isResolved && classes.any((cls) {
242 return compiler.world.isSubtypeOf(cls, 242 return compiler.world.isSubtypeOf(cls,
243 helpers.jsIndexingBehaviorInterface); 243 helpers.jsIndexingBehaviorInterface);
244 }); 244 });
245 // The index set operator requires a check on its set value in 245 // The index set operator requires a check on its set value in
246 // checked mode, so we don't optimize the interceptor if the 246 // checked mode, so we don't optimize the interceptor if the
247 // compiler has type assertions enabled. 247 // compiler has type assertions enabled.
248 if (selector.isIndexSet 248 if (selector.isIndexSet
249 && (compiler.enableTypeAssertions || !containsArray)) { 249 && (compiler.options.enableTypeAssertions || !containsArray)) {
250 return null; 250 return null;
251 } 251 }
252 if (!containsArray && !containsString) { 252 if (!containsArray && !containsString) {
253 return null; 253 return null;
254 } 254 }
255 jsAst.Expression arrayCheck = js('receiver.constructor == Array'); 255 jsAst.Expression arrayCheck = js('receiver.constructor == Array');
256 jsAst.Expression indexableCheck = 256 jsAst.Expression indexableCheck =
257 backend.generateIsJsIndexableCall(js('receiver'), js('receiver')); 257 backend.generateIsJsIndexableCall(js('receiver'), js('receiver'));
258 258
259 jsAst.Expression orExp(left, right) { 259 jsAst.Expression orExp(left, right) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 var map = new jsAst.ObjectInitializer(properties); 378 var map = new jsAst.ObjectInitializer(properties);
379 elements.add(map); 379 elements.add(map);
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 return new jsAst.ArrayInitializer(elements); 384 return new jsAst.ArrayInitializer(elements);
385 } 385 }
386 } 386 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/headers.dart ('k') | pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698