| 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 8529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8540 // The top JS function is this one, the PC is somewhere in the | 8540 // The top JS function is this one, the PC is somewhere in the |
| 8541 // unoptimized code. | 8541 // unoptimized code. |
| 8542 JavaScriptFrameIterator it(isolate); | 8542 JavaScriptFrameIterator it(isolate); |
| 8543 JavaScriptFrame* frame = it.frame(); | 8543 JavaScriptFrame* frame = it.frame(); |
| 8544 ASSERT(frame->function() == *function); | 8544 ASSERT(frame->function() == *function); |
| 8545 ASSERT(frame->LookupCode() == *unoptimized); | 8545 ASSERT(frame->LookupCode() == *unoptimized); |
| 8546 ASSERT(unoptimized->contains(frame->pc())); | 8546 ASSERT(unoptimized->contains(frame->pc())); |
| 8547 | 8547 |
| 8548 // Use linear search of the unoptimized code's back edge table to find | 8548 // Use linear search of the unoptimized code's back edge table to find |
| 8549 // the AST id matching the PC. | 8549 // the AST id matching the PC. |
| 8550 uint32_t target_pc_offset = frame->pc() - unoptimized->instruction_start(); | 8550 uint32_t target_pc_offset = |
| 8551 static_cast<uint32_t>(frame->pc() - unoptimized->instruction_start()); |
| 8551 uint32_t loop_depth = 0; | 8552 uint32_t loop_depth = 0; |
| 8552 | 8553 |
| 8553 for (FullCodeGenerator::BackEdgeTableIterator back_edges(*unoptimized); | 8554 for (FullCodeGenerator::BackEdgeTableIterator back_edges(*unoptimized); |
| 8554 !back_edges.Done(); | 8555 !back_edges.Done(); |
| 8555 back_edges.Next()) { | 8556 back_edges.Next()) { |
| 8556 if (back_edges.pc_offset() == target_pc_offset) { | 8557 if (back_edges.pc_offset() == target_pc_offset) { |
| 8557 ast_id = back_edges.ast_id(); | 8558 ast_id = back_edges.ast_id(); |
| 8558 loop_depth = back_edges.loop_depth(); | 8559 loop_depth = back_edges.loop_depth(); |
| 8559 break; | 8560 break; |
| 8560 } | 8561 } |
| (...skipping 5600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14161 // Handle last resort GC and make sure to allow future allocations | 14162 // Handle last resort GC and make sure to allow future allocations |
| 14162 // to grow the heap without causing GCs (if possible). | 14163 // to grow the heap without causing GCs (if possible). |
| 14163 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14164 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14164 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14165 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14165 "Runtime::PerformGC"); | 14166 "Runtime::PerformGC"); |
| 14166 } | 14167 } |
| 14167 } | 14168 } |
| 14168 | 14169 |
| 14169 | 14170 |
| 14170 } } // namespace v8::internal | 14171 } } // namespace v8::internal |
| OLD | NEW |