OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 13736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13747 NONE)); | 13747 NONE)); |
13748 output->set(i, *result); | 13748 output->set(i, *result); |
13749 } | 13749 } |
13750 | 13750 |
13751 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(output); | 13751 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(output); |
13752 result->set_length(Smi::FromInt(length)); | 13752 result->set_length(Smi::FromInt(length)); |
13753 return *result; | 13753 return *result; |
13754 } | 13754 } |
13755 | 13755 |
13756 | 13756 |
13757 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInitializedIntlObject) { | |
13758 HandleScope scope(isolate); | |
13759 | |
13760 ASSERT(args.length() == 1); | |
13761 | |
13762 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
13763 | |
13764 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
13765 Handle<Object> tag(input->GetHiddenProperty(*marker), isolate); | |
13766 return isolate->heap()->ToBoolean(!tag->IsTheHole()); | |
13767 } | |
13768 | |
13769 | |
13770 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInitializedIntlObjectOfType) { | |
13771 HandleScope scope(isolate); | |
13772 | |
13773 ASSERT(args.length() == 2); | |
13774 | |
13775 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
13776 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1); | |
13777 | |
13778 | |
13779 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
13780 Handle<Object> tag(input->GetHiddenProperty(*marker), isolate); | |
13781 return isolate->heap()->ToBoolean( | |
13782 tag->IsString() && String::cast(*tag)->Equals(*expected_type)); | |
13783 } | |
13784 | |
13785 | |
13786 RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkAsInitializedIntlObjectOfType) { | |
13787 HandleScope scope(isolate); | |
13788 | |
13789 ASSERT(args.length() == 3); | |
13790 | |
13791 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
13792 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); | |
13793 CONVERT_ARG_HANDLE_CHECKED(JSObject, impl, 2); | |
13794 | |
13795 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
13796 JSObject::SetHiddenProperty(input, marker, type); | |
13797 | |
13798 marker = isolate->factory()->intl_impl_object_string(); | |
13799 JSObject::SetHiddenProperty(input, marker, impl); | |
13800 | |
13801 return isolate->heap()->undefined_value(); | |
13802 } | |
13803 | |
13804 | |
13805 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetImplFromInitializedIntlObject) { | |
13806 HandleScope scope(isolate); | |
13807 | |
13808 ASSERT(args.length() == 1); | |
13809 | |
13810 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
13811 | |
13812 Handle<String> marker = isolate->factory()->intl_impl_object_string(); | |
13813 Handle<Object> impl(input->GetHiddenProperty(*marker), isolate); | |
13814 if (impl->IsTheHole()) return isolate->heap()->undefined_value(); | |
13815 return *impl; | |
13816 } | |
13817 | |
13818 | |
13819 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateDateTimeFormat) { | 13757 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateDateTimeFormat) { |
13820 HandleScope scope(isolate); | 13758 HandleScope scope(isolate); |
13821 | 13759 |
13822 ASSERT(args.length() == 3); | 13760 ASSERT(args.length() == 3); |
13823 | 13761 |
13824 CONVERT_ARG_HANDLE_CHECKED(String, locale, 0); | 13762 CONVERT_ARG_HANDLE_CHECKED(String, locale, 0); |
13825 CONVERT_ARG_HANDLE_CHECKED(JSObject, options, 1); | 13763 CONVERT_ARG_HANDLE_CHECKED(JSObject, options, 1); |
13826 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolved, 2); | 13764 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolved, 2); |
13827 | 13765 |
13828 Handle<ObjectTemplateInfo> date_format_template = | 13766 Handle<ObjectTemplateInfo> date_format_template = |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14985 // Handle last resort GC and make sure to allow future allocations | 14923 // Handle last resort GC and make sure to allow future allocations |
14986 // to grow the heap without causing GCs (if possible). | 14924 // to grow the heap without causing GCs (if possible). |
14987 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14925 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14988 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14926 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14989 "Runtime::PerformGC"); | 14927 "Runtime::PerformGC"); |
14990 } | 14928 } |
14991 } | 14929 } |
14992 | 14930 |
14993 | 14931 |
14994 } } // namespace v8::internal | 14932 } } // namespace v8::internal |
OLD | NEW |