Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index bb1a50e5747ef3ac8997869192cf7266f9f34119..30c302fd6c19d5a230350d2ee0db4039637d8ad2 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -5359,6 +5359,9 @@ const char* Function::KindToCString(RawFunction::Kind kind) { |
| case RawFunction::kInvokeFieldDispatcher: |
| return "kInvokeFieldDispatcher"; |
| break; |
| + case RawFunction::kIrregexpFunction: |
| + return "kIrregexpFunction"; |
| + break; |
| default: |
| UNREACHABLE(); |
| return NULL; |
| @@ -5444,6 +5447,24 @@ 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); |
| +} |
| + |
|
Ivan Posva
2014/11/03 08:52:21
two lines
zerny-google
2014/11/03 14:03:41
Done.
|
| +void Function::set_regexp_cid(intptr_t regexp_cid) const { |
| + StoreNonPointer(&raw_ptr()->regexp_cid_, regexp_cid); |
|
Ivan Posva
2014/11/03 08:52:21
The cid should be asserted to be a string only cid
zerny-google
2014/11/03 14:03:41
Done.
|
| +} |
| + |
|
Ivan Posva
2014/11/03 08:52:21
two lines
zerny-google
2014/11/03 14:03:41
Done.
|
| void Function::set_result_type(const AbstractType& value) const { |
| ASSERT(!value.IsNull()); |
| StorePointer(&raw_ptr()->result_type_, value.raw()); |
| @@ -6704,6 +6725,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(); |
| } |
| @@ -10380,6 +10404,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())); |
| @@ -19974,6 +19999,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)); |
| } |