| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 | 59 |
| 60 void Assembler::emitw(uint16_t x) { | 60 void Assembler::emitw(uint16_t x) { |
| 61 Memory::uint16_at(pc_) = x; | 61 Memory::uint16_at(pc_) = x; |
| 62 pc_ += sizeof(uint16_t); | 62 pc_ += sizeof(uint16_t); |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 void Assembler::emit_code_target(Handle<Code> target, | 66 void Assembler::emit_code_target(Handle<Code> target, |
| 67 RelocInfo::Mode rmode, | 67 RelocInfo::Mode rmode, |
| 68 unsigned ast_id) { | 68 TypeFeedbackId ast_id) { |
| 69 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 69 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
| 70 if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) { | 70 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { |
| 71 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id); | 71 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id.ToInt()); |
| 72 } else { | 72 } else { |
| 73 RecordRelocInfo(rmode); | 73 RecordRelocInfo(rmode); |
| 74 } | 74 } |
| 75 int current = code_targets_.length(); | 75 int current = code_targets_.length(); |
| 76 if (current > 0 && code_targets_.last().is_identical_to(target)) { | 76 if (current > 0 && code_targets_.last().is_identical_to(target)) { |
| 77 // Optimization if we keep jumping to the same code target. | 77 // Optimization if we keep jumping to the same code target. |
| 78 emitl(current - 1); | 78 emitl(current - 1); |
| 79 } else { | 79 } else { |
| 80 code_targets_.Add(target); | 80 code_targets_.Add(target); |
| 81 emitl(current); | 81 emitl(current); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 ASSERT(len_ == 1 || len_ == 2); | 478 ASSERT(len_ == 1 || len_ == 2); |
| 479 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 479 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
| 480 *p = disp; | 480 *p = disp; |
| 481 len_ += sizeof(int32_t); | 481 len_ += sizeof(int32_t); |
| 482 } | 482 } |
| 483 | 483 |
| 484 | 484 |
| 485 } } // namespace v8::internal | 485 } } // namespace v8::internal |
| 486 | 486 |
| 487 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 487 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
| OLD | NEW |