Index: src/jsregexp.cc |
diff --git a/src/jsregexp.cc b/src/jsregexp.cc |
index a33df6f929d2ae50bbcf337de3ec65dc8f827dba..8928d4e2b643cf1d4def309051ced0f74f598d49 100644 |
--- a/src/jsregexp.cc |
+++ b/src/jsregexp.cc |
@@ -32,6 +32,7 @@ |
#include "execution.h" |
#include "factory.h" |
#include "jsregexp.h" |
+#include "jsregexp-inl.h" |
#include "platform.h" |
#include "string-search.h" |
#include "runtime.h" |
@@ -760,68 +761,6 @@ RegExpImpl::GlobalCache::GlobalCache(Handle<JSRegExp> regexp, |
} |
-RegExpImpl::GlobalCache::~GlobalCache() { |
- // Deallocate the register array if we allocated it in the constructor |
- // (as opposed to using the existing jsregexp_static_offsets_vector). |
- if (register_array_size_ > Isolate::kJSRegexpStaticOffsetsVectorSize) { |
- DeleteArray(register_array_); |
- } |
-} |
- |
- |
-int32_t* RegExpImpl::GlobalCache::FetchNext() { |
- current_match_index_++; |
- if (current_match_index_ >= num_matches_) { |
- // Current batch of results exhausted. |
- // Fail if last batch was not even fully filled. |
- if (num_matches_ < max_matches_) { |
- num_matches_ = 0; // Signal failed match. |
- return NULL; |
- } |
- |
- int32_t* last_match = |
- ®ister_array_[(current_match_index_ - 1) * registers_per_match_]; |
- int last_end_index = last_match[1]; |
- |
- if (regexp_->TypeTag() == JSRegExp::ATOM) { |
- num_matches_ = RegExpImpl::AtomExecRaw(regexp_, |
- subject_, |
- last_end_index, |
- register_array_, |
- register_array_size_); |
- } else { |
- int last_start_index = last_match[0]; |
- if (last_start_index == last_end_index) last_end_index++; |
- if (last_end_index > subject_->length()) { |
- num_matches_ = 0; // Signal failed match. |
- return NULL; |
- } |
- num_matches_ = RegExpImpl::IrregexpExecRaw(regexp_, |
- subject_, |
- last_end_index, |
- register_array_, |
- register_array_size_); |
- } |
- |
- if (num_matches_ <= 0) return NULL; |
- current_match_index_ = 0; |
- return register_array_; |
- } else { |
- return ®ister_array_[current_match_index_ * registers_per_match_]; |
- } |
-} |
- |
- |
-int32_t* RegExpImpl::GlobalCache::LastSuccessfulMatch() { |
- int index = current_match_index_ * registers_per_match_; |
- if (num_matches_ == 0) { |
- // After a failed match we shift back by one result. |
- index -= registers_per_match_; |
- } |
- return ®ister_array_[index]; |
-} |
- |
- |
// ------------------------------------------------------------------- |
// Implementation of the Irregexp regular expression engine. |
// |