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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to current version Created 6 years, 3 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: 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 0501f6a944faa1ea535e2d1ad5a2cee2c6c317cb..3adebcb4664d4f32c1b0e84edd57d26abc72c6c7 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 {
@@ -714,6 +715,19 @@ 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.
+ switch (index()) {
+ case RegExpMacroAssembler::kParamStringIndex:
+ return CompileType::FromCid(function.regexp_specialization());
+ case RegExpMacroAssembler::kParamStartOffsetIndex:
+ return CompileType::FromCid(kSmiCid);
+ default: UNREACHABLE();
srdjan 2014/09/22 22:34:07 Indent case (see other switch examples).
jgruber1 2014/09/23 10:58:46 Done.
+ }
+ UNREACHABLE();
+ return CompileType::Dynamic();
+ }
+
LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope();
const AbstractType& type = scope->VariableAt(index())->type();
@@ -1288,6 +1302,11 @@ CompileType MathMinMaxInstr::ComputeType() const {
}
+CompileType CaseInsensitiveCompareUC16Instr::ComputeType() const {
+ return CompileType::FromCid(kSmiCid);
+}
+
+
CompileType UnboxDoubleInstr::ComputeType() const {
return CompileType::FromCid(kDoubleCid);
}

Powered by Google App Engine
This is Rietveld 408576698