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

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

Issue 12610004: Start using the new union/intersection code for HType.INDEXABLE_PRIMITIVE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify even further. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart b/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
index da404e018782d889557f87d9c9354abc19d99cdc..a40fb89fe28cdd71aadb20dd30b7bfe15152ac66 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
@@ -132,6 +132,12 @@ class SsaTypeGuardInserter extends SsaNonSpeculativeTypePropagator
if (speculatedType.element == backend.jsNumberClass) {
speculatedType = compiler.numClass.computeType(compiler);
}
+ // Use the JSString type instead of String because String is
+ // not assignment compatible with JSIndexable, but we still
+ // want to generate a type guard.
+ if (sourceType.element == compiler.stringClass) {
+ sourceType = backend.jsStringClass.computeType(compiler);
+ }
if (!compiler.types.isAssignable(speculatedType, sourceType)) {
return false;
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/js_string.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698