OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 static const int kNoCodeAgeSequenceLength = 5; | 52 static const int kNoCodeAgeSequenceLength = 5; |
53 | 53 |
54 | 54 |
55 // The modes possibly affected by apply must be in kApplyMask. | 55 // The modes possibly affected by apply must be in kApplyMask. |
56 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { | 56 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { |
57 bool flush_icache = icache_flush_mode != SKIP_ICACHE_FLUSH; | 57 bool flush_icache = icache_flush_mode != SKIP_ICACHE_FLUSH; |
58 if (IsRuntimeEntry(rmode_) || IsCodeTarget(rmode_)) { | 58 if (IsRuntimeEntry(rmode_) || IsCodeTarget(rmode_)) { |
59 int32_t* p = reinterpret_cast<int32_t*>(pc_); | 59 int32_t* p = reinterpret_cast<int32_t*>(pc_); |
60 *p -= delta; // Relocate entry. | 60 *p -= delta; // Relocate entry. |
61 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); | 61 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); |
62 } else if (rmode_ == CODE_AGE_SEQUENCE) { | 62 } else if (IsCodeAgeSequence(rmode_)) { |
63 if (*pc_ == kCallOpcode) { | 63 if (*pc_ == kCallOpcode) { |
64 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); | 64 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); |
65 *p -= delta; // Relocate entry. | 65 *p -= delta; // Relocate entry. |
66 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); | 66 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); |
67 } | 67 } |
68 } else if (rmode_ == JS_RETURN && IsPatchedReturnSequence()) { | 68 } else if (IsJSReturn(rmode_) && IsPatchedReturnSequence()) { |
69 // Special handling of js_return when a break point is set (call | 69 // Special handling of js_return when a break point is set (call |
70 // instruction has been inserted). | 70 // instruction has been inserted). |
71 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); | 71 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); |
72 *p -= delta; // Relocate entry. | 72 *p -= delta; // Relocate entry. |
73 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); | 73 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); |
74 } else if (rmode_ == DEBUG_BREAK_SLOT && IsPatchedDebugBreakSlotSequence()) { | 74 } else if (IsDebugBreakSlot(rmode_) && IsPatchedDebugBreakSlotSequence()) { |
75 // Special handling of a debug break slot when a break point is set (call | 75 // Special handling of a debug break slot when a break point is set (call |
76 // instruction has been inserted). | 76 // instruction has been inserted). |
77 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); | 77 int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); |
78 *p -= delta; // Relocate entry. | 78 *p -= delta; // Relocate entry. |
79 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); | 79 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); |
80 } else if (IsInternalReference(rmode_)) { | 80 } else if (IsInternalReference(rmode_)) { |
81 // absolute code pointer inside code object moves with the code object. | 81 // absolute code pointer inside code object moves with the code object. |
82 int32_t* p = reinterpret_cast<int32_t*>(pc_); | 82 int32_t* p = reinterpret_cast<int32_t*>(pc_); |
83 *p += delta; // Relocate entry. | 83 *p += delta; // Relocate entry. |
84 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); | 84 if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 | 589 |
590 Operand::Operand(Immediate imm) { | 590 Operand::Operand(Immediate imm) { |
591 // [disp/r] | 591 // [disp/r] |
592 set_modrm(0, ebp); | 592 set_modrm(0, ebp); |
593 set_dispr(imm.x_, imm.rmode_); | 593 set_dispr(imm.x_, imm.rmode_); |
594 } | 594 } |
595 } } // namespace v8::internal | 595 } } // namespace v8::internal |
596 | 596 |
597 #endif // V8_X87_ASSEMBLER_X87_INL_H_ | 597 #endif // V8_X87_ASSEMBLER_X87_INL_H_ |
OLD | NEW |