OLD | NEW |
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 Address end_of_string = answer->address() + string_size; | 635 Address end_of_string = answer->address() + string_size; |
636 Heap* heap = isolate->heap(); | 636 Heap* heap = isolate->heap(); |
637 | 637 |
638 // The trimming is performed on a newly allocated object, which is on a | 638 // The trimming is performed on a newly allocated object, which is on a |
639 // fresly allocated page or on an already swept page. Hence, the sweeper | 639 // fresly allocated page or on an already swept page. Hence, the sweeper |
640 // thread can not get confused with the filler creation. No synchronization | 640 // thread can not get confused with the filler creation. No synchronization |
641 // needed. | 641 // needed. |
642 // TODO(hpayer): We should shrink the large object page if the size | 642 // TODO(hpayer): We should shrink the large object page if the size |
643 // of the object changed significantly. | 643 // of the object changed significantly. |
644 if (!heap->lo_space()->Contains(*answer)) { | 644 if (!heap->lo_space()->Contains(*answer)) { |
645 heap->CreateFillerObjectAt(end_of_string, delta); | 645 heap->CreateFillerObjectAt(end_of_string, delta, ClearRecordedSlots::kNo); |
646 } | 646 } |
647 heap->AdjustLiveBytes(*answer, -delta, Heap::CONCURRENT_TO_SWEEPER); | 647 heap->AdjustLiveBytes(*answer, -delta, Heap::CONCURRENT_TO_SWEEPER); |
648 return *answer; | 648 return *answer; |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { | 652 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { |
653 HandleScope scope(isolate); | 653 HandleScope scope(isolate); |
654 DCHECK(args.length() == 4); | 654 DCHECK(args.length() == 4); |
655 | 655 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 | 1022 |
1023 | 1023 |
1024 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1024 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
1025 SealHandleScope shs(isolate); | 1025 SealHandleScope shs(isolate); |
1026 DCHECK(args.length() == 1); | 1026 DCHECK(args.length() == 1); |
1027 CONVERT_ARG_CHECKED(Object, obj, 0); | 1027 CONVERT_ARG_CHECKED(Object, obj, 0); |
1028 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1028 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1029 } | 1029 } |
1030 } // namespace internal | 1030 } // namespace internal |
1031 } // namespace v8 | 1031 } // namespace v8 |
OLD | NEW |