| 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 13601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13612 JSObject::SetLocalPropertyIgnoreAttributes( | 13612 JSObject::SetLocalPropertyIgnoreAttributes( |
| 13613 local_object, | 13613 local_object, |
| 13614 isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")), | 13614 isolate->factory()->NewStringFromAscii(CStrVector("dateFormat")), |
| 13615 isolate->factory()->NewStringFromAscii(CStrVector("valid")), | 13615 isolate->factory()->NewStringFromAscii(CStrVector("valid")), |
| 13616 NONE)); | 13616 NONE)); |
| 13617 | 13617 |
| 13618 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), | 13618 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), |
| 13619 v8::Utils::ToLocal(local_object)); | 13619 v8::Utils::ToLocal(local_object)); |
| 13620 // Make object handle weak so we can delete the data format once GC kicks in. | 13620 // Make object handle weak so we can delete the data format once GC kicks in. |
| 13621 wrapper.MakeWeak<void>(NULL, &DateFormat::DeleteDateFormat); | 13621 wrapper.MakeWeak<void>(NULL, &DateFormat::DeleteDateFormat); |
| 13622 Handle<Object> result = Utils::OpenPersistent(wrapper); | |
| 13623 wrapper.ClearAndLeak(); | 13622 wrapper.ClearAndLeak(); |
| 13624 return *result; | 13623 return *local_object; |
| 13625 } | 13624 } |
| 13626 | 13625 |
| 13627 | 13626 |
| 13628 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalDateFormat) { | 13627 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalDateFormat) { |
| 13629 HandleScope scope(isolate); | 13628 HandleScope scope(isolate); |
| 13630 | 13629 |
| 13631 ASSERT(args.length() == 2); | 13630 ASSERT(args.length() == 2); |
| 13632 | 13631 |
| 13633 CONVERT_ARG_HANDLE_CHECKED(JSObject, date_format_holder, 0); | 13632 CONVERT_ARG_HANDLE_CHECKED(JSObject, date_format_holder, 0); |
| 13634 CONVERT_ARG_HANDLE_CHECKED(JSDate, date, 1); | 13633 CONVERT_ARG_HANDLE_CHECKED(JSDate, date, 1); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13717 local_object, | 13716 local_object, |
| 13718 isolate->factory()->NewStringFromAscii(CStrVector("numberFormat")), | 13717 isolate->factory()->NewStringFromAscii(CStrVector("numberFormat")), |
| 13719 isolate->factory()->NewStringFromAscii(CStrVector("valid")), | 13718 isolate->factory()->NewStringFromAscii(CStrVector("valid")), |
| 13720 NONE)); | 13719 NONE)); |
| 13721 | 13720 |
| 13722 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), | 13721 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), |
| 13723 v8::Utils::ToLocal(local_object)); | 13722 v8::Utils::ToLocal(local_object)); |
| 13724 // Make object handle weak so we can delete the number format once GC kicks | 13723 // Make object handle weak so we can delete the number format once GC kicks |
| 13725 // in. | 13724 // in. |
| 13726 wrapper.MakeWeak<void>(NULL, &NumberFormat::DeleteNumberFormat); | 13725 wrapper.MakeWeak<void>(NULL, &NumberFormat::DeleteNumberFormat); |
| 13727 Handle<Object> result = Utils::OpenPersistent(wrapper); | |
| 13728 wrapper.ClearAndLeak(); | 13726 wrapper.ClearAndLeak(); |
| 13729 return *result; | 13727 return *local_object; |
| 13730 } | 13728 } |
| 13731 | 13729 |
| 13732 | 13730 |
| 13733 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalNumberFormat) { | 13731 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalNumberFormat) { |
| 13734 HandleScope scope(isolate); | 13732 HandleScope scope(isolate); |
| 13735 | 13733 |
| 13736 ASSERT(args.length() == 2); | 13734 ASSERT(args.length() == 2); |
| 13737 | 13735 |
| 13738 CONVERT_ARG_HANDLE_CHECKED(JSObject, number_format_holder, 0); | 13736 CONVERT_ARG_HANDLE_CHECKED(JSObject, number_format_holder, 0); |
| 13739 CONVERT_ARG_HANDLE_CHECKED(Object, number, 1); | 13737 CONVERT_ARG_HANDLE_CHECKED(Object, number, 1); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13830 JSObject::SetLocalPropertyIgnoreAttributes( | 13828 JSObject::SetLocalPropertyIgnoreAttributes( |
| 13831 local_object, | 13829 local_object, |
| 13832 isolate->factory()->NewStringFromAscii(CStrVector("collator")), | 13830 isolate->factory()->NewStringFromAscii(CStrVector("collator")), |
| 13833 isolate->factory()->NewStringFromAscii(CStrVector("valid")), | 13831 isolate->factory()->NewStringFromAscii(CStrVector("valid")), |
| 13834 NONE)); | 13832 NONE)); |
| 13835 | 13833 |
| 13836 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), | 13834 Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate), |
| 13837 v8::Utils::ToLocal(local_object)); | 13835 v8::Utils::ToLocal(local_object)); |
| 13838 // Make object handle weak so we can delete the collator once GC kicks in. | 13836 // Make object handle weak so we can delete the collator once GC kicks in. |
| 13839 wrapper.MakeWeak<void>(NULL, &Collator::DeleteCollator); | 13837 wrapper.MakeWeak<void>(NULL, &Collator::DeleteCollator); |
| 13840 Handle<Object> result = Utils::OpenPersistent(wrapper); | |
| 13841 wrapper.ClearAndLeak(); | 13838 wrapper.ClearAndLeak(); |
| 13842 return *result; | 13839 return *local_object; |
| 13843 } | 13840 } |
| 13844 | 13841 |
| 13845 | 13842 |
| 13846 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalCompare) { | 13843 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalCompare) { |
| 13847 HandleScope scope(isolate); | 13844 HandleScope scope(isolate); |
| 13848 | 13845 |
| 13849 ASSERT(args.length() == 3); | 13846 ASSERT(args.length() == 3); |
| 13850 | 13847 |
| 13851 CONVERT_ARG_HANDLE_CHECKED(JSObject, collator_holder, 0); | 13848 CONVERT_ARG_HANDLE_CHECKED(JSObject, collator_holder, 0); |
| 13852 CONVERT_ARG_HANDLE_CHECKED(String, string1, 1); | 13849 CONVERT_ARG_HANDLE_CHECKED(String, string1, 1); |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14478 // Handle last resort GC and make sure to allow future allocations | 14475 // Handle last resort GC and make sure to allow future allocations |
| 14479 // to grow the heap without causing GCs (if possible). | 14476 // to grow the heap without causing GCs (if possible). |
| 14480 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14477 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14481 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14478 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14482 "Runtime::PerformGC"); | 14479 "Runtime::PerformGC"); |
| 14483 } | 14480 } |
| 14484 } | 14481 } |
| 14485 | 14482 |
| 14486 | 14483 |
| 14487 } } // namespace v8::internal | 14484 } } // namespace v8::internal |
| OLD | NEW |