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

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

Issue 1256203004: AdjustLiveBytes and friends takes a heap object pointer instead of an address. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « src/objects.cc ('k') | no next file » | 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // TODO(hpayer): We should shrink the large object page if the size 641 // TODO(hpayer): We should shrink the large object page if the size
642 // of the object changed significantly. 642 // of the object changed significantly.
643 if (!heap->lo_space()->Contains(*answer)) { 643 if (!heap->lo_space()->Contains(*answer)) {
644 heap->CreateFillerObjectAt(end_of_string, delta); 644 heap->CreateFillerObjectAt(end_of_string, delta);
645 } 645 }
646 heap->AdjustLiveBytes(answer->address(), -delta, Heap::CONCURRENT_TO_SWEEPER); 646 heap->AdjustLiveBytes(*answer, -delta, Heap::CONCURRENT_TO_SWEEPER);
647 return *answer; 647 return *answer;
648 } 648 }
649 649
650 650
651 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { 651 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) {
652 HandleScope scope(isolate); 652 HandleScope scope(isolate);
653 DCHECK(args.length() == 4); 653 DCHECK(args.length() == 4);
654 654
655 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); 655 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0);
656 CONVERT_ARG_HANDLE_CHECKED(String, replacement, 2); 656 CONVERT_ARG_HANDLE_CHECKED(String, replacement, 2);
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 1184
1185 1185
1186 RUNTIME_FUNCTION(Runtime_IsRegExp) { 1186 RUNTIME_FUNCTION(Runtime_IsRegExp) {
1187 SealHandleScope shs(isolate); 1187 SealHandleScope shs(isolate);
1188 DCHECK(args.length() == 1); 1188 DCHECK(args.length() == 1);
1189 CONVERT_ARG_CHECKED(Object, obj, 0); 1189 CONVERT_ARG_CHECKED(Object, obj, 0);
1190 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); 1190 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
1191 } 1191 }
1192 } // namespace internal 1192 } // namespace internal
1193 } // namespace v8 1193 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698