Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 num_pending_32_bit_reloc_info_ = 0; | 467 num_pending_32_bit_reloc_info_ = 0; |
| 468 num_pending_64_bit_reloc_info_ = 0; | 468 num_pending_64_bit_reloc_info_ = 0; |
| 469 next_buffer_check_ = 0; | 469 next_buffer_check_ = 0; |
| 470 const_pool_blocked_nesting_ = 0; | 470 const_pool_blocked_nesting_ = 0; |
| 471 no_const_pool_before_ = 0; | 471 no_const_pool_before_ = 0; |
| 472 first_const_pool_32_use_ = -1; | 472 first_const_pool_32_use_ = -1; |
| 473 first_const_pool_64_use_ = -1; | 473 first_const_pool_64_use_ = -1; |
| 474 last_bound_pos_ = 0; | 474 last_bound_pos_ = 0; |
| 475 constant_pool_available_ = !FLAG_enable_ool_constant_pool; | 475 constant_pool_available_ = !FLAG_enable_ool_constant_pool; |
| 476 ClearRecordedAstId(); | 476 ClearRecordedAstId(); |
| 477 max_num_32_bit_reloc_info_ = | |
|
Rodolph Perfetta
2014/09/18 14:03:24
This may not work. kMaxNumPending[32|64]RelocInfo
| |
| 478 Min(kMaxNumPending32RelocInfo, buffer_size_ / kInstrSize); | |
| 479 max_num_64_bit_reloc_info_ = | |
| 480 Min(kMaxNumPending64RelocInfo, buffer_size_ / kInstrSize); | |
| 481 pending_32_bit_reloc_info_ = NewArray<RelocInfo>(max_num_32_bit_reloc_info_); | |
| 482 pending_64_bit_reloc_info_ = NewArray<RelocInfo>(max_num_64_bit_reloc_info_); | |
| 477 } | 483 } |
| 478 | 484 |
| 479 | 485 |
| 480 Assembler::~Assembler() { | 486 Assembler::~Assembler() { |
| 481 DCHECK(const_pool_blocked_nesting_ == 0); | 487 DCHECK(const_pool_blocked_nesting_ == 0); |
| 488 DeleteArray(pending_32_bit_reloc_info_); | |
| 489 DeleteArray(pending_64_bit_reloc_info_); | |
| 482 } | 490 } |
| 483 | 491 |
| 484 | 492 |
| 485 void Assembler::GetCode(CodeDesc* desc) { | 493 void Assembler::GetCode(CodeDesc* desc) { |
| 486 if (!FLAG_enable_ool_constant_pool) { | 494 if (!FLAG_enable_ool_constant_pool) { |
| 487 // Emit constant pool if necessary. | 495 // Emit constant pool if necessary. |
| 488 CheckConstPool(true, false); | 496 CheckConstPool(true, false); |
| 489 DCHECK(num_pending_32_bit_reloc_info_ == 0); | 497 DCHECK(num_pending_32_bit_reloc_info_ == 0); |
| 490 DCHECK(num_pending_64_bit_reloc_info_ == 0); | 498 DCHECK(num_pending_64_bit_reloc_info_ == 0); |
| 491 } | 499 } |
| (...skipping 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3356 } | 3364 } |
| 3357 } | 3365 } |
| 3358 | 3366 |
| 3359 | 3367 |
| 3360 ConstantPoolArray::LayoutSection Assembler::ConstantPoolAddEntry( | 3368 ConstantPoolArray::LayoutSection Assembler::ConstantPoolAddEntry( |
| 3361 const RelocInfo& rinfo) { | 3369 const RelocInfo& rinfo) { |
| 3362 if (FLAG_enable_ool_constant_pool) { | 3370 if (FLAG_enable_ool_constant_pool) { |
| 3363 return constant_pool_builder_.AddEntry(this, rinfo); | 3371 return constant_pool_builder_.AddEntry(this, rinfo); |
| 3364 } else { | 3372 } else { |
| 3365 if (rinfo.rmode() == RelocInfo::NONE64) { | 3373 if (rinfo.rmode() == RelocInfo::NONE64) { |
| 3366 DCHECK(num_pending_64_bit_reloc_info_ < kMaxNumPending64RelocInfo); | 3374 DCHECK(num_pending_64_bit_reloc_info_ < max_num_64_bit_reloc_info_); |
| 3367 if (num_pending_64_bit_reloc_info_ == 0) { | 3375 if (num_pending_64_bit_reloc_info_ == 0) { |
| 3368 first_const_pool_64_use_ = pc_offset(); | 3376 first_const_pool_64_use_ = pc_offset(); |
| 3369 } | 3377 } |
| 3370 pending_64_bit_reloc_info_[num_pending_64_bit_reloc_info_++] = rinfo; | 3378 pending_64_bit_reloc_info_[num_pending_64_bit_reloc_info_++] = rinfo; |
| 3371 } else { | 3379 } else { |
| 3372 DCHECK(num_pending_32_bit_reloc_info_ < kMaxNumPending32RelocInfo); | 3380 DCHECK(num_pending_32_bit_reloc_info_ < max_num_32_bit_reloc_info_); |
| 3373 if (num_pending_32_bit_reloc_info_ == 0) { | 3381 if (num_pending_32_bit_reloc_info_ == 0) { |
| 3374 first_const_pool_32_use_ = pc_offset(); | 3382 first_const_pool_32_use_ = pc_offset(); |
| 3375 } | 3383 } |
| 3376 pending_32_bit_reloc_info_[num_pending_32_bit_reloc_info_++] = rinfo; | 3384 pending_32_bit_reloc_info_[num_pending_32_bit_reloc_info_++] = rinfo; |
| 3377 } | 3385 } |
| 3378 // Make sure the constant pool is not emitted in place of the next | 3386 // Make sure the constant pool is not emitted in place of the next |
| 3379 // instruction for which we just recorded relocation info. | 3387 // instruction for which we just recorded relocation info. |
| 3380 BlockConstPoolFor(1); | 3388 BlockConstPoolFor(1); |
| 3381 return ConstantPoolArray::SMALL_SECTION; | 3389 return ConstantPoolArray::SMALL_SECTION; |
| 3382 } | 3390 } |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3835 assm->instr_at_put( | 3843 assm->instr_at_put( |
| 3836 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); | 3844 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); |
| 3837 } | 3845 } |
| 3838 } | 3846 } |
| 3839 } | 3847 } |
| 3840 | 3848 |
| 3841 | 3849 |
| 3842 } } // namespace v8::internal | 3850 } } // namespace v8::internal |
| 3843 | 3851 |
| 3844 #endif // V8_TARGET_ARCH_ARM | 3852 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |