| 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 4874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4885 FixedArray* object_array = FixedArray::cast(object->elements()); | 4885 FixedArray* object_array = FixedArray::cast(object->elements()); |
| 4886 object_array->set(store_index, *value); | 4886 object_array->set(store_index, *value); |
| 4887 } | 4887 } |
| 4888 return *object; | 4888 return *object; |
| 4889 } | 4889 } |
| 4890 | 4890 |
| 4891 | 4891 |
| 4892 // Check whether debugger and is about to step into the callback that is passed | 4892 // Check whether debugger and is about to step into the callback that is passed |
| 4893 // to a built-in function such as Array.forEach. | 4893 // to a built-in function such as Array.forEach. |
| 4894 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { | 4894 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { |
| 4895 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4895 if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value(); | 4896 if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value(); |
| 4896 CONVERT_ARG_CHECKED(Object, callback, 0); | 4897 CONVERT_ARG_CHECKED(Object, callback, 0); |
| 4897 // We do not step into the callback if it's a builtin or not even a function. | 4898 // We do not step into the callback if it's a builtin or not even a function. |
| 4898 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { | 4899 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { |
| 4899 return isolate->heap()->false_value(); | 4900 return isolate->heap()->false_value(); |
| 4900 } | 4901 } |
| 4901 return isolate->heap()->true_value(); | 4902 return isolate->heap()->true_value(); |
| 4903 #else |
| 4904 return isolate->heap()->false_value(); |
| 4905 #endif // ENABLE_DEBUGGER_SUPPORT |
| 4902 } | 4906 } |
| 4903 | 4907 |
| 4904 | 4908 |
| 4905 // Set one shot breakpoints for the callback function that is passed to a | 4909 // Set one shot breakpoints for the callback function that is passed to a |
| 4906 // built-in function such as Array.forEach to enable stepping into the callback. | 4910 // built-in function such as Array.forEach to enable stepping into the callback. |
| 4907 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { | 4911 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { |
| 4912 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4908 Debug* debug = isolate->debug(); | 4913 Debug* debug = isolate->debug(); |
| 4909 if (!debug->IsStepping()) return NULL; | 4914 if (!debug->IsStepping()) return NULL; |
| 4910 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0); | 4915 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0); |
| 4911 HandleScope scope(isolate); | 4916 HandleScope scope(isolate); |
| 4912 // When leaving the callback, step out has been activated, but not performed | 4917 // When leaving the callback, step out has been activated, but not performed |
| 4913 // if we do not leave the builtin. To be able to step into the callback | 4918 // if we do not leave the builtin. To be able to step into the callback |
| 4914 // again, we need to clear the step out at this point. | 4919 // again, we need to clear the step out at this point. |
| 4915 debug->ClearStepOut(); | 4920 debug->ClearStepOut(); |
| 4916 debug->FloodWithOneShot(callback); | 4921 debug->FloodWithOneShot(callback); |
| 4917 return NULL; | 4922 #endif // ENABLE_DEBUGGER_SUPPORT |
| 4923 return isolate->heap()->undefined_value(); |
| 4918 } | 4924 } |
| 4919 | 4925 |
| 4920 | 4926 |
| 4921 // Set a local property, even if it is READ_ONLY. If the property does not | 4927 // Set a local property, even if it is READ_ONLY. If the property does not |
| 4922 // exist, it will be added with attributes NONE. | 4928 // exist, it will be added with attributes NONE. |
| 4923 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { | 4929 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { |
| 4924 NoHandleAllocation ha; | 4930 NoHandleAllocation ha; |
| 4925 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); | 4931 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); |
| 4926 CONVERT_ARG_CHECKED(JSObject, object, 0); | 4932 CONVERT_ARG_CHECKED(JSObject, object, 0); |
| 4927 CONVERT_ARG_CHECKED(String, name, 1); | 4933 CONVERT_ARG_CHECKED(String, name, 1); |
| (...skipping 8777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13705 // Handle last resort GC and make sure to allow future allocations | 13711 // Handle last resort GC and make sure to allow future allocations |
| 13706 // to grow the heap without causing GCs (if possible). | 13712 // to grow the heap without causing GCs (if possible). |
| 13707 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13713 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13708 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13714 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13709 "Runtime::PerformGC"); | 13715 "Runtime::PerformGC"); |
| 13710 } | 13716 } |
| 13711 } | 13717 } |
| 13712 | 13718 |
| 13713 | 13719 |
| 13714 } } // namespace v8::internal | 13720 } } // namespace v8::internal |
| OLD | NEW |