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

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

Issue 2504193002: [heap] Simplify adjusting of live bytes. (Closed)
Patch Set: fix test 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/runtime/runtime-array.cc ('k') | src/x87/deoptimizer-x87.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 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions-inl.h" 8 #include "src/conversions-inl.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 645
646 // The trimming is performed on a newly allocated object, which is on a 646 // The trimming is performed on a newly allocated object, which is on a
647 // fresly allocated page or on an already swept page. Hence, the sweeper 647 // fresly allocated page or on an already swept page. Hence, the sweeper
648 // thread can not get confused with the filler creation. No synchronization 648 // thread can not get confused with the filler creation. No synchronization
649 // needed. 649 // needed.
650 // TODO(hpayer): We should shrink the large object page if the size 650 // TODO(hpayer): We should shrink the large object page if the size
651 // of the object changed significantly. 651 // of the object changed significantly.
652 if (!heap->lo_space()->Contains(*answer)) { 652 if (!heap->lo_space()->Contains(*answer)) {
653 heap->CreateFillerObjectAt(end_of_string, delta, ClearRecordedSlots::kNo); 653 heap->CreateFillerObjectAt(end_of_string, delta, ClearRecordedSlots::kNo);
654 } 654 }
655 heap->AdjustLiveBytes(*answer, -delta, Heap::CONCURRENT_TO_SWEEPER); 655 heap->AdjustLiveBytes(*answer, -delta);
656 return *answer; 656 return *answer;
657 } 657 }
658 658
659 namespace { 659 namespace {
660 660
661 Object* StringReplaceGlobalRegExpWithStringHelper( 661 Object* StringReplaceGlobalRegExpWithStringHelper(
662 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject, 662 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject,
663 Handle<String> replacement, Handle<RegExpMatchInfo> last_match_info) { 663 Handle<String> replacement, Handle<RegExpMatchInfo> last_match_info) {
664 CHECK(regexp->GetFlags() & JSRegExp::kGlobal); 664 CHECK(regexp->GetFlags() & JSRegExp::kGlobal);
665 665
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 1451
1452 RUNTIME_FUNCTION(Runtime_IsRegExp) { 1452 RUNTIME_FUNCTION(Runtime_IsRegExp) {
1453 SealHandleScope shs(isolate); 1453 SealHandleScope shs(isolate);
1454 DCHECK(args.length() == 1); 1454 DCHECK(args.length() == 1);
1455 CONVERT_ARG_CHECKED(Object, obj, 0); 1455 CONVERT_ARG_CHECKED(Object, obj, 0);
1456 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); 1456 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
1457 } 1457 }
1458 1458
1459 } // namespace internal 1459 } // namespace internal
1460 } // namespace v8 1460 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/x87/deoptimizer-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698