Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: src/ia32/assembler-ia32-inl.h

Issue 1232803002: Debugger: refactor reloc info. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix mips Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 593
594 594
595 Operand::Operand(Immediate imm) { 595 Operand::Operand(Immediate imm) {
596 // [disp/r] 596 // [disp/r]
597 set_modrm(0, ebp); 597 set_modrm(0, ebp);
598 set_dispr(imm.x_, imm.rmode_); 598 set_dispr(imm.x_, imm.rmode_);
599 } 599 }
600 } } // namespace v8::internal 600 } } // namespace v8::internal
601 601
602 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ 602 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698