| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/regexp/jsregexp.h" | 5 #include "src/regexp/jsregexp.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 6848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6859 // If the array is a reasonably short list of substrings, convert it into a | 6859 // If the array is a reasonably short list of substrings, convert it into a |
| 6860 // list of internalized strings. | 6860 // list of internalized strings. |
| 6861 if (type == STRING_SPLIT_SUBSTRINGS && value_array->length() < 100) { | 6861 if (type == STRING_SPLIT_SUBSTRINGS && value_array->length() < 100) { |
| 6862 for (int i = 0; i < value_array->length(); i++) { | 6862 for (int i = 0; i < value_array->length(); i++) { |
| 6863 Handle<String> str(String::cast(value_array->get(i)), isolate); | 6863 Handle<String> str(String::cast(value_array->get(i)), isolate); |
| 6864 Handle<String> internalized_str = factory->InternalizeString(str); | 6864 Handle<String> internalized_str = factory->InternalizeString(str); |
| 6865 value_array->set(i, *internalized_str); | 6865 value_array->set(i, *internalized_str); |
| 6866 } | 6866 } |
| 6867 } | 6867 } |
| 6868 // Convert backing store to a copy-on-write array. | 6868 // Convert backing store to a copy-on-write array. |
| 6869 value_array->set_map_no_write_barrier(*factory->fixed_cow_array_map()); | 6869 value_array->set_map_no_write_barrier(isolate->heap()->fixed_cow_array_map()); |
| 6870 } | 6870 } |
| 6871 | 6871 |
| 6872 | 6872 |
| 6873 void RegExpResultsCache::Clear(FixedArray* cache) { | 6873 void RegExpResultsCache::Clear(FixedArray* cache) { |
| 6874 for (int i = 0; i < kRegExpResultsCacheSize; i++) { | 6874 for (int i = 0; i < kRegExpResultsCacheSize; i++) { |
| 6875 cache->set(i, Smi::kZero); | 6875 cache->set(i, Smi::kZero); |
| 6876 } | 6876 } |
| 6877 } | 6877 } |
| 6878 | 6878 |
| 6879 } // namespace internal | 6879 } // namespace internal |
| 6880 } // namespace v8 | 6880 } // namespace v8 |
| OLD | NEW |