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

Side by Side Diff: src/runtime/runtime-regexp.cc

Issue 1163793002: Fix bogus insertion of filler in LO-space by String#replace. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months 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 | « no previous file | test/mjsunit/regress/regress-crbug-493779.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/jsregexp-inl.h" 8 #include "src/jsregexp-inl.h"
9 #include "src/jsregexp.h" 9 #include "src/jsregexp.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 answer->set_length(position); 631 answer->set_length(position);
632 if (delta == 0) return *answer; 632 if (delta == 0) return *answer;
633 633
634 Address end_of_string = answer->address() + string_size; 634 Address end_of_string = answer->address() + string_size;
635 Heap* heap = isolate->heap(); 635 Heap* heap = isolate->heap();
636 636
637 // The trimming is performed on a newly allocated object, which is on a 637 // The trimming is performed on a newly allocated object, which is on a
638 // fresly allocated page or on an already swept page. Hence, the sweeper 638 // fresly allocated page or on an already swept page. Hence, the sweeper
639 // thread can not get confused with the filler creation. No synchronization 639 // thread can not get confused with the filler creation. No synchronization
640 // needed. 640 // needed.
641 heap->CreateFillerObjectAt(end_of_string, delta); 641 // TODO(hpayer): We should shrink the large object page if the size
642 // of the object changed significantly.
643 if (!heap->lo_space()->Contains(*answer)) {
644 heap->CreateFillerObjectAt(end_of_string, delta);
645 }
642 heap->AdjustLiveBytes(answer->address(), -delta, Heap::CONCURRENT_TO_SWEEPER); 646 heap->AdjustLiveBytes(answer->address(), -delta, Heap::CONCURRENT_TO_SWEEPER);
643 return *answer; 647 return *answer;
644 } 648 }
645 649
646 650
647 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { 651 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) {
648 HandleScope scope(isolate); 652 HandleScope scope(isolate);
649 DCHECK(args.length() == 4); 653 DCHECK(args.length() == 4);
650 654
651 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); 655 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0);
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1184
1181 1185
1182 RUNTIME_FUNCTION(Runtime_IsRegExp) { 1186 RUNTIME_FUNCTION(Runtime_IsRegExp) {
1183 SealHandleScope shs(isolate); 1187 SealHandleScope shs(isolate);
1184 DCHECK(args.length() == 1); 1188 DCHECK(args.length() == 1);
1185 CONVERT_ARG_CHECKED(Object, obj, 0); 1189 CONVERT_ARG_CHECKED(Object, obj, 0);
1186 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); 1190 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
1187 } 1191 }
1188 } // namespace internal 1192 } // namespace internal
1189 } // namespace v8 1193 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-493779.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698