Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: src/regexp/jsregexp.cc

Issue 2452543003: Don't wrap roots in Handle just to dereference immediately. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698