Chromium Code Reviews| Index: runtime/vm/object.h |
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
| index cd60a4f378647e708293e5e7ed9c6b31591aba03..3058b0a653bec1272e856d36bec5e845750554aa 100644 |
| --- a/runtime/vm/object.h |
| +++ b/runtime/vm/object.h |
| @@ -1643,6 +1643,16 @@ class Function : public Object { |
| RawClass* origin() const; |
| RawScript* script() const; |
| + void set_regexp(const JSRegExp& value) const; |
| + RawJSRegExp* regexp() const { return raw_ptr()->regexp_; } |
| + |
| + void set_regexp_specialization(intptr_t cid) { |
| + raw_ptr()->regexp_specialization_ = cid; |
|
Florian Schneider
2014/10/01 17:04:15
I think you can use the kind-specific data_ field
jgruber1
2014/10/03 18:59:54
data_ now stores the RawJSRegExp pointer, and I re
|
| + } |
| + intptr_t regexp_specialization() const { |
| + return raw_ptr()->regexp_specialization_; |
| + } |
| + |
| RawAbstractType* result_type() const { return raw_ptr()->result_type_; } |
| void set_result_type(const AbstractType& value) const; |
| @@ -1771,6 +1781,7 @@ class Function : public Object { |
| case RawFunction::kMethodExtractor: |
| case RawFunction::kNoSuchMethodDispatcher: |
| case RawFunction::kInvokeFieldDispatcher: |
| + case RawFunction::kIrregexpFunction: |
| return true; |
| case RawFunction::kClosureFunction: |
| case RawFunction::kConstructor: |
| @@ -1792,6 +1803,7 @@ class Function : public Object { |
| case RawFunction::kImplicitGetter: |
| case RawFunction::kImplicitSetter: |
| case RawFunction::kImplicitStaticFinalGetter: |
| + case RawFunction::kIrregexpFunction: |
| return true; |
| case RawFunction::kClosureFunction: |
| case RawFunction::kConstructor: |
| @@ -2031,6 +2043,11 @@ class Function : public Object { |
| return kind() == RawFunction::kClosureFunction; |
| } |
| + // Returns true if this function represents a generated irregexp function. |
| + bool IsIrregexpFunction() const { |
| + return kind() == RawFunction::kIrregexpFunction; |
| + } |
| + |
| // Returns true if this function represents an implicit closure function. |
| bool IsImplicitClosureFunction() const; |
| @@ -3507,6 +3524,7 @@ class ICData : public Object { |
| V(DoubleToSmi) \ |
| V(Int32Load) \ |
| V(Uint32Load) \ |
| + V(CodeUnitsLoad) \ |
|
Florian Schneider
2014/10/01 17:04:15
No need, since I don't see any deoptimizations in
jgruber1
2014/10/03 18:59:54
Done.
|
| V(GuardField) \ |
| V(TestCids) \ |
| V(NumReasons) \ |
| @@ -7168,11 +7186,70 @@ class JSRegExp : public Instance { |
| bool is_multi_line() const { return (flags() & kMultiLine); } |
| RawString* pattern() const { return raw_ptr()->pattern_; } |
| + |
| + static intptr_t subject_offset(intptr_t cid) { |
| + switch (cid) { |
| + case kOneByteStringCid: return OFFSET_OF(RawJSRegExp, one_byte_subject_); |
| + case kTwoByteStringCid: return OFFSET_OF(RawJSRegExp, two_byte_subject_); |
| + case kExternalOneByteStringCid: |
| + return OFFSET_OF(RawJSRegExp, external_one_byte_subject_); |
| + case kExternalTwoByteStringCid: |
| + return OFFSET_OF(RawJSRegExp, external_two_byte_subject_); |
| + } |
| + |
| + UNREACHABLE(); |
| + return -1; |
| + } |
| + RawString* sample_subject(intptr_t cid) const { |
| + switch (cid) { |
| + case kOneByteStringCid: return raw_ptr()->one_byte_subject_; |
| + case kTwoByteStringCid: return raw_ptr()->two_byte_subject_; |
| + case kExternalOneByteStringCid: |
| + return raw_ptr()->external_one_byte_subject_; |
| + case kExternalTwoByteStringCid: |
| + return raw_ptr()->external_two_byte_subject_; |
| + } |
| + |
| + UNREACHABLE(); |
| + return String::null(); |
| + } |
| + |
| RawSmi* num_bracket_expressions() const { |
| return raw_ptr()->num_bracket_expressions_; |
| } |
| + static intptr_t function_offset(intptr_t cid) { |
| + switch (cid) { |
| + case kOneByteStringCid: return OFFSET_OF(RawJSRegExp, one_byte_function_); |
| + case kTwoByteStringCid: return OFFSET_OF(RawJSRegExp, two_byte_function_); |
| + case kExternalOneByteStringCid: |
| + return OFFSET_OF(RawJSRegExp, external_one_byte_function_); |
| + case kExternalTwoByteStringCid: |
| + return OFFSET_OF(RawJSRegExp, external_two_byte_function_); |
| + } |
| + |
| + UNREACHABLE(); |
| + return -1; |
| + } |
| + |
| + RawFunction* function(intptr_t cid) const { |
| + switch (cid) { |
| + case kOneByteStringCid: return raw_ptr()->one_byte_function_; |
| + case kTwoByteStringCid: return raw_ptr()->two_byte_function_; |
| + case kExternalOneByteStringCid: |
| + return raw_ptr()->external_one_byte_function_; |
| + case kExternalTwoByteStringCid: |
| + return raw_ptr()->external_two_byte_function_; |
| + } |
| + |
| + UNREACHABLE(); |
| + return Function::null(); |
| + } |
| + |
| void set_pattern(const String& pattern) const; |
| + void set_function(intptr_t cid, const Function& value); |
| + void set_sample_subject(intptr_t cid, const String& value) const; |
| + |
| void set_num_bracket_expressions(intptr_t value) const; |
| void set_is_global() const { set_flags(flags() | kGlobal); } |
| void set_is_ignore_case() const { set_flags(flags() | kIgnoreCase); } |