| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 al | B26 | L | NegOffset | Register::kCode_fp * B16; | 469 al | B26 | L | NegOffset | Register::kCode_fp * B16; |
| 470 const Instr kStrRegFpNegOffsetPattern = | 470 const Instr kStrRegFpNegOffsetPattern = |
| 471 al | B26 | NegOffset | Register::kCode_fp * B16; | 471 al | B26 | NegOffset | Register::kCode_fp * B16; |
| 472 const Instr kLdrStrInstrTypeMask = 0xffff0000; | 472 const Instr kLdrStrInstrTypeMask = 0xffff0000; |
| 473 | 473 |
| 474 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) | 474 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |
| 475 : AssemblerBase(isolate, buffer, buffer_size), | 475 : AssemblerBase(isolate, buffer, buffer_size), |
| 476 recorded_ast_id_(TypeFeedbackId::None()), | 476 recorded_ast_id_(TypeFeedbackId::None()), |
| 477 pending_32_bit_constants_(), | 477 pending_32_bit_constants_(), |
| 478 pending_64_bit_constants_(), | 478 pending_64_bit_constants_(), |
| 479 constant_pool_builder_(kLdrMaxReachBits, kVldrMaxReachBits), | 479 constant_pool_builder_(kLdrMaxReachBits, kVldrMaxReachBits) { |
| 480 positions_recorder_(this) { | |
| 481 pending_32_bit_constants_.reserve(kMinNumPendingConstants); | 480 pending_32_bit_constants_.reserve(kMinNumPendingConstants); |
| 482 pending_64_bit_constants_.reserve(kMinNumPendingConstants); | 481 pending_64_bit_constants_.reserve(kMinNumPendingConstants); |
| 483 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); | 482 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); |
| 484 next_buffer_check_ = 0; | 483 next_buffer_check_ = 0; |
| 485 const_pool_blocked_nesting_ = 0; | 484 const_pool_blocked_nesting_ = 0; |
| 486 no_const_pool_before_ = 0; | 485 no_const_pool_before_ = 0; |
| 487 first_const_pool_32_use_ = -1; | 486 first_const_pool_32_use_ = -1; |
| 488 first_const_pool_64_use_ = -1; | 487 first_const_pool_64_use_ = -1; |
| 489 last_bound_pos_ = 0; | 488 last_bound_pos_ = 0; |
| 490 ClearRecordedAstId(); | 489 ClearRecordedAstId(); |
| 491 } | 490 } |
| 492 | 491 |
| 493 | 492 |
| 494 Assembler::~Assembler() { | 493 Assembler::~Assembler() { |
| 495 DCHECK(const_pool_blocked_nesting_ == 0); | 494 DCHECK(const_pool_blocked_nesting_ == 0); |
| 496 } | 495 } |
| 497 | 496 |
| 498 | 497 |
| 499 void Assembler::GetCode(CodeDesc* desc) { | 498 void Assembler::GetCode(CodeDesc* desc) { |
| 500 reloc_info_writer.Finish(); | |
| 501 | |
| 502 // Emit constant pool if necessary. | 499 // Emit constant pool if necessary. |
| 503 int constant_pool_offset = 0; | 500 int constant_pool_offset = 0; |
| 504 if (FLAG_enable_embedded_constant_pool) { | 501 if (FLAG_enable_embedded_constant_pool) { |
| 505 constant_pool_offset = EmitEmbeddedConstantPool(); | 502 constant_pool_offset = EmitEmbeddedConstantPool(); |
| 506 } else { | 503 } else { |
| 507 CheckConstPool(true, false); | 504 CheckConstPool(true, false); |
| 508 DCHECK(pending_32_bit_constants_.empty()); | 505 DCHECK(pending_32_bit_constants_.empty()); |
| 509 DCHECK(pending_64_bit_constants_.empty()); | 506 DCHECK(pending_64_bit_constants_.empty()); |
| 510 } | 507 } |
| 511 // Set up code descriptor. | 508 // Set up code descriptor. |
| (...skipping 3392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3904 ClearRecordedAstId(); | 3901 ClearRecordedAstId(); |
| 3905 } | 3902 } |
| 3906 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); | 3903 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
| 3907 reloc_info_writer.Write(&rinfo); | 3904 reloc_info_writer.Write(&rinfo); |
| 3908 } | 3905 } |
| 3909 | 3906 |
| 3910 | 3907 |
| 3911 ConstantPoolEntry::Access Assembler::ConstantPoolAddEntry(int position, | 3908 ConstantPoolEntry::Access Assembler::ConstantPoolAddEntry(int position, |
| 3912 RelocInfo::Mode rmode, | 3909 RelocInfo::Mode rmode, |
| 3913 intptr_t value) { | 3910 intptr_t value) { |
| 3914 DCHECK(rmode != RelocInfo::COMMENT && rmode != RelocInfo::POSITION && | 3911 DCHECK(rmode != RelocInfo::COMMENT && rmode != RelocInfo::CONST_POOL && |
| 3915 rmode != RelocInfo::STATEMENT_POSITION && | 3912 rmode != RelocInfo::NONE64); |
| 3916 rmode != RelocInfo::CONST_POOL && rmode != RelocInfo::NONE64); | |
| 3917 bool sharing_ok = RelocInfo::IsNone(rmode) || | 3913 bool sharing_ok = RelocInfo::IsNone(rmode) || |
| 3918 !(serializer_enabled() || rmode < RelocInfo::CELL); | 3914 !(serializer_enabled() || rmode < RelocInfo::CELL); |
| 3919 if (FLAG_enable_embedded_constant_pool) { | 3915 if (FLAG_enable_embedded_constant_pool) { |
| 3920 return constant_pool_builder_.AddEntry(position, value, sharing_ok); | 3916 return constant_pool_builder_.AddEntry(position, value, sharing_ok); |
| 3921 } else { | 3917 } else { |
| 3922 DCHECK(pending_32_bit_constants_.size() < kMaxNumPending32Constants); | 3918 DCHECK(pending_32_bit_constants_.size() < kMaxNumPending32Constants); |
| 3923 if (pending_32_bit_constants_.empty()) { | 3919 if (pending_32_bit_constants_.empty()) { |
| 3924 first_const_pool_32_use_ = position; | 3920 first_const_pool_32_use_ = position; |
| 3925 } | 3921 } |
| 3926 ConstantPoolEntry entry(position, value, sharing_ok); | 3922 ConstantPoolEntry entry(position, value, sharing_ok); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4255 DCHECK(is_uint12(offset)); | 4251 DCHECK(is_uint12(offset)); |
| 4256 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 4252 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
| 4257 } | 4253 } |
| 4258 } | 4254 } |
| 4259 | 4255 |
| 4260 | 4256 |
| 4261 } // namespace internal | 4257 } // namespace internal |
| 4262 } // namespace v8 | 4258 } // namespace v8 |
| 4263 | 4259 |
| 4264 #endif // V8_TARGET_ARCH_ARM | 4260 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |