| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } else { | 374 } else { |
| 375 FindStringIndices(isolate, subject_vector, pattern_vector, indices, | 375 FindStringIndices(isolate, subject_vector, pattern_vector, indices, |
| 376 limit); | 376 limit); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 namespace { | 383 namespace { |
| 384 static List<int>* GetRewindedRegexpIndicesList(Isolate* isolate) { | 384 List<int>* GetRewindedRegexpIndicesList(Isolate* isolate) { |
| 385 List<int>* list = isolate->regexp_indices(); | 385 List<int>* list = isolate->regexp_indices(); |
| 386 list->Rewind(0); | 386 list->Rewind(0); |
| 387 return list; | 387 return list; |
| 388 } | 388 } |
| 389 | 389 |
| 390 static void TruncateRegexpIndicesList(Isolate* isolate) { | 390 void TruncateRegexpIndicesList(Isolate* isolate) { |
| 391 // Same size as smallest zone segment, preserving behavior from the runtime | 391 // Same size as smallest zone segment, preserving behavior from the |
| 392 // zone. | 392 // runtime zone. |
| 393 static const size_t kMaxRegexpIndicesListCapacity = 8 * KB; | 393 static const size_t kMaxRegexpIndicesListCapacity = 8 * KB; |
| 394 if (isolate->regexp_indices()->capacity() > kMaxRegexpIndicesListCapacity) { | 394 if (isolate->regexp_indices()->capacity() > kMaxRegexpIndicesListCapacity) { |
| 395 isolate->regexp_indices()->Clear(); // Throw away backing storage | 395 isolate->regexp_indices()->Clear(); // Throw away backing storage |
| 396 } | 396 } |
| 397 } | 397 } |
| 398 } // namespace | 398 } // namespace |
| 399 | 399 |
| 400 template <typename ResultSeqString> | 400 template <typename ResultSeqString> |
| 401 MUST_USE_RESULT static Object* StringReplaceGlobalAtomRegExpWithString( | 401 MUST_USE_RESULT static Object* StringReplaceGlobalAtomRegExpWithString( |
| 402 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> pattern_regexp, | 402 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> pattern_regexp, |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 | 1020 |
| 1021 | 1021 |
| 1022 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1022 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
| 1023 SealHandleScope shs(isolate); | 1023 SealHandleScope shs(isolate); |
| 1024 DCHECK(args.length() == 1); | 1024 DCHECK(args.length() == 1); |
| 1025 CONVERT_ARG_CHECKED(Object, obj, 0); | 1025 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 1026 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1026 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
| 1027 } | 1027 } |
| 1028 } // namespace internal | 1028 } // namespace internal |
| 1029 } // namespace v8 | 1029 } // namespace v8 |
| OLD | NEW |