| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7030 JavaScriptFrameIterator it; | 7030 JavaScriptFrameIterator it; |
| 7031 JavaScriptFrame* frame = it.frame(); | 7031 JavaScriptFrame* frame = it.frame(); |
| 7032 ASSERT(frame->function() == *function); | 7032 ASSERT(frame->function() == *function); |
| 7033 ASSERT(frame->code() == *unoptimized); | 7033 ASSERT(frame->code() == *unoptimized); |
| 7034 ASSERT(unoptimized->contains(frame->pc())); | 7034 ASSERT(unoptimized->contains(frame->pc())); |
| 7035 | 7035 |
| 7036 // Use linear search of the unoptimized code's stack check table to find | 7036 // Use linear search of the unoptimized code's stack check table to find |
| 7037 // the AST id matching the PC. | 7037 // the AST id matching the PC. |
| 7038 Address start = unoptimized->instruction_start(); | 7038 Address start = unoptimized->instruction_start(); |
| 7039 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start); | 7039 unsigned target_pc_offset = static_cast<unsigned>(frame->pc() - start); |
| 7040 Address table_cursor = start + unoptimized->stack_check_table_start(); | 7040 Address table_cursor = start + unoptimized->stack_check_table_offset(); |
| 7041 uint32_t table_length = Memory::uint32_at(table_cursor); | 7041 uint32_t table_length = Memory::uint32_at(table_cursor); |
| 7042 table_cursor += kIntSize; | 7042 table_cursor += kIntSize; |
| 7043 for (unsigned i = 0; i < table_length; ++i) { | 7043 for (unsigned i = 0; i < table_length; ++i) { |
| 7044 // Table entries are (AST id, pc offset) pairs. | 7044 // Table entries are (AST id, pc offset) pairs. |
| 7045 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize); | 7045 uint32_t pc_offset = Memory::uint32_at(table_cursor + kIntSize); |
| 7046 if (pc_offset == target_pc_offset) { | 7046 if (pc_offset == target_pc_offset) { |
| 7047 ast_id = static_cast<int>(Memory::uint32_at(table_cursor)); | 7047 ast_id = static_cast<int>(Memory::uint32_at(table_cursor)); |
| 7048 break; | 7048 break; |
| 7049 } | 7049 } |
| 7050 table_cursor += 2 * kIntSize; | 7050 table_cursor += 2 * kIntSize; |
| (...skipping 4011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11062 } else { | 11062 } else { |
| 11063 // Handle last resort GC and make sure to allow future allocations | 11063 // Handle last resort GC and make sure to allow future allocations |
| 11064 // to grow the heap without causing GCs (if possible). | 11064 // to grow the heap without causing GCs (if possible). |
| 11065 Counters::gc_last_resort_from_js.Increment(); | 11065 Counters::gc_last_resort_from_js.Increment(); |
| 11066 Heap::CollectAllGarbage(false); | 11066 Heap::CollectAllGarbage(false); |
| 11067 } | 11067 } |
| 11068 } | 11068 } |
| 11069 | 11069 |
| 11070 | 11070 |
| 11071 } } // namespace v8::internal | 11071 } } // namespace v8::internal |
| OLD | NEW |