| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2279 ENTER_V8; | 2279 ENTER_V8; |
| 2280 HandleScope scope; | 2280 HandleScope scope; |
| 2281 i::Handle<i::Object> self = Utils::OpenHandle(this); | 2281 i::Handle<i::Object> self = Utils::OpenHandle(this); |
| 2282 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 2282 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
| 2283 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 2283 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 2284 EXCEPTION_PREAMBLE(); | 2284 EXCEPTION_PREAMBLE(); |
| 2285 i::Handle<i::Object> obj = i::SetProperty( | 2285 i::Handle<i::Object> obj = i::SetProperty( |
| 2286 self, | 2286 self, |
| 2287 key_obj, | 2287 key_obj, |
| 2288 value_obj, | 2288 value_obj, |
| 2289 static_cast<PropertyAttributes>(attribs)); | 2289 static_cast<PropertyAttributes>(attribs), |
| 2290 i::kNonStrictMode); |
| 2290 has_pending_exception = obj.is_null(); | 2291 has_pending_exception = obj.is_null(); |
| 2291 EXCEPTION_BAILOUT_CHECK(false); | 2292 EXCEPTION_BAILOUT_CHECK(false); |
| 2292 return true; | 2293 return true; |
| 2293 } | 2294 } |
| 2294 | 2295 |
| 2295 | 2296 |
| 2296 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) { | 2297 bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) { |
| 2297 ON_BAILOUT("v8::Object::Set()", return false); | 2298 ON_BAILOUT("v8::Object::Set()", return false); |
| 2298 ENTER_V8; | 2299 ENTER_V8; |
| 2299 HandleScope scope; | 2300 HandleScope scope; |
| 2300 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2301 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2301 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 2302 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 2302 EXCEPTION_PREAMBLE(); | 2303 EXCEPTION_PREAMBLE(); |
| 2303 i::Handle<i::Object> obj = i::SetElement( | 2304 i::Handle<i::Object> obj = i::SetElement( |
| 2304 self, | 2305 self, |
| 2305 index, | 2306 index, |
| 2306 value_obj); | 2307 value_obj, |
| 2308 i::kNonStrictMode); |
| 2307 has_pending_exception = obj.is_null(); | 2309 has_pending_exception = obj.is_null(); |
| 2308 EXCEPTION_BAILOUT_CHECK(false); | 2310 EXCEPTION_BAILOUT_CHECK(false); |
| 2309 return true; | 2311 return true; |
| 2310 } | 2312 } |
| 2311 | 2313 |
| 2312 | 2314 |
| 2313 bool v8::Object::ForceSet(v8::Handle<Value> key, | 2315 bool v8::Object::ForceSet(v8::Handle<Value> key, |
| 2314 v8::Handle<Value> value, | 2316 v8::Handle<Value> value, |
| 2315 v8::PropertyAttribute attribs) { | 2317 v8::PropertyAttribute attribs) { |
| 2316 ON_BAILOUT("v8::Object::ForceSet()", return false); | 2318 ON_BAILOUT("v8::Object::ForceSet()", return false); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2704 HandleScope scope; | 2706 HandleScope scope; |
| 2705 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2707 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2706 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, true)); | 2708 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, true)); |
| 2707 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); | 2709 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
| 2708 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 2710 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 2709 EXCEPTION_PREAMBLE(); | 2711 EXCEPTION_PREAMBLE(); |
| 2710 i::Handle<i::Object> obj = i::SetProperty( | 2712 i::Handle<i::Object> obj = i::SetProperty( |
| 2711 hidden_props, | 2713 hidden_props, |
| 2712 key_obj, | 2714 key_obj, |
| 2713 value_obj, | 2715 value_obj, |
| 2714 static_cast<PropertyAttributes>(None)); | 2716 static_cast<PropertyAttributes>(None), |
| 2717 i::kNonStrictMode); |
| 2715 has_pending_exception = obj.is_null(); | 2718 has_pending_exception = obj.is_null(); |
| 2716 EXCEPTION_BAILOUT_CHECK(false); | 2719 EXCEPTION_BAILOUT_CHECK(false); |
| 2717 return true; | 2720 return true; |
| 2718 } | 2721 } |
| 2719 | 2722 |
| 2720 | 2723 |
| 2721 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { | 2724 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { |
| 2722 ON_BAILOUT("v8::Object::GetHiddenValue()", return Local<v8::Value>()); | 2725 ON_BAILOUT("v8::Object::GetHiddenValue()", return Local<v8::Value>()); |
| 2723 ENTER_V8; | 2726 ENTER_V8; |
| 2724 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2727 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2746 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, false)); | 2749 i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, false)); |
| 2747 if (hidden_props->IsUndefined()) { | 2750 if (hidden_props->IsUndefined()) { |
| 2748 return true; | 2751 return true; |
| 2749 } | 2752 } |
| 2750 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props)); | 2753 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props)); |
| 2751 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 2754 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
| 2752 return i::DeleteProperty(js_obj, key_obj)->IsTrue(); | 2755 return i::DeleteProperty(js_obj, key_obj)->IsTrue(); |
| 2753 } | 2756 } |
| 2754 | 2757 |
| 2755 | 2758 |
| 2759 namespace { |
| 2760 |
| 2761 void PrepareExternalArrayElements(i::Handle<i::JSObject> object, |
| 2762 void* data, |
| 2763 ExternalArrayType array_type, |
| 2764 int length) { |
| 2765 i::Handle<i::ExternalArray> array = |
| 2766 i::Factory::NewExternalArray(length, array_type, data); |
| 2767 |
| 2768 // If the object already has external elements, create a new, unique |
| 2769 // map if the element type is now changing, because assumptions about |
| 2770 // generated code based on the receiver's map will be invalid. |
| 2771 i::Handle<i::HeapObject> elements(object->elements()); |
| 2772 bool force_unique_map = |
| 2773 elements->map()->IsUndefined() || |
| 2774 !elements->map()->has_external_array_elements() || |
| 2775 elements->map() != i::Heap::MapForExternalArrayType(array_type); |
| 2776 if (force_unique_map) { |
| 2777 i::Handle<i::Map> external_array_map = |
| 2778 i::Factory::NewExternalArrayElementsMap( |
| 2779 i::Handle<i::Map>(object->map())); |
| 2780 object->set_map(*external_array_map); |
| 2781 } |
| 2782 object->set_elements(*array); |
| 2783 } |
| 2784 |
| 2785 } // namespace |
| 2786 |
| 2787 |
| 2756 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { | 2788 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { |
| 2757 ON_BAILOUT("v8::SetElementsToPixelData()", return); | 2789 ON_BAILOUT("v8::SetElementsToPixelData()", return); |
| 2758 ENTER_V8; | 2790 ENTER_V8; |
| 2759 HandleScope scope; | 2791 HandleScope scope; |
| 2760 if (!ApiCheck(length <= i::PixelArray::kMaxLength, | 2792 if (!ApiCheck(length <= i::ExternalPixelArray::kMaxLength, |
| 2761 "v8::Object::SetIndexedPropertiesToPixelData()", | 2793 "v8::Object::SetIndexedPropertiesToPixelData()", |
| 2762 "length exceeds max acceptable value")) { | 2794 "length exceeds max acceptable value")) { |
| 2763 return; | 2795 return; |
| 2764 } | 2796 } |
| 2765 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2797 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2766 if (!ApiCheck(!self->IsJSArray(), | 2798 if (!ApiCheck(!self->IsJSArray(), |
| 2767 "v8::Object::SetIndexedPropertiesToPixelData()", | 2799 "v8::Object::SetIndexedPropertiesToPixelData()", |
| 2768 "JSArray is not supported")) { | 2800 "JSArray is not supported")) { |
| 2769 return; | 2801 return; |
| 2770 } | 2802 } |
| 2771 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); | 2803 PrepareExternalArrayElements(self, data, kExternalPixelArray, length); |
| 2772 i::Handle<i::Map> pixel_array_map = | |
| 2773 i::Factory::GetPixelArrayElementsMap(i::Handle<i::Map>(self->map())); | |
| 2774 self->set_map(*pixel_array_map); | |
| 2775 self->set_elements(*pixels); | |
| 2776 } | 2804 } |
| 2777 | 2805 |
| 2778 | 2806 |
| 2779 bool v8::Object::HasIndexedPropertiesInPixelData() { | 2807 bool v8::Object::HasIndexedPropertiesInPixelData() { |
| 2780 ON_BAILOUT("v8::HasIndexedPropertiesInPixelData()", return false); | 2808 ON_BAILOUT("v8::HasIndexedPropertiesInPixelData()", return false); |
| 2781 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2809 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2782 return self->HasPixelElements(); | 2810 return self->HasExternalPixelElements(); |
| 2783 } | 2811 } |
| 2784 | 2812 |
| 2785 | 2813 |
| 2786 uint8_t* v8::Object::GetIndexedPropertiesPixelData() { | 2814 uint8_t* v8::Object::GetIndexedPropertiesPixelData() { |
| 2787 ON_BAILOUT("v8::GetIndexedPropertiesPixelData()", return NULL); | 2815 ON_BAILOUT("v8::GetIndexedPropertiesPixelData()", return NULL); |
| 2788 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2816 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2789 if (self->HasPixelElements()) { | 2817 if (self->HasExternalPixelElements()) { |
| 2790 return i::PixelArray::cast(self->elements())->external_pointer(); | 2818 return i::ExternalPixelArray::cast(self->elements())-> |
| 2819 external_pixel_pointer(); |
| 2791 } else { | 2820 } else { |
| 2792 return NULL; | 2821 return NULL; |
| 2793 } | 2822 } |
| 2794 } | 2823 } |
| 2795 | 2824 |
| 2796 | 2825 |
| 2797 int v8::Object::GetIndexedPropertiesPixelDataLength() { | 2826 int v8::Object::GetIndexedPropertiesPixelDataLength() { |
| 2798 ON_BAILOUT("v8::GetIndexedPropertiesPixelDataLength()", return -1); | 2827 ON_BAILOUT("v8::GetIndexedPropertiesPixelDataLength()", return -1); |
| 2799 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2828 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2800 if (self->HasPixelElements()) { | 2829 if (self->HasExternalPixelElements()) { |
| 2801 return i::PixelArray::cast(self->elements())->length(); | 2830 return i::ExternalPixelArray::cast(self->elements())->length(); |
| 2802 } else { | 2831 } else { |
| 2803 return -1; | 2832 return -1; |
| 2804 } | 2833 } |
| 2805 } | 2834 } |
| 2806 | 2835 |
| 2807 | |
| 2808 void v8::Object::SetIndexedPropertiesToExternalArrayData( | 2836 void v8::Object::SetIndexedPropertiesToExternalArrayData( |
| 2809 void* data, | 2837 void* data, |
| 2810 ExternalArrayType array_type, | 2838 ExternalArrayType array_type, |
| 2811 int length) { | 2839 int length) { |
| 2812 ON_BAILOUT("v8::SetIndexedPropertiesToExternalArrayData()", return); | 2840 ON_BAILOUT("v8::SetIndexedPropertiesToExternalArrayData()", return); |
| 2813 ENTER_V8; | 2841 ENTER_V8; |
| 2814 HandleScope scope; | 2842 HandleScope scope; |
| 2815 if (!ApiCheck(length <= i::ExternalArray::kMaxLength, | 2843 if (!ApiCheck(length <= i::ExternalArray::kMaxLength, |
| 2816 "v8::Object::SetIndexedPropertiesToExternalArrayData()", | 2844 "v8::Object::SetIndexedPropertiesToExternalArrayData()", |
| 2817 "length exceeds max acceptable value")) { | 2845 "length exceeds max acceptable value")) { |
| 2818 return; | 2846 return; |
| 2819 } | 2847 } |
| 2820 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2848 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2821 if (!ApiCheck(!self->IsJSArray(), | 2849 if (!ApiCheck(!self->IsJSArray(), |
| 2822 "v8::Object::SetIndexedPropertiesToExternalArrayData()", | 2850 "v8::Object::SetIndexedPropertiesToExternalArrayData()", |
| 2823 "JSArray is not supported")) { | 2851 "JSArray is not supported")) { |
| 2824 return; | 2852 return; |
| 2825 } | 2853 } |
| 2826 i::Handle<i::ExternalArray> array = | 2854 PrepareExternalArrayElements(self, data, array_type, length); |
| 2827 i::Factory::NewExternalArray(length, array_type, data); | |
| 2828 i::Handle<i::Map> slow_map = | |
| 2829 i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map())); | |
| 2830 self->set_map(*slow_map); | |
| 2831 self->set_elements(*array); | |
| 2832 } | 2855 } |
| 2833 | 2856 |
| 2834 | 2857 |
| 2835 bool v8::Object::HasIndexedPropertiesInExternalArrayData() { | 2858 bool v8::Object::HasIndexedPropertiesInExternalArrayData() { |
| 2836 ON_BAILOUT("v8::HasIndexedPropertiesInExternalArrayData()", return false); | 2859 ON_BAILOUT("v8::HasIndexedPropertiesInExternalArrayData()", return false); |
| 2837 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2860 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2838 return self->HasExternalArrayElements(); | 2861 return self->HasExternalArrayElements(); |
| 2839 } | 2862 } |
| 2840 | 2863 |
| 2841 | 2864 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2862 case i::EXTERNAL_SHORT_ARRAY_TYPE: | 2885 case i::EXTERNAL_SHORT_ARRAY_TYPE: |
| 2863 return kExternalShortArray; | 2886 return kExternalShortArray; |
| 2864 case i::EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 2887 case i::EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 2865 return kExternalUnsignedShortArray; | 2888 return kExternalUnsignedShortArray; |
| 2866 case i::EXTERNAL_INT_ARRAY_TYPE: | 2889 case i::EXTERNAL_INT_ARRAY_TYPE: |
| 2867 return kExternalIntArray; | 2890 return kExternalIntArray; |
| 2868 case i::EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 2891 case i::EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 2869 return kExternalUnsignedIntArray; | 2892 return kExternalUnsignedIntArray; |
| 2870 case i::EXTERNAL_FLOAT_ARRAY_TYPE: | 2893 case i::EXTERNAL_FLOAT_ARRAY_TYPE: |
| 2871 return kExternalFloatArray; | 2894 return kExternalFloatArray; |
| 2895 case i::EXTERNAL_PIXEL_ARRAY_TYPE: |
| 2896 return kExternalPixelArray; |
| 2872 default: | 2897 default: |
| 2873 return static_cast<ExternalArrayType>(-1); | 2898 return static_cast<ExternalArrayType>(-1); |
| 2874 } | 2899 } |
| 2875 } | 2900 } |
| 2876 | 2901 |
| 2877 | 2902 |
| 2878 int v8::Object::GetIndexedPropertiesExternalArrayDataLength() { | 2903 int v8::Object::GetIndexedPropertiesExternalArrayDataLength() { |
| 2879 ON_BAILOUT("v8::GetIndexedPropertiesExternalArrayDataLength()", return 0); | 2904 ON_BAILOUT("v8::GetIndexedPropertiesExternalArrayDataLength()", return 0); |
| 2880 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2905 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2881 if (self->HasExternalArrayElements()) { | 2906 if (self->HasExternalArrayElements()) { |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3548 void Context::ReattachGlobal(Handle<Object> global_object) { | 3573 void Context::ReattachGlobal(Handle<Object> global_object) { |
| 3549 if (IsDeadCheck("v8::Context::ReattachGlobal()")) return; | 3574 if (IsDeadCheck("v8::Context::ReattachGlobal()")) return; |
| 3550 ENTER_V8; | 3575 ENTER_V8; |
| 3551 i::Object** ctx = reinterpret_cast<i::Object**>(this); | 3576 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
| 3552 i::Handle<i::Context> context = | 3577 i::Handle<i::Context> context = |
| 3553 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); | 3578 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
| 3554 i::Bootstrapper::ReattachGlobal(context, Utils::OpenHandle(*global_object)); | 3579 i::Bootstrapper::ReattachGlobal(context, Utils::OpenHandle(*global_object)); |
| 3555 } | 3580 } |
| 3556 | 3581 |
| 3557 | 3582 |
| 3583 void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) { |
| 3584 i::GlobalHandles::SetWrapperClassId(global_handle, class_id); |
| 3585 } |
| 3586 |
| 3587 |
| 3558 Local<v8::Object> ObjectTemplate::NewInstance() { | 3588 Local<v8::Object> ObjectTemplate::NewInstance() { |
| 3559 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); | 3589 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); |
| 3560 LOG_API("ObjectTemplate::NewInstance"); | 3590 LOG_API("ObjectTemplate::NewInstance"); |
| 3561 ENTER_V8; | 3591 ENTER_V8; |
| 3562 EXCEPTION_PREAMBLE(); | 3592 EXCEPTION_PREAMBLE(); |
| 3563 i::Handle<i::Object> obj = | 3593 i::Handle<i::Object> obj = |
| 3564 i::Execution::InstantiateObject(Utils::OpenHandle(this), | 3594 i::Execution::InstantiateObject(Utils::OpenHandle(this), |
| 3565 &has_pending_exception); | 3595 &has_pending_exception); |
| 3566 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); | 3596 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); |
| 3567 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); | 3597 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4084 } | 4114 } |
| 4085 | 4115 |
| 4086 | 4116 |
| 4087 void V8::SetFailedAccessCheckCallbackFunction( | 4117 void V8::SetFailedAccessCheckCallbackFunction( |
| 4088 FailedAccessCheckCallback callback) { | 4118 FailedAccessCheckCallback callback) { |
| 4089 if (IsDeadCheck("v8::V8::SetFailedAccessCheckCallbackFunction()")) return; | 4119 if (IsDeadCheck("v8::V8::SetFailedAccessCheckCallbackFunction()")) return; |
| 4090 i::Top::SetFailedAccessCheckCallback(callback); | 4120 i::Top::SetFailedAccessCheckCallback(callback); |
| 4091 } | 4121 } |
| 4092 | 4122 |
| 4093 | 4123 |
| 4094 void V8::AddObjectGroup(Persistent<Value>* objects, size_t length) { | 4124 void V8::AddObjectGroup(Persistent<Value>* objects, |
| 4125 size_t length, |
| 4126 RetainedObjectInfo* info) { |
| 4095 if (IsDeadCheck("v8::V8::AddObjectGroup()")) return; | 4127 if (IsDeadCheck("v8::V8::AddObjectGroup()")) return; |
| 4096 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); | 4128 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); |
| 4097 i::GlobalHandles::AddGroup(reinterpret_cast<i::Object***>(objects), length); | 4129 i::GlobalHandles::AddGroup( |
| 4130 reinterpret_cast<i::Object***>(objects), length, info); |
| 4098 } | 4131 } |
| 4099 | 4132 |
| 4100 | 4133 |
| 4101 int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) { | 4134 int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) { |
| 4102 if (IsDeadCheck("v8::V8::AdjustAmountOfExternalAllocatedMemory()")) return 0; | 4135 if (IsDeadCheck("v8::V8::AdjustAmountOfExternalAllocatedMemory()")) return 0; |
| 4103 return i::Heap::AdjustAmountOfExternalAllocatedMemory(change_in_bytes); | 4136 return i::Heap::AdjustAmountOfExternalAllocatedMemory(change_in_bytes); |
| 4104 } | 4137 } |
| 4105 | 4138 |
| 4106 | 4139 |
| 4107 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { | 4140 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5033 internal_type = i::HeapSnapshot::kAggregated; | 5066 internal_type = i::HeapSnapshot::kAggregated; |
| 5034 break; | 5067 break; |
| 5035 default: | 5068 default: |
| 5036 UNREACHABLE(); | 5069 UNREACHABLE(); |
| 5037 } | 5070 } |
| 5038 return reinterpret_cast<const HeapSnapshot*>( | 5071 return reinterpret_cast<const HeapSnapshot*>( |
| 5039 i::HeapProfiler::TakeSnapshot( | 5072 i::HeapProfiler::TakeSnapshot( |
| 5040 *Utils::OpenHandle(*title), internal_type, control)); | 5073 *Utils::OpenHandle(*title), internal_type, control)); |
| 5041 } | 5074 } |
| 5042 | 5075 |
| 5076 |
| 5077 void HeapProfiler::DefineWrapperClass(uint16_t class_id, |
| 5078 WrapperInfoCallback callback) { |
| 5079 i::HeapProfiler::DefineWrapperClass(class_id, callback); |
| 5080 } |
| 5081 |
| 5043 #endif // ENABLE_LOGGING_AND_PROFILING | 5082 #endif // ENABLE_LOGGING_AND_PROFILING |
| 5044 | 5083 |
| 5045 | 5084 |
| 5046 v8::Testing::StressType internal::Testing::stress_type_ = | 5085 v8::Testing::StressType internal::Testing::stress_type_ = |
| 5047 v8::Testing::kStressTypeOpt; | 5086 v8::Testing::kStressTypeOpt; |
| 5048 | 5087 |
| 5049 | 5088 |
| 5050 void Testing::SetStressRunType(Testing::StressType type) { | 5089 void Testing::SetStressRunType(Testing::StressType type) { |
| 5051 internal::Testing::set_stress_type(type); | 5090 internal::Testing::set_stress_type(type); |
| 5052 } | 5091 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5097 SetFlagsFromString(kForcedOptimizations); | 5136 SetFlagsFromString(kForcedOptimizations); |
| 5098 } else if (run == GetStressRuns() - 2) { | 5137 } else if (run == GetStressRuns() - 2) { |
| 5099 SetFlagsFromString(kEagerOptimizations); | 5138 SetFlagsFromString(kEagerOptimizations); |
| 5100 } else { | 5139 } else { |
| 5101 SetFlagsFromString(kLazyOptimizations); | 5140 SetFlagsFromString(kLazyOptimizations); |
| 5102 } | 5141 } |
| 5103 #endif | 5142 #endif |
| 5104 } | 5143 } |
| 5105 | 5144 |
| 5106 | 5145 |
| 5146 void Testing::DeoptimizeAll() { |
| 5147 internal::Deoptimizer::DeoptimizeAll(); |
| 5148 } |
| 5149 |
| 5150 |
| 5107 namespace internal { | 5151 namespace internal { |
| 5108 | 5152 |
| 5109 | 5153 |
| 5110 HandleScopeImplementer* HandleScopeImplementer::instance() { | 5154 HandleScopeImplementer* HandleScopeImplementer::instance() { |
| 5111 return &thread_local; | 5155 return &thread_local; |
| 5112 } | 5156 } |
| 5113 | 5157 |
| 5114 | 5158 |
| 5115 void HandleScopeImplementer::FreeThreadResources() { | 5159 void HandleScopeImplementer::FreeThreadResources() { |
| 5116 thread_local.Free(); | 5160 thread_local.Free(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5180 | 5224 |
| 5181 | 5225 |
| 5182 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5226 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5183 HandleScopeImplementer* thread_local = | 5227 HandleScopeImplementer* thread_local = |
| 5184 reinterpret_cast<HandleScopeImplementer*>(storage); | 5228 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5185 thread_local->IterateThis(v); | 5229 thread_local->IterateThis(v); |
| 5186 return storage + ArchiveSpacePerThread(); | 5230 return storage + ArchiveSpacePerThread(); |
| 5187 } | 5231 } |
| 5188 | 5232 |
| 5189 } } // namespace v8::internal | 5233 } } // namespace v8::internal |
| OLD | NEW |