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/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/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 if (delta == 0) return *answer; | 631 if (delta == 0) return *answer; |
632 | 632 |
633 Address end_of_string = answer->address() + string_size; | 633 Address end_of_string = answer->address() + string_size; |
634 Heap* heap = isolate->heap(); | 634 Heap* heap = isolate->heap(); |
635 | 635 |
636 // The trimming is performed on a newly allocated object, which is on a | 636 // The trimming is performed on a newly allocated object, which is on a |
637 // fresly allocated page or on an already swept page. Hence, the sweeper | 637 // fresly allocated page or on an already swept page. Hence, the sweeper |
638 // thread can not get confused with the filler creation. No synchronization | 638 // thread can not get confused with the filler creation. No synchronization |
639 // needed. | 639 // needed. |
640 heap->CreateFillerObjectAt(end_of_string, delta); | 640 heap->CreateFillerObjectAt(end_of_string, delta); |
641 heap->AdjustLiveBytes(answer->address(), -delta, Heap::FROM_MUTATOR); | 641 heap->AdjustLiveBytes(answer->address(), -delta, Heap::CONCURRENT_TO_SWEEPER); |
642 return *answer; | 642 return *answer; |
643 } | 643 } |
644 | 644 |
645 | 645 |
646 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { | 646 RUNTIME_FUNCTION(Runtime_StringReplaceGlobalRegExpWithString) { |
647 HandleScope scope(isolate); | 647 HandleScope scope(isolate); |
648 DCHECK(args.length() == 4); | 648 DCHECK(args.length() == 4); |
649 | 649 |
650 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); | 650 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
651 CONVERT_ARG_HANDLE_CHECKED(String, replacement, 2); | 651 CONVERT_ARG_HANDLE_CHECKED(String, replacement, 2); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 | 1181 |
1182 | 1182 |
1183 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1183 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
1184 SealHandleScope shs(isolate); | 1184 SealHandleScope shs(isolate); |
1185 DCHECK(args.length() == 1); | 1185 DCHECK(args.length() == 1); |
1186 CONVERT_ARG_CHECKED(Object, obj, 0); | 1186 CONVERT_ARG_CHECKED(Object, obj, 0); |
1187 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1187 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1188 } | 1188 } |
1189 } | 1189 } |
1190 } // namespace v8::internal | 1190 } // namespace v8::internal |
OLD | NEW |