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

Unified Diff: runtime/vm/intermediate_language.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/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 69fcda120b6c1c19473811a09e8d286b39e5c86d..6909bde834ac696ce9d1ab9911c1ff3313c3700f 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -17,6 +17,7 @@
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/os.h"
+#include "vm/regexp_assembler.h"
#include "vm/resolver.h"
#include "vm/scopes.h"
#include "vm/stub_code.h"
@@ -370,6 +371,14 @@ bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
}
+bool LoadCodeUnitsInstr::AttributesEqual(Instruction* other) const {
+ LoadCodeUnitsInstr* other_load = other->AsLoadCodeUnits();
+ ASSERT(other_load != NULL);
+ return (class_id() == other_load->class_id() &&
+ element_count() == other_load->element_count());
+}
+
+
ConstantInstr::ConstantInstr(const Object& value) : value_(value) {
// Check that the value is not an incorrect Integer representation.
ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoSmi());
@@ -460,6 +469,7 @@ GraphEntryInstr::GraphEntryInstr(const ParsedFunction* parsed_function,
parsed_function_(parsed_function),
normal_entry_(normal_entry),
catch_entries_(),
+ indirect_entries_(),
initial_definitions_(),
osr_id_(osr_id),
entry_count_(0),
@@ -1123,8 +1133,12 @@ intptr_t GraphEntryInstr::SuccessorCount() const {
BlockEntryInstr* GraphEntryInstr::SuccessorAt(intptr_t index) const {
- if (index == 0) return normal_entry_;
- return catch_entries_[index - 1];
+ if (index == 0) {
+ return normal_entry_;
+ } else {
+ ASSERT(index < catch_entries_.length() + 1);
srdjan 2014/09/22 22:34:07 Add parentheses.
jgruber1 2014/09/23 10:58:46 Reverted this change since it was functionally ide
+ return catch_entries_[index - 1];
+ }
}
@@ -1776,6 +1790,12 @@ Definition* MathUnaryInstr::Canonicalize(FlowGraph* flow_graph) {
}
+Definition* CaseInsensitiveCompareUC16Instr::Canonicalize(
+ FlowGraph* flow_graph) {
+ return this;
+}
+
+
Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) {
if (!HasUses()) return NULL;
if (!IsImmutableLengthLoad()) return this;
@@ -2508,6 +2528,13 @@ void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* IndirectEntryInstr::MakeLocationSummary(
+ Isolate* isolate, bool optimizing) const {
+ UNREACHABLE();
+ return NULL;
+}
+
+
LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate,
bool optimizing) const {
UNREACHABLE();
@@ -3288,6 +3315,23 @@ const char* MathUnaryInstr::KindToCString(MathUnaryKind kind) {
return "";
}
+typedef RawBool* (*CaseInsensitiveCompareUC16Function) (
+ RawString* string_raw,
+ RawSmi* lhs_index_raw,
+ RawSmi* rhs_index_raw,
+ RawSmi* length_raw);
+
+
+extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry(
+ "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>(
+ static_cast<CaseInsensitiveCompareUC16Function>(
+ &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false);
+
+
+const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const {
+ return kCaseInsensitiveCompareUC16RuntimeEntry;
+}
+
MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs,
intptr_t original_deopt_id,

Powered by Google App Engine
This is Rietveld 408576698