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

Unified Diff: runtime/vm/flow_graph_compiler_shared.cc

Issue 10477020: Move inlined type checking code to new compiler ia32. Sharing more and more code between ia32/x64 (… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/flow_graph_compiler_shared.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_shared.cc
===================================================================
--- runtime/vm/flow_graph_compiler_shared.cc (revision 8286)
+++ runtime/vm/flow_graph_compiler_shared.cc (working copy)
@@ -277,6 +277,54 @@
return false;
}
+
+void FlowGraphCompilerShared::GenerateNumberTypeCheck(
+ Register kClassIdReg,
+ const AbstractType& type,
+ Label* is_instance_lbl,
+ Label* is_not_instance_lbl) {
+ GrowableArray<intptr_t> args;
+ if (type.IsNumberInterface()) {
+ args.Add(kDouble);
+ args.Add(kMint);
+ args.Add(kBigint);
+ } else if (type.IsIntInterface()) {
+ args.Add(kMint);
+ args.Add(kBigint);
+ } else if (type.IsDoubleInterface()) {
+ args.Add(kDouble);
+ }
+ CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
+}
+
+
+void FlowGraphCompilerShared::GenerateStringTypeCheck(
+ Register kClassIdReg,
+ Label* is_instance_lbl,
+ Label* is_not_instance_lbl) {
+ GrowableArray<intptr_t> args;
+ args.Add(kOneByteString);
+ args.Add(kTwoByteString);
+ args.Add(kFourByteString);
+ args.Add(kExternalOneByteString);
+ args.Add(kExternalTwoByteString);
+ args.Add(kExternalFourByteString);
+ CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
+}
+
+
+void FlowGraphCompilerShared::GenerateListTypeCheck(
+ Register kClassIdReg,
+ Label* is_instance_lbl) {
+ Label unknown;
+ GrowableArray<intptr_t> args;
+ args.Add(kArray);
+ args.Add(kGrowableObjectArray);
+ args.Add(kImmutableArray);
+ CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown);
+ assembler()->Bind(&unknown);
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/flow_graph_compiler_shared.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698