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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 683433003: Integrate the Irregexp Regular Expression Engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: byte-order assert & context-var Created 6 years, 1 month 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: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index fc33aafb13d1a22398292ae0094ddafe7bfa4612..a89198dd0e14d40bf47e8ab8ee751ffd5b2fa605 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -7,6 +7,7 @@
#include "vm/cha.h"
#include "vm/bit_vector.h"
#include "vm/il_printer.h"
+#include "vm/regexp_assembler.h"
namespace dart {
@@ -716,6 +717,21 @@ CompileType ParameterInstr::ComputeType() const {
}
const Function& function = graph_entry->parsed_function().function();
+ if (function.IsIrregexpFunction()) {
+ // In irregexp functions, types of input parameters are known and immutable.
+ // Set parameter types here in order to prevent unnecessary CheckClassInstr
+ // from being generated.
+ switch (index()) {
+ case RegExpMacroAssembler::kParamStringIndex:
+ return CompileType::FromCid(function.regexp_cid());
+ case RegExpMacroAssembler::kParamStartOffsetIndex:
+ return CompileType::FromCid(kSmiCid);
+ default: UNREACHABLE();
+ }
+ UNREACHABLE();
+ return CompileType::Dynamic();
+ }
+
LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope();
const AbstractType& type = scope->VariableAt(index())->type();
@@ -1013,6 +1029,21 @@ CompileType LoadFieldInstr::ComputeType() const {
}
+CompileType LoadCodeUnitsInstr::ComputeType() const {
+ switch (class_id()) {
+ case kOneByteStringCid:
+ case kExternalOneByteStringCid:
+ case kTwoByteStringCid:
+ case kExternalTwoByteStringCid:
+ return can_pack_into_smi() ? CompileType::FromCid(kSmiCid)
+ : CompileType::Int();
+ default:
+ UNIMPLEMENTED();
+ return CompileType::Dynamic();
+ }
+}
+
+
CompileType BinaryInt32OpInstr::ComputeType() const {
// TODO(vegorov): range analysis information shall be used here.
return CompileType::Int();
@@ -1272,6 +1303,11 @@ CompileType MathMinMaxInstr::ComputeType() const {
}
+CompileType CaseInsensitiveCompareUC16Instr::ComputeType() const {
+ return CompileType::FromCid(kBoolCid);
+}
+
+
CompileType UnboxInstr::ComputeType() const {
switch (representation()) {
case kUnboxedDouble:

Powered by Google App Engine
This is Rietveld 408576698