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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 namespace { | 384 namespace { |
385 List<int>* GetRewoundRegexpIndicesList(Isolate* isolate) { | 385 List<int>* GetRewoundRegexpIndicesList(Isolate* isolate) { |
386 List<int>* list = isolate->regexp_indices(); | 386 List<int>* list = isolate->regexp_indices(); |
387 list->Rewind(0); | 387 list->Rewind(0); |
388 return list; | 388 return list; |
389 } | 389 } |
390 | 390 |
391 void TruncateRegexpIndicesList(Isolate* isolate) { | 391 void TruncateRegexpIndicesList(Isolate* isolate) { |
392 // Same size as smallest zone segment, preserving behavior from the | 392 // Same size as smallest zone segment, preserving behavior from the |
393 // runtime zone. | 393 // runtime zone. |
394 static const size_t kMaxRegexpIndicesListCapacity = 8 * KB; | 394 static const int kMaxRegexpIndicesListCapacity = 8 * KB; |
395 if (isolate->regexp_indices()->capacity() > kMaxRegexpIndicesListCapacity) { | 395 if (isolate->regexp_indices()->capacity() > kMaxRegexpIndicesListCapacity) { |
396 isolate->regexp_indices()->Clear(); // Throw away backing storage | 396 isolate->regexp_indices()->Clear(); // Throw away backing storage |
397 } | 397 } |
398 } | 398 } |
399 } // namespace | 399 } // namespace |
400 | 400 |
401 template <typename ResultSeqString> | 401 template <typename ResultSeqString> |
402 MUST_USE_RESULT static Object* StringReplaceGlobalAtomRegExpWithString( | 402 MUST_USE_RESULT static Object* StringReplaceGlobalAtomRegExpWithString( |
403 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> pattern_regexp, | 403 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> pattern_regexp, |
404 Handle<String> replacement, Handle<RegExpMatchInfo> last_match_info) { | 404 Handle<String> replacement, Handle<RegExpMatchInfo> last_match_info) { |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |