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

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

Issue 13940015: Allow using native JS []= on typed data lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index e9b299d0798e3c52d495213df7bee82b98f48a68..a257b337eb4d205926602f7a3978f391b68bb962 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -53,7 +53,7 @@ class SsaOptimizerTask extends CompilerTask {
new SsaReceiverSpecialization(compiler),
new SsaGlobalValueNumberer(compiler),
new SsaCodeMotion(),
- new SsaValueRangeAnalyzer(constantSystem, work),
+ new SsaValueRangeAnalyzer(compiler, constantSystem, work),
// Previous optimizations may have generated new
// opportunities for constant folding.
new SsaConstantFolder(constantSystem, backend, work),
@@ -234,16 +234,7 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
HInstruction tryOptimizeLengthInterceptedGetter(HInvokeDynamic node) {
HInstruction actualReceiver = node.inputs[1];
-
- // TODO(kasperl): Get rid of HType.isIndexablePrimitive() and use
- // something like this everywhere instead.
- TypeMask mask = actualReceiver.instructionType.computeMask(compiler);
- DartType base = backend.jsIndexableClass.computeType(compiler);
- TypeMask indexable = new TypeMask.nonNullSubtype(base);
- TypeMask union = indexable.union(mask, compiler);
- bool isIndexable = (union == indexable);
-
- if (isIndexable) {
+ if (actualReceiver.isIndexable(compiler)) {
if (actualReceiver.isConstantString()) {
HConstant constantInput = actualReceiver;
StringConstant constant = constantInput.constant;

Powered by Google App Engine
This is Rietveld 408576698