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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 pc_ += sizeof(uint64_t); | 54 pc_ += sizeof(uint64_t); |
55 } | 55 } |
56 | 56 |
57 | 57 |
58 void Assembler::emitw(uint16_t x) { | 58 void Assembler::emitw(uint16_t x) { |
59 Memory::uint16_at(pc_) = x; | 59 Memory::uint16_at(pc_) = x; |
60 pc_ += sizeof(uint16_t); | 60 pc_ += sizeof(uint16_t); |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 void Assembler::emit_code_target(Handle<Code> target, | 64 void Assembler::emit_code_target(Handle<Code> target, RelocInfo::Mode rmode) { |
65 RelocInfo::Mode rmode, | |
66 unsigned ast_id) { | |
67 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 65 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
68 if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) { | 66 RecordRelocInfo(rmode); |
69 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id); | |
70 } else { | |
71 RecordRelocInfo(rmode); | |
72 } | |
73 int current = code_targets_.length(); | 67 int current = code_targets_.length(); |
74 if (current > 0 && code_targets_.last().is_identical_to(target)) { | 68 if (current > 0 && code_targets_.last().is_identical_to(target)) { |
75 // Optimization if we keep jumping to the same code target. | 69 // Optimization if we keep jumping to the same code target. |
76 emitl(current - 1); | 70 emitl(current - 1); |
77 } else { | 71 } else { |
78 code_targets_.Add(target); | 72 code_targets_.Add(target); |
79 emitl(current); | 73 emitl(current); |
80 } | 74 } |
81 } | 75 } |
82 | 76 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ASSERT(len_ == 1 || len_ == 2); | 447 ASSERT(len_ == 1 || len_ == 2); |
454 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 448 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
455 *p = disp; | 449 *p = disp; |
456 len_ += sizeof(int32_t); | 450 len_ += sizeof(int32_t); |
457 } | 451 } |
458 | 452 |
459 | 453 |
460 } } // namespace v8::internal | 454 } } // namespace v8::internal |
461 | 455 |
462 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 456 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |