| 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/messages.h" | 10 #include "src/messages.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 RUNTIME_FUNCTION(Runtime_RegExpConstructResultRT) { | 787 RUNTIME_FUNCTION(Runtime_RegExpConstructResultRT) { |
| 788 HandleScope handle_scope(isolate); | 788 HandleScope handle_scope(isolate); |
| 789 DCHECK(args.length() == 3); | 789 DCHECK(args.length() == 3); |
| 790 CONVERT_SMI_ARG_CHECKED(size, 0); | 790 CONVERT_SMI_ARG_CHECKED(size, 0); |
| 791 RUNTIME_ASSERT(size >= 0 && size <= FixedArray::kMaxLength); | 791 RUNTIME_ASSERT(size >= 0 && size <= FixedArray::kMaxLength); |
| 792 CONVERT_ARG_HANDLE_CHECKED(Object, index, 1); | 792 CONVERT_ARG_HANDLE_CHECKED(Object, index, 1); |
| 793 CONVERT_ARG_HANDLE_CHECKED(Object, input, 2); | 793 CONVERT_ARG_HANDLE_CHECKED(Object, input, 2); |
| 794 Handle<FixedArray> elements = isolate->factory()->NewFixedArray(size); | 794 Handle<FixedArray> elements = isolate->factory()->NewFixedArray(size); |
| 795 Handle<Map> regexp_map(isolate->native_context()->regexp_result_map()); | 795 Handle<Map> regexp_map(isolate->native_context()->regexp_result_map()); |
| 796 Handle<JSObject> object = | 796 Handle<JSObject> object = |
| 797 isolate->factory()->NewJSObjectFromMap(regexp_map, NOT_TENURED, false); | 797 isolate->factory()->NewJSObjectFromMap(regexp_map, NOT_TENURED); |
| 798 Handle<JSArray> array = Handle<JSArray>::cast(object); | 798 Handle<JSArray> array = Handle<JSArray>::cast(object); |
| 799 array->set_elements(*elements); | 799 array->set_elements(*elements); |
| 800 array->set_length(Smi::FromInt(size)); | 800 array->set_length(Smi::FromInt(size)); |
| 801 // Write in-object properties after the length of the array. | 801 // Write in-object properties after the length of the array. |
| 802 array->InObjectPropertyAtPut(JSRegExpResult::kIndexIndex, *index); | 802 array->InObjectPropertyAtPut(JSRegExpResult::kIndexIndex, *index); |
| 803 array->InObjectPropertyAtPut(JSRegExpResult::kInputIndex, *input); | 803 array->InObjectPropertyAtPut(JSRegExpResult::kInputIndex, *input); |
| 804 return *array; | 804 return *array; |
| 805 } | 805 } |
| 806 | 806 |
| 807 | 807 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |