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