| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "codegen.h" | 7 #include "codegen.h" |
| 8 #include "compiler.h" | 8 #include "compiler.h" |
| 9 #include "debug.h" | 9 #include "debug.h" |
| 10 #include "full-codegen.h" | 10 #include "full-codegen.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 } | 445 } |
| 446 | 446 |
| 447 | 447 |
| 448 void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) { | 448 void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) { |
| 449 // There's no need to prepare this code for bailouts from already optimized | 449 // There's no need to prepare this code for bailouts from already optimized |
| 450 // code or code that can't be optimized. | 450 // code or code that can't be optimized. |
| 451 if (!info_->HasDeoptimizationSupport()) return; | 451 if (!info_->HasDeoptimizationSupport()) return; |
| 452 unsigned pc_and_state = | 452 unsigned pc_and_state = |
| 453 StateField::encode(state) | PcField::encode(masm_->pc_offset()); | 453 StateField::encode(state) | PcField::encode(masm_->pc_offset()); |
| 454 ASSERT(Smi::IsValid(pc_and_state)); | 454 ASSERT(Smi::IsValid(pc_and_state)); |
| 455 #ifdef DEBUG |
| 456 for (int i = 0; i < bailout_entries_.length(); ++i) { |
| 457 ASSERT(bailout_entries_[i].id != id); |
| 458 } |
| 459 #endif |
| 455 BailoutEntry entry = { id, pc_and_state }; | 460 BailoutEntry entry = { id, pc_and_state }; |
| 456 ASSERT(!prepared_bailout_ids_.Contains(id.ToInt())); | |
| 457 prepared_bailout_ids_.Add(id.ToInt(), zone()); | |
| 458 bailout_entries_.Add(entry, zone()); | 461 bailout_entries_.Add(entry, zone()); |
| 459 } | 462 } |
| 460 | 463 |
| 461 | 464 |
| 462 void FullCodeGenerator::RecordBackEdge(BailoutId ast_id) { | 465 void FullCodeGenerator::RecordBackEdge(BailoutId ast_id) { |
| 463 // The pc offset does not need to be encoded and packed together with a state. | 466 // The pc offset does not need to be encoded and packed together with a state. |
| 464 ASSERT(masm_->pc_offset() > 0); | 467 ASSERT(masm_->pc_offset() > 0); |
| 465 ASSERT(loop_depth() > 0); | 468 ASSERT(loop_depth() > 0); |
| 466 uint8_t depth = Min(loop_depth(), Code::kMaxLoopNestingMarker); | 469 uint8_t depth = Min(loop_depth(), Code::kMaxLoopNestingMarker); |
| 467 BackEdgeEntry entry = | 470 BackEdgeEntry entry = |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 } | 1697 } |
| 1695 return true; | 1698 return true; |
| 1696 } | 1699 } |
| 1697 #endif // DEBUG | 1700 #endif // DEBUG |
| 1698 | 1701 |
| 1699 | 1702 |
| 1700 #undef __ | 1703 #undef __ |
| 1701 | 1704 |
| 1702 | 1705 |
| 1703 } } // namespace v8::internal | 1706 } } // namespace v8::internal |
| OLD | NEW |