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

Unified Diff: runtime/vm/object.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: Addressed Ivan's comments. Created 6 years, 2 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/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index be9e0298b03c1ce78d9259db7d4cfde68920042b..0e9f87aba7f6d90d837aca78a81721ae8851627e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -5298,6 +5298,9 @@ const char* Function::KindToCString(RawFunction::Kind kind) {
case RawFunction::kInvokeFieldDispatcher:
return "kInvokeFieldDispatcher";
break;
+ case RawFunction::kIrregexpFunction:
+ return "kIrregexpFunction";
+ break;
default:
UNREACHABLE();
return NULL;
@@ -5383,6 +5386,21 @@ void Function::set_owner(const Object& value) const {
}
+RawJSRegExp* Function::regexp() const {
+ ASSERT(kind() == RawFunction::kIrregexpFunction);
+ const Object& obj = Object::Handle(raw_ptr()->data_);
+ ASSERT(obj.IsJSRegExp());
+ return JSRegExp::Cast(obj).raw();
+}
+
+
+void Function::set_regexp(const JSRegExp& value) const {
+ ASSERT(kind() == RawFunction::kIrregexpFunction);
+ ASSERT(raw_ptr()->data_ == Object::null());
+ set_data(value);
+}
+
+
void Function::set_result_type(const AbstractType& value) const {
ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->result_type_, value.raw());
@@ -6640,6 +6658,9 @@ const char* Function::ToCString() const {
case RawFunction::kInvokeFieldDispatcher:
kind_str = "invoke-field-dispatcher";
break;
+ case RawFunction::kIrregexpFunction:
+ kind_str = "irregexp-function";
+ break;
default:
UNREACHABLE();
}
@@ -10316,6 +10337,7 @@ void Library::CheckFunctionFingerprints() {
all_libs.Add(&Library::ZoneHandle(Library::CoreLibrary()));
CORE_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
+ CORE_REGEXP_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
CORE_INTEGER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
@@ -19926,6 +19948,11 @@ void JSRegExp::set_pattern(const String& pattern) const {
}
+void JSRegExp::set_function(intptr_t cid, const Function& value) const {
+ StorePointer(FunctionAddr(cid), value.raw());
+}
+
+
void JSRegExp::set_num_bracket_expressions(intptr_t value) const {
StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value));
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698