| 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 11996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12007 RUNTIME_ARGUMENTS(isolate, args)); | 12007 RUNTIME_ARGUMENTS(isolate, args)); |
| 12008 if (!maybe_check->ToObject(&check)) return maybe_check; | 12008 if (!maybe_check->ToObject(&check)) return maybe_check; |
| 12009 } | 12009 } |
| 12010 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); | 12010 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); |
| 12011 | 12011 |
| 12012 // Get the frame where the debugging is performed. | 12012 // Get the frame where the debugging is performed. |
| 12013 StackFrame::Id id = UnwrapFrameId(wrapped_id); | 12013 StackFrame::Id id = UnwrapFrameId(wrapped_id); |
| 12014 JavaScriptFrameIterator frame_it(isolate, id); | 12014 JavaScriptFrameIterator frame_it(isolate, id); |
| 12015 JavaScriptFrame* frame = frame_it.frame(); | 12015 JavaScriptFrame* frame = frame_it.frame(); |
| 12016 | 12016 |
| 12017 Handle<JSFunction> fun = |
| 12018 Handle<JSFunction>(frame->function()); |
| 12017 Handle<SharedFunctionInfo> shared = | 12019 Handle<SharedFunctionInfo> shared = |
| 12018 Handle<SharedFunctionInfo>(frame->function()->shared()); | 12020 Handle<SharedFunctionInfo>(fun->shared()); |
| 12021 bool has_info = isolate->debug()->EnsureDebugInfo(shared, fun); |
| 12022 if (!has_info) { |
| 12023 return isolate->heap()->undefined_value(); |
| 12024 } |
| 12019 Handle<DebugInfo> debug_info = Debug::GetDebugInfo(shared); | 12025 Handle<DebugInfo> debug_info = Debug::GetDebugInfo(shared); |
| 12020 | 12026 |
| 12021 int len = 0; | 12027 int len = 0; |
| 12022 Handle<JSArray> array(isolate->factory()->NewJSArray(10)); | 12028 Handle<JSArray> array(isolate->factory()->NewJSArray(10)); |
| 12023 // Find the break point where execution has stopped. | 12029 // Find the break point where execution has stopped. |
| 12024 BreakLocationIterator break_location_iterator(debug_info, | 12030 BreakLocationIterator break_location_iterator(debug_info, |
| 12025 ALL_BREAK_LOCATIONS); | 12031 ALL_BREAK_LOCATIONS); |
| 12026 | 12032 |
| 12027 break_location_iterator.FindBreakLocationFromAddress(frame->pc()); | 12033 break_location_iterator.FindBreakLocationFromAddress(frame->pc()); |
| 12028 int current_statement_pos = break_location_iterator.statement_position(); | 12034 int current_statement_pos = break_location_iterator.statement_position(); |
| (...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14395 // Handle last resort GC and make sure to allow future allocations | 14401 // Handle last resort GC and make sure to allow future allocations |
| 14396 // to grow the heap without causing GCs (if possible). | 14402 // to grow the heap without causing GCs (if possible). |
| 14397 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14403 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14398 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14404 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14399 "Runtime::PerformGC"); | 14405 "Runtime::PerformGC"); |
| 14400 } | 14406 } |
| 14401 } | 14407 } |
| 14402 | 14408 |
| 14403 | 14409 |
| 14404 } } // namespace v8::internal | 14410 } } // namespace v8::internal |
| OLD | NEW |