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 4824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4835 FixedArray* object_array = FixedArray::cast(object->elements()); | 4835 FixedArray* object_array = FixedArray::cast(object->elements()); |
4836 object_array->set(store_index, *value); | 4836 object_array->set(store_index, *value); |
4837 } | 4837 } |
4838 return *object; | 4838 return *object; |
4839 } | 4839 } |
4840 | 4840 |
4841 | 4841 |
4842 // Check whether debugger and is about to step into the callback that is passed | 4842 // Check whether debugger and is about to step into the callback that is passed |
4843 // to a built-in function such as Array.forEach. | 4843 // to a built-in function such as Array.forEach. |
4844 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { | 4844 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { |
4845 if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value(); | 4845 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4846 if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) { |
| 4847 return isolate->heap()->false_value(); |
| 4848 } |
4846 CONVERT_ARG_CHECKED(Object, callback, 0); | 4849 CONVERT_ARG_CHECKED(Object, callback, 0); |
4847 // We do not step into the callback if it's a builtin or not even a function. | 4850 // We do not step into the callback if it's a builtin or not even a function. |
4848 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { | 4851 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { |
4849 return isolate->heap()->false_value(); | 4852 return isolate->heap()->false_value(); |
4850 } | 4853 } |
4851 return isolate->heap()->true_value(); | 4854 return isolate->heap()->true_value(); |
| 4855 #else |
| 4856 return isolate->heap()->false_value(); |
| 4857 #endif // ENABLE_DEBUGGER_SUPPORT |
4852 } | 4858 } |
4853 | 4859 |
4854 | 4860 |
4855 // Set one shot breakpoints for the callback function that is passed to a | 4861 // Set one shot breakpoints for the callback function that is passed to a |
4856 // built-in function such as Array.forEach to enable stepping into the callback. | 4862 // built-in function such as Array.forEach to enable stepping into the callback. |
4857 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { | 4863 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { |
| 4864 #ifdef ENABLE_DEBUGGER_SUPPORT |
4858 Debug* debug = isolate->debug(); | 4865 Debug* debug = isolate->debug(); |
4859 if (!debug->IsStepping()) return NULL; | 4866 if (!debug->IsStepping()) return isolate->heap()->undefined_value(); |
4860 CONVERT_ARG_CHECKED(Object, callback, 0); | 4867 CONVERT_ARG_CHECKED(Object, callback, 0); |
4861 HandleScope scope(isolate); | 4868 HandleScope scope(isolate); |
4862 Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared()); | 4869 Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared()); |
4863 // When leaving the callback, step out has been activated, but not performed | 4870 // When leaving the callback, step out has been activated, but not performed |
4864 // if we do not leave the builtin. To be able to step into the callback | 4871 // if we do not leave the builtin. To be able to step into the callback |
4865 // again, we need to clear the step out at this point. | 4872 // again, we need to clear the step out at this point. |
4866 debug->ClearStepOut(); | 4873 debug->ClearStepOut(); |
4867 debug->FloodWithOneShot(shared_info); | 4874 debug->FloodWithOneShot(shared_info); |
4868 return NULL; | 4875 #endif // ENABLE_DEBUGGER_SUPPORT |
| 4876 return isolate->heap()->undefined_value(); |
4869 } | 4877 } |
4870 | 4878 |
4871 | 4879 |
4872 // Set a local property, even if it is READ_ONLY. If the property does not | 4880 // Set a local property, even if it is READ_ONLY. If the property does not |
4873 // exist, it will be added with attributes NONE. | 4881 // exist, it will be added with attributes NONE. |
4874 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { | 4882 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { |
4875 NoHandleAllocation ha; | 4883 NoHandleAllocation ha; |
4876 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); | 4884 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); |
4877 CONVERT_ARG_CHECKED(JSObject, object, 0); | 4885 CONVERT_ARG_CHECKED(JSObject, object, 0); |
4878 CONVERT_ARG_CHECKED(String, name, 1); | 4886 CONVERT_ARG_CHECKED(String, name, 1); |
(...skipping 8718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13597 // Handle last resort GC and make sure to allow future allocations | 13605 // Handle last resort GC and make sure to allow future allocations |
13598 // to grow the heap without causing GCs (if possible). | 13606 // to grow the heap without causing GCs (if possible). |
13599 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13607 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13600 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13608 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13601 "Runtime::PerformGC"); | 13609 "Runtime::PerformGC"); |
13602 } | 13610 } |
13603 } | 13611 } |
13604 | 13612 |
13605 | 13613 |
13606 } } // namespace v8::internal | 13614 } } // namespace v8::internal |
OLD | NEW |