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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1110813005: cps-ir: Implement type tests for interface types without type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 5 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: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 7def6be498043d7a006c81f2b43635c8999b6ab1..aeb4fb83d503180aa0b7cc191ed501e59e7bbde9 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -1642,6 +1642,18 @@ class JavaScriptBackend extends Backend {
element == jsFixedArrayClass;
}
+ /// Return [true] if the class is represented by a native JavaSCript type in
+ /// the generated code.
+ bool isNativePrimitiveType(ClassElement cls ) {
+ // TODO(karlklose): cleanup/merge with hasDirectCheck, when the rest of the
+ // checks are implemented in the CPS IR.
+ return cls == compiler.intClass ||
+ cls == compiler.numClass ||
+ cls == compiler.doubleClass ||
+ cls == compiler.boolClass ||
+ cls == compiler.stringClass;
+ }
+
bool mayGenerateInstanceofCheck(DartType type) {
// We can use an instanceof check for raw types that have no subclass that
// is mixed-in or in an implements clause.
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698