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 11860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11871 | 11871 |
11872 | 11872 |
11873 // Changes the state of a break point in a script and returns source position | 11873 // Changes the state of a break point in a script and returns source position |
11874 // where break point was set. NOTE: Regarding performance see the NOTE for | 11874 // where break point was set. NOTE: Regarding performance see the NOTE for |
11875 // GetScriptFromScriptData. | 11875 // GetScriptFromScriptData. |
11876 // args[0]: script to set break point in | 11876 // args[0]: script to set break point in |
11877 // args[1]: number: break source position (within the script source) | 11877 // args[1]: number: break source position (within the script source) |
11878 // args[2]: number: break point object | 11878 // args[2]: number: break point object |
11879 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetScriptBreakPoint) { | 11879 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetScriptBreakPoint) { |
11880 HandleScope scope(isolate); | 11880 HandleScope scope(isolate); |
11881 ASSERT(args.length() == 3); | 11881 ASSERT(args.length() == 4); |
11882 CONVERT_ARG_HANDLE_CHECKED(JSValue, wrapper, 0); | 11882 CONVERT_ARG_HANDLE_CHECKED(JSValue, wrapper, 0); |
11883 CONVERT_NUMBER_CHECKED(int32_t, source_position, Int32, args[1]); | 11883 CONVERT_NUMBER_CHECKED(int32_t, source_position, Int32, args[1]); |
11884 RUNTIME_ASSERT(source_position >= 0); | 11884 RUNTIME_ASSERT(source_position >= 0); |
11885 Handle<Object> break_point_object_arg = args.at<Object>(2); | 11885 CONVERT_BOOLEAN_ARG_CHECKED(statement_alighned, 2); |
| 11886 Handle<Object> break_point_object_arg = args.at<Object>(3); |
11886 | 11887 |
11887 // Get the script from the script wrapper. | 11888 // Get the script from the script wrapper. |
11888 RUNTIME_ASSERT(wrapper->value()->IsScript()); | 11889 RUNTIME_ASSERT(wrapper->value()->IsScript()); |
11889 Handle<Script> script(Script::cast(wrapper->value())); | 11890 Handle<Script> script(Script::cast(wrapper->value())); |
11890 | 11891 |
11891 // Set break point. | 11892 // Set break point. |
11892 if (!isolate->debug()->SetBreakPointForScript(script, break_point_object_arg, | 11893 if (!isolate->debug()->SetBreakPointForScript(script, break_point_object_arg, |
11893 &source_position)) { | 11894 &source_position, |
| 11895 statement_alighned)) { |
11894 return isolate->heap()->undefined_value(); | 11896 return isolate->heap()->undefined_value(); |
11895 } | 11897 } |
11896 | 11898 |
11897 return Smi::FromInt(source_position); | 11899 return Smi::FromInt(source_position); |
11898 } | 11900 } |
11899 | 11901 |
11900 | 11902 |
11901 // Clear a break point | 11903 // Clear a break point |
11902 // args[0]: number: break point object | 11904 // args[0]: number: break point object |
11903 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearBreakPoint) { | 11905 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearBreakPoint) { |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13633 // Handle last resort GC and make sure to allow future allocations | 13635 // Handle last resort GC and make sure to allow future allocations |
13634 // to grow the heap without causing GCs (if possible). | 13636 // to grow the heap without causing GCs (if possible). |
13635 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13637 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13638 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13637 "Runtime::PerformGC"); | 13639 "Runtime::PerformGC"); |
13638 } | 13640 } |
13639 } | 13641 } |
13640 | 13642 |
13641 | 13643 |
13642 } } // namespace v8::internal | 13644 } } // namespace v8::internal |
OLD | NEW |