| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // that we are still not overlapping instructions and relocation info). | 408 // that we are still not overlapping instructions and relocation info). |
| 409 ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap. | 409 ASSERT(pc_ <= reloc_info_writer.pos()); // No overlap. |
| 410 // Setup code descriptor. | 410 // Setup code descriptor. |
| 411 desc->buffer = buffer_; | 411 desc->buffer = buffer_; |
| 412 desc->buffer_size = buffer_size_; | 412 desc->buffer_size = buffer_size_; |
| 413 desc->instr_size = pc_offset(); | 413 desc->instr_size = pc_offset(); |
| 414 ASSERT(desc->instr_size > 0); // Zero-size code objects upset the system. | 414 ASSERT(desc->instr_size > 0); // Zero-size code objects upset the system. |
| 415 desc->reloc_size = | 415 desc->reloc_size = |
| 416 static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos()); | 416 static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos()); |
| 417 desc->origin = this; | 417 desc->origin = this; |
| 418 | |
| 419 COUNTERS->reloc_info_size()->Increment(desc->reloc_size); | |
| 420 } | 418 } |
| 421 | 419 |
| 422 | 420 |
| 423 void Assembler::Align(int m) { | 421 void Assembler::Align(int m) { |
| 424 ASSERT(IsPowerOf2(m)); | 422 ASSERT(IsPowerOf2(m)); |
| 425 int delta = (m - (pc_offset() & (m - 1))) & (m - 1); | 423 int delta = (m - (pc_offset() & (m - 1))) & (m - 1); |
| 426 while (delta >= 9) { | 424 while (delta >= 9) { |
| 427 nop(9); | 425 nop(9); |
| 428 delta -= 9; | 426 delta -= 9; |
| 429 } | 427 } |
| (...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3160 // specially coded on x64 means that it is a relative 32 bit address, as used | 3158 // specially coded on x64 means that it is a relative 32 bit address, as used |
| 3161 // by branch instructions. | 3159 // by branch instructions. |
| 3162 return (1 << rmode_) & kApplyMask; | 3160 return (1 << rmode_) & kApplyMask; |
| 3163 } | 3161 } |
| 3164 | 3162 |
| 3165 | 3163 |
| 3166 | 3164 |
| 3167 } } // namespace v8::internal | 3165 } } // namespace v8::internal |
| 3168 | 3166 |
| 3169 #endif // V8_TARGET_ARCH_X64 | 3167 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |