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 4712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4723 FixedArray* object_array = FixedArray::cast(object->elements()); | 4723 FixedArray* object_array = FixedArray::cast(object->elements()); |
4724 object_array->set(store_index, *value); | 4724 object_array->set(store_index, *value); |
4725 } | 4725 } |
4726 return *object; | 4726 return *object; |
4727 } | 4727 } |
4728 | 4728 |
4729 | 4729 |
4730 // Check whether debugger and is about to step into the callback that is passed | 4730 // Check whether debugger and is about to step into the callback that is passed |
4731 // to a built-in function such as Array.forEach. | 4731 // to a built-in function such as Array.forEach. |
4732 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { | 4732 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) { |
4733 if (!isolate->IsDebuggerActive()) return isolate->heap()->false_value(); | 4733 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4734 if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) { |
| 4735 return isolate->heap()->false_value(); |
| 4736 } |
4734 CONVERT_ARG_CHECKED(Object, callback, 0); | 4737 CONVERT_ARG_CHECKED(Object, callback, 0); |
4735 // We do not step into the callback if it's a builtin or not even a function. | 4738 // We do not step into the callback if it's a builtin or not even a function. |
4736 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { | 4739 if (!callback->IsJSFunction() || JSFunction::cast(callback)->IsBuiltin()) { |
4737 return isolate->heap()->false_value(); | 4740 return isolate->heap()->false_value(); |
4738 } | 4741 } |
4739 return isolate->heap()->true_value(); | 4742 return isolate->heap()->true_value(); |
| 4743 #else |
| 4744 return isolate->heap()->false_value(); |
| 4745 #endif // ENABLE_DEBUGGER_SUPPORT |
4740 } | 4746 } |
4741 | 4747 |
4742 | 4748 |
4743 // Set one shot breakpoints for the callback function that is passed to a | 4749 // Set one shot breakpoints for the callback function that is passed to a |
4744 // built-in function such as Array.forEach to enable stepping into the callback. | 4750 // built-in function such as Array.forEach to enable stepping into the callback. |
4745 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { | 4751 RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) { |
| 4752 #ifdef ENABLE_DEBUGGER_SUPPORT |
4746 Debug* debug = isolate->debug(); | 4753 Debug* debug = isolate->debug(); |
4747 if (!debug->IsStepping()) return NULL; | 4754 if (!debug->IsStepping()) return isolate->heap()->undefined_value(); |
4748 CONVERT_ARG_CHECKED(Object, callback, 0); | 4755 CONVERT_ARG_CHECKED(Object, callback, 0); |
4749 HandleScope scope(isolate); | 4756 HandleScope scope(isolate); |
4750 Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared()); | 4757 Handle<SharedFunctionInfo> shared_info(JSFunction::cast(callback)->shared()); |
4751 // When leaving the callback, step out has been activated, but not performed | 4758 // When leaving the callback, step out has been activated, but not performed |
4752 // if we do not leave the builtin. To be able to step into the callback | 4759 // if we do not leave the builtin. To be able to step into the callback |
4753 // again, we need to clear the step out at this point. | 4760 // again, we need to clear the step out at this point. |
4754 debug->ClearStepOut(); | 4761 debug->ClearStepOut(); |
4755 debug->FloodWithOneShot(shared_info); | 4762 debug->FloodWithOneShot(shared_info); |
4756 return NULL; | 4763 #endif // ENABLE_DEBUGGER_SUPPORT |
| 4764 return isolate->heap()->undefined_value(); |
4757 } | 4765 } |
4758 | 4766 |
4759 | 4767 |
4760 // Set a local property, even if it is READ_ONLY. If the property does not | 4768 // Set a local property, even if it is READ_ONLY. If the property does not |
4761 // exist, it will be added with attributes NONE. | 4769 // exist, it will be added with attributes NONE. |
4762 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { | 4770 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { |
4763 NoHandleAllocation ha; | 4771 NoHandleAllocation ha; |
4764 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); | 4772 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); |
4765 CONVERT_ARG_CHECKED(JSObject, object, 0); | 4773 CONVERT_ARG_CHECKED(JSObject, object, 0); |
4766 CONVERT_ARG_CHECKED(String, name, 1); | 4774 CONVERT_ARG_CHECKED(String, name, 1); |
(...skipping 8695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13462 // Handle last resort GC and make sure to allow future allocations | 13470 // Handle last resort GC and make sure to allow future allocations |
13463 // to grow the heap without causing GCs (if possible). | 13471 // to grow the heap without causing GCs (if possible). |
13464 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13472 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13465 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13473 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13466 "Runtime::PerformGC"); | 13474 "Runtime::PerformGC"); |
13467 } | 13475 } |
13468 } | 13476 } |
13469 | 13477 |
13470 | 13478 |
13471 } } // namespace v8::internal | 13479 } } // namespace v8::internal |
OLD | NEW |