| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
| 9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
| 10 #include "src/ia32/frames-ia32.h" | 10 #include "src/ia32/frames-ia32.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Compute the size of relocation information needed for the code | 29 // Compute the size of relocation information needed for the code |
| 30 // patching in Deoptimizer::PatchCodeForDeoptimization below. | 30 // patching in Deoptimizer::PatchCodeForDeoptimization below. |
| 31 int min_reloc_size = 0; | 31 int min_reloc_size = 0; |
| 32 int prev_pc_offset = 0; | 32 int prev_pc_offset = 0; |
| 33 DeoptimizationInputData* deopt_data = | 33 DeoptimizationInputData* deopt_data = |
| 34 DeoptimizationInputData::cast(code->deoptimization_data()); | 34 DeoptimizationInputData::cast(code->deoptimization_data()); |
| 35 for (int i = 0; i < deopt_data->DeoptCount(); i++) { | 35 for (int i = 0; i < deopt_data->DeoptCount(); i++) { |
| 36 int pc_offset = deopt_data->Pc(i)->value(); | 36 int pc_offset = deopt_data->Pc(i)->value(); |
| 37 if (pc_offset == -1) continue; | 37 if (pc_offset == -1) continue; |
| 38 pc_offset = pc_offset + 1; // We will encode the pc offset after the call. |
| 38 DCHECK_GE(pc_offset, prev_pc_offset); | 39 DCHECK_GE(pc_offset, prev_pc_offset); |
| 39 int pc_delta = pc_offset - prev_pc_offset; | 40 int pc_delta = pc_offset - prev_pc_offset; |
| 40 // We use RUNTIME_ENTRY reloc info which has a size of 2 bytes | 41 // We use RUNTIME_ENTRY reloc info which has a size of 2 bytes |
| 41 // if encodable with small pc delta encoding and up to 6 bytes | 42 // if encodable with small pc delta encoding and up to 6 bytes |
| 42 // otherwise. | 43 // otherwise. |
| 43 if (pc_delta <= RelocInfo::kMaxSmallPCDelta) { | 44 if (pc_delta <= RelocInfo::kMaxSmallPCDelta) { |
| 44 min_reloc_size += 2; | 45 min_reloc_size += 2; |
| 45 } else { | 46 } else { |
| 46 min_reloc_size += 6; | 47 min_reloc_size += 6; |
| 47 } | 48 } |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 387 } |
| 387 | 388 |
| 388 | 389 |
| 389 #undef __ | 390 #undef __ |
| 390 | 391 |
| 391 | 392 |
| 392 } // namespace internal | 393 } // namespace internal |
| 393 } // namespace v8 | 394 } // namespace v8 |
| 394 | 395 |
| 395 #endif // V8_TARGET_ARCH_IA32 | 396 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |