diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-11-30 21:22:40 -0800 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-12-04 00:06:01 -0800 |
commit | 8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02 (patch) | |
tree | 8698af91526d0eac90840dcba1e5b565160105c4 /deps/v8/src/regexp | |
parent | 8a2acd4cc9807510786b4b6f7ad3a947aeb3a14c (diff) | |
download | android-node-v8-8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02.tar.gz android-node-v8-8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02.tar.bz2 android-node-v8-8a43a3d7619fde59f0d1f2fad05d8ae7d1732b02.zip |
deps: upgrade V8 to 4.7.80.24
Pick up the latest branch head for V8 4.7:
https://github.com/v8/v8/commit/be169f8df059040e6a53ec1dd4579d8bca2167b5
Full change history for the 4.7 branch:
https://chromium.googlesource.com/v8/v8.git/+log/branch-heads/4.7
V8 blog post about what is new on V8 4.7:
http://v8project.blogspot.de/2015/10/v8-release-47.html
PR-URL: https://github.com/nodejs/node/pull/4106
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
Diffstat (limited to 'deps/v8/src/regexp')
-rw-r--r-- | deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc | 2 | ||||
-rw-r--r-- | deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc | 2 | ||||
-rw-r--r-- | deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc | 2 | ||||
-rw-r--r-- | deps/v8/src/regexp/jsregexp.cc | 94 | ||||
-rw-r--r-- | deps/v8/src/regexp/jsregexp.h | 26 | ||||
-rw-r--r-- | deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc | 10 | ||||
-rw-r--r-- | deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc | 2 | ||||
-rw-r--r-- | deps/v8/src/regexp/regexp-macro-assembler.cc | 1 | ||||
-rw-r--r-- | deps/v8/src/regexp/regexp-stack.cc | 1 | ||||
-rw-r--r-- | deps/v8/src/regexp/x64/regexp-macro-assembler-x64.cc | 2 | ||||
-rw-r--r-- | deps/v8/src/regexp/x87/regexp-macro-assembler-x87.cc | 2 |
11 files changed, 131 insertions, 13 deletions
diff --git a/deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc b/deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc index d502060440..d296d90e7d 100644 --- a/deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc +++ b/deps/v8/src/regexp/arm/regexp-macro-assembler-arm.cc @@ -7,9 +7,9 @@ #include "src/regexp/arm/regexp-macro-assembler-arm.h" #include "src/code-stubs.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" diff --git a/deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc b/deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc index ed24cf3401..d440879e26 100644 --- a/deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc +++ b/deps/v8/src/regexp/arm64/regexp-macro-assembler-arm64.cc @@ -7,9 +7,9 @@ #include "src/regexp/arm64/regexp-macro-assembler-arm64.h" #include "src/code-stubs.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" diff --git a/deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc b/deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc index 3ba5db14f2..9e50a10574 100644 --- a/deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc +++ b/deps/v8/src/regexp/ia32/regexp-macro-assembler-ia32.cc @@ -6,9 +6,9 @@ #include "src/regexp/ia32/regexp-macro-assembler-ia32.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" diff --git a/deps/v8/src/regexp/jsregexp.cc b/deps/v8/src/regexp/jsregexp.cc index aacaa1b9d3..438d1b1368 100644 --- a/deps/v8/src/regexp/jsregexp.cc +++ b/deps/v8/src/regexp/jsregexp.cc @@ -10,6 +10,7 @@ #include "src/compiler.h" #include "src/execution.h" #include "src/factory.h" +#include "src/isolate-inl.h" #include "src/messages.h" #include "src/ostreams.h" #include "src/parser.h" @@ -6406,5 +6407,98 @@ bool RegExpEngine::TooMuchRegExpCode(Handle<String> pattern) { } return too_much; } + + +Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string, + Object* key_pattern, ResultsCacheType type) { + FixedArray* cache; + if (!key_string->IsInternalizedString()) return Smi::FromInt(0); + if (type == STRING_SPLIT_SUBSTRINGS) { + DCHECK(key_pattern->IsString()); + if (!key_pattern->IsInternalizedString()) return Smi::FromInt(0); + cache = heap->string_split_cache(); + } else { + DCHECK(type == REGEXP_MULTIPLE_INDICES); + DCHECK(key_pattern->IsFixedArray()); + cache = heap->regexp_multiple_cache(); + } + + uint32_t hash = key_string->Hash(); + uint32_t index = ((hash & (kRegExpResultsCacheSize - 1)) & + ~(kArrayEntriesPerCacheEntry - 1)); + if (cache->get(index + kStringOffset) == key_string && + cache->get(index + kPatternOffset) == key_pattern) { + return cache->get(index + kArrayOffset); + } + index = + ((index + kArrayEntriesPerCacheEntry) & (kRegExpResultsCacheSize - 1)); + if (cache->get(index + kStringOffset) == key_string && + cache->get(index + kPatternOffset) == key_pattern) { + return cache->get(index + kArrayOffset); + } + return Smi::FromInt(0); +} + + +void RegExpResultsCache::Enter(Isolate* isolate, Handle<String> key_string, + Handle<Object> key_pattern, + Handle<FixedArray> value_array, + ResultsCacheType type) { + Factory* factory = isolate->factory(); + Handle<FixedArray> cache; + if (!key_string->IsInternalizedString()) return; + if (type == STRING_SPLIT_SUBSTRINGS) { + DCHECK(key_pattern->IsString()); + if (!key_pattern->IsInternalizedString()) return; + cache = factory->string_split_cache(); + } else { + DCHECK(type == REGEXP_MULTIPLE_INDICES); + DCHECK(key_pattern->IsFixedArray()); + cache = factory->regexp_multiple_cache(); + } + + uint32_t hash = key_string->Hash(); + uint32_t index = ((hash & (kRegExpResultsCacheSize - 1)) & + ~(kArrayEntriesPerCacheEntry - 1)); + if (cache->get(index + kStringOffset) == Smi::FromInt(0)) { + cache->set(index + kStringOffset, *key_string); + cache->set(index + kPatternOffset, *key_pattern); + cache->set(index + kArrayOffset, *value_array); + } else { + uint32_t index2 = + ((index + kArrayEntriesPerCacheEntry) & (kRegExpResultsCacheSize - 1)); + if (cache->get(index2 + kStringOffset) == Smi::FromInt(0)) { + cache->set(index2 + kStringOffset, *key_string); + cache->set(index2 + kPatternOffset, *key_pattern); + cache->set(index2 + kArrayOffset, *value_array); + } else { + cache->set(index2 + kStringOffset, Smi::FromInt(0)); + cache->set(index2 + kPatternOffset, Smi::FromInt(0)); + cache->set(index2 + kArrayOffset, Smi::FromInt(0)); + cache->set(index + kStringOffset, *key_string); + cache->set(index + kPatternOffset, *key_pattern); + cache->set(index + kArrayOffset, *value_array); + } + } + // If the array is a reasonably short list of substrings, convert it into a + // list of internalized strings. + if (type == STRING_SPLIT_SUBSTRINGS && value_array->length() < 100) { + for (int i = 0; i < value_array->length(); i++) { + Handle<String> str(String::cast(value_array->get(i)), isolate); + Handle<String> internalized_str = factory->InternalizeString(str); + value_array->set(i, *internalized_str); + } + } + // Convert backing store to a copy-on-write array. + value_array->set_map_no_write_barrier(*factory->fixed_cow_array_map()); +} + + +void RegExpResultsCache::Clear(FixedArray* cache) { + for (int i = 0; i < kRegExpResultsCacheSize; i++) { + cache->set(i, Smi::FromInt(0)); + } +} + } // namespace internal } // namespace v8 diff --git a/deps/v8/src/regexp/jsregexp.h b/deps/v8/src/regexp/jsregexp.h index 39e702149d..760d37862b 100644 --- a/deps/v8/src/regexp/jsregexp.h +++ b/deps/v8/src/regexp/jsregexp.h @@ -1659,6 +1659,30 @@ class RegExpEngine: public AllStatic { }; -} } // namespace v8::internal +class RegExpResultsCache : public AllStatic { + public: + enum ResultsCacheType { REGEXP_MULTIPLE_INDICES, STRING_SPLIT_SUBSTRINGS }; + + // Attempt to retrieve a cached result. On failure, 0 is returned as a Smi. + // On success, the returned result is guaranteed to be a COW-array. + static Object* Lookup(Heap* heap, String* key_string, Object* key_pattern, + ResultsCacheType type); + // Attempt to add value_array to the cache specified by type. On success, + // value_array is turned into a COW-array. + static void Enter(Isolate* isolate, Handle<String> key_string, + Handle<Object> key_pattern, Handle<FixedArray> value_array, + ResultsCacheType type); + static void Clear(FixedArray* cache); + static const int kRegExpResultsCacheSize = 0x100; + + private: + static const int kArrayEntriesPerCacheEntry = 4; + static const int kStringOffset = 0; + static const int kPatternOffset = 1; + static const int kArrayOffset = 2; +}; + +} // namespace internal +} // namespace v8 #endif // V8_REGEXP_JSREGEXP_H_ diff --git a/deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc b/deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc index 838fc68a80..869cbc4f2e 100644 --- a/deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc +++ b/deps/v8/src/regexp/mips64/regexp-macro-assembler-mips64.cc @@ -219,7 +219,7 @@ void RegExpMacroAssemblerMIPS::CheckCharacterGT(uc16 limit, Label* on_greater) { void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) { Label not_at_start; // Did we start the match at the start of the string at all? - __ lw(a0, MemOperand(frame_pointer(), kStartIndex)); + __ ld(a0, MemOperand(frame_pointer(), kStartIndex)); BranchOrBacktrack(¬_at_start, ne, a0, Operand(zero_reg)); // If we did, are we still at the start of the input? @@ -232,7 +232,7 @@ void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) { void RegExpMacroAssemblerMIPS::CheckNotAtStart(Label* on_not_at_start) { // Did we start the match at the start of the string at all? - __ lw(a0, MemOperand(frame_pointer(), kStartIndex)); + __ ld(a0, MemOperand(frame_pointer(), kStartIndex)); BranchOrBacktrack(on_not_at_start, ne, a0, Operand(zero_reg)); // If we did, are we still at the start of the input? __ ld(a1, MemOperand(frame_pointer(), kInputStart)); @@ -779,7 +779,7 @@ Handle<HeapObject> RegExpMacroAssemblerMIPS::GetCode(Handle<String> source) { if (global()) { // Restart matching if the regular expression is flagged as global. __ ld(a0, MemOperand(frame_pointer(), kSuccessfulCaptures)); - __ lw(a1, MemOperand(frame_pointer(), kNumOutputRegisters)); + __ ld(a1, MemOperand(frame_pointer(), kNumOutputRegisters)); __ ld(a2, MemOperand(frame_pointer(), kRegisterOutput)); // Increment success counter. __ Daddu(a0, a0, 1); @@ -1155,8 +1155,8 @@ int64_t RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address, Address re_frame) { return NativeRegExpMacroAssembler::CheckStackGuardState( frame_entry<Isolate*>(re_frame, kIsolate), - frame_entry<int>(re_frame, kStartIndex), - frame_entry<int>(re_frame, kDirectCall) == 1, return_address, re_code, + static_cast<int>(frame_entry<int64_t>(re_frame, kStartIndex)), + frame_entry<int64_t>(re_frame, kDirectCall) == 1, return_address, re_code, frame_entry_address<String*>(re_frame, kInputString), frame_entry_address<const byte*>(re_frame, kInputStart), frame_entry_address<const byte*>(re_frame, kInputEnd)); diff --git a/deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc b/deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc index e820aa9bbf..03f9741147 100644 --- a/deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc +++ b/deps/v8/src/regexp/ppc/regexp-macro-assembler-ppc.cc @@ -8,9 +8,9 @@ #include "src/base/bits.h" #include "src/code-stubs.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" diff --git a/deps/v8/src/regexp/regexp-macro-assembler.cc b/deps/v8/src/regexp/regexp-macro-assembler.cc index 20105c0b30..9916d5f32f 100644 --- a/deps/v8/src/regexp/regexp-macro-assembler.cc +++ b/deps/v8/src/regexp/regexp-macro-assembler.cc @@ -6,6 +6,7 @@ #include "src/assembler.h" #include "src/ast.h" +#include "src/isolate-inl.h" #include "src/regexp/regexp-stack.h" #include "src/simulator.h" diff --git a/deps/v8/src/regexp/regexp-stack.cc b/deps/v8/src/regexp/regexp-stack.cc index 348e684151..34f9127f2f 100644 --- a/deps/v8/src/regexp/regexp-stack.cc +++ b/deps/v8/src/regexp/regexp-stack.cc @@ -5,7 +5,6 @@ #include "src/regexp/regexp-stack.h" #include "src/isolate.h" -#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker! namespace v8 { namespace internal { diff --git a/deps/v8/src/regexp/x64/regexp-macro-assembler-x64.cc b/deps/v8/src/regexp/x64/regexp-macro-assembler-x64.cc index c0f5f2c323..969edc1b3b 100644 --- a/deps/v8/src/regexp/x64/regexp-macro-assembler-x64.cc +++ b/deps/v8/src/regexp/x64/regexp-macro-assembler-x64.cc @@ -6,9 +6,9 @@ #include "src/regexp/x64/regexp-macro-assembler-x64.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" diff --git a/deps/v8/src/regexp/x87/regexp-macro-assembler-x87.cc b/deps/v8/src/regexp/x87/regexp-macro-assembler-x87.cc index c30994eae0..c6968dc197 100644 --- a/deps/v8/src/regexp/x87/regexp-macro-assembler-x87.cc +++ b/deps/v8/src/regexp/x87/regexp-macro-assembler-x87.cc @@ -6,9 +6,9 @@ #include "src/regexp/x87/regexp-macro-assembler-x87.h" -#include "src/cpu-profiler.h" #include "src/log.h" #include "src/macro-assembler.h" +#include "src/profiler/cpu-profiler.h" #include "src/regexp/regexp-macro-assembler.h" #include "src/regexp/regexp-stack.h" #include "src/unicode.h" |