| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 Isolate* isolate = code->GetIsolate(); | 1752 Isolate* isolate = code->GetIsolate(); |
| 1753 Address pc = code->instruction_start() + pc_offset; | 1753 Address pc = code->instruction_start() + pc_offset; |
| 1754 | 1754 |
| 1755 if (OSR_AFTER_STACK_CHECK == GetBackEdgeState(isolate, *code, pc)) { | 1755 if (OSR_AFTER_STACK_CHECK == GetBackEdgeState(isolate, *code, pc)) { |
| 1756 Code* patch = isolate->builtins()->builtin(Builtins::kOnStackReplacement); | 1756 Code* patch = isolate->builtins()->builtin(Builtins::kOnStackReplacement); |
| 1757 PatchAt(*code, pc, ON_STACK_REPLACEMENT, patch); | 1757 PatchAt(*code, pc, ON_STACK_REPLACEMENT, patch); |
| 1758 } | 1758 } |
| 1759 } | 1759 } |
| 1760 | 1760 |
| 1761 | 1761 |
| 1762 #ifdef DEBUG | 1762 #if DCHECK_IS_ON |
| 1763 bool BackEdgeTable::Verify(Isolate* isolate, Code* unoptimized) { | 1763 bool BackEdgeTable::Verify(Isolate* isolate, Code* unoptimized) { |
| 1764 DisallowHeapAllocation no_gc; | 1764 DisallowHeapAllocation no_gc; |
| 1765 int loop_nesting_level = unoptimized->allow_osr_at_loop_nesting_level(); | 1765 int loop_nesting_level = unoptimized->allow_osr_at_loop_nesting_level(); |
| 1766 BackEdgeTable back_edges(unoptimized, &no_gc); | 1766 BackEdgeTable back_edges(unoptimized, &no_gc); |
| 1767 for (uint32_t i = 0; i < back_edges.length(); i++) { | 1767 for (uint32_t i = 0; i < back_edges.length(); i++) { |
| 1768 uint32_t loop_depth = back_edges.loop_depth(i); | 1768 uint32_t loop_depth = back_edges.loop_depth(i); |
| 1769 CHECK_LE(static_cast<int>(loop_depth), Code::kMaxLoopNestingMarker); | 1769 CHECK_LE(static_cast<int>(loop_depth), Code::kMaxLoopNestingMarker); |
| 1770 // Assert that all back edges for shallower loops (and only those) | 1770 // Assert that all back edges for shallower loops (and only those) |
| 1771 // have already been patched. | 1771 // have already been patched. |
| 1772 CHECK_EQ((static_cast<int>(loop_depth) <= loop_nesting_level), | 1772 CHECK_EQ((static_cast<int>(loop_depth) <= loop_nesting_level), |
| 1773 GetBackEdgeState(isolate, | 1773 GetBackEdgeState(isolate, |
| 1774 unoptimized, | 1774 unoptimized, |
| 1775 back_edges.pc(i)) != INTERRUPT); | 1775 back_edges.pc(i)) != INTERRUPT); |
| 1776 } | 1776 } |
| 1777 return true; | 1777 return true; |
| 1778 } | 1778 } |
| 1779 #endif // DEBUG | 1779 #endif // DCHECK_IS_ON |
| 1780 | 1780 |
| 1781 | 1781 |
| 1782 FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded( | 1782 FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded( |
| 1783 FullCodeGenerator* codegen, Scope* scope, BailoutId entry_id, | 1783 FullCodeGenerator* codegen, Scope* scope, BailoutId entry_id, |
| 1784 BailoutId declarations_id, BailoutId exit_id) | 1784 BailoutId declarations_id, BailoutId exit_id) |
| 1785 : codegen_(codegen), scope_(scope), exit_id_(exit_id) { | 1785 : codegen_(codegen), scope_(scope), exit_id_(exit_id) { |
| 1786 saved_scope_ = codegen_->scope(); | 1786 saved_scope_ = codegen_->scope(); |
| 1787 | 1787 |
| 1788 if (scope == NULL) { | 1788 if (scope == NULL) { |
| 1789 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); | 1789 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1819 } | 1819 } |
| 1820 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1820 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
| 1821 codegen_->scope_ = saved_scope_; | 1821 codegen_->scope_ = saved_scope_; |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 | 1824 |
| 1825 #undef __ | 1825 #undef __ |
| 1826 | 1826 |
| 1827 | 1827 |
| 1828 } } // namespace v8::internal | 1828 } } // namespace v8::internal |
| OLD | NEW |