OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // Clear the buffer in debug mode. Use 'int3' instructions to make | 478 // Clear the buffer in debug mode. Use 'int3' instructions to make |
479 // sure to get into problems if we ever run uninitialized code. | 479 // sure to get into problems if we ever run uninitialized code. |
480 #ifdef DEBUG | 480 #ifdef DEBUG |
481 memset(desc.buffer, 0xCC, desc.buffer_size); | 481 memset(desc.buffer, 0xCC, desc.buffer_size); |
482 #endif | 482 #endif |
483 | 483 |
484 // Copy the data. | 484 // Copy the data. |
485 intptr_t pc_delta = desc.buffer - buffer_; | 485 intptr_t pc_delta = desc.buffer - buffer_; |
486 intptr_t rc_delta = (desc.buffer + desc.buffer_size) - | 486 intptr_t rc_delta = (desc.buffer + desc.buffer_size) - |
487 (buffer_ + buffer_size_); | 487 (buffer_ + buffer_size_); |
488 memmove(desc.buffer, buffer_, desc.instr_size); | 488 OS::MemMove(desc.buffer, buffer_, desc.instr_size); |
489 memmove(rc_delta + reloc_info_writer.pos(), | 489 OS::MemMove(rc_delta + reloc_info_writer.pos(), |
490 reloc_info_writer.pos(), desc.reloc_size); | 490 reloc_info_writer.pos(), desc.reloc_size); |
491 | 491 |
492 // Switch buffers. | 492 // Switch buffers. |
493 if (isolate() != NULL && | 493 if (isolate() != NULL && |
494 isolate()->assembler_spare_buffer() == NULL && | 494 isolate()->assembler_spare_buffer() == NULL && |
495 buffer_size_ == kMinimalBufferSize) { | 495 buffer_size_ == kMinimalBufferSize) { |
496 isolate()->set_assembler_spare_buffer(buffer_); | 496 isolate()->set_assembler_spare_buffer(buffer_); |
497 } else { | 497 } else { |
498 DeleteArray(buffer_); | 498 DeleteArray(buffer_); |
499 } | 499 } |
500 buffer_ = desc.buffer; | 500 buffer_ = desc.buffer; |
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3085 bool RelocInfo::IsCodedSpecially() { | 3085 bool RelocInfo::IsCodedSpecially() { |
3086 // The deserializer needs to know whether a pointer is specially coded. Being | 3086 // The deserializer needs to know whether a pointer is specially coded. Being |
3087 // specially coded on x64 means that it is a relative 32 bit address, as used | 3087 // specially coded on x64 means that it is a relative 32 bit address, as used |
3088 // by branch instructions. | 3088 // by branch instructions. |
3089 return (1 << rmode_) & kApplyMask; | 3089 return (1 << rmode_) & kApplyMask; |
3090 } | 3090 } |
3091 | 3091 |
3092 } } // namespace v8::internal | 3092 } } // namespace v8::internal |
3093 | 3093 |
3094 #endif // V8_TARGET_ARCH_X64 | 3094 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |