| 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 | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // ----------------------------------------------------------------------------- | 156 // ----------------------------------------------------------------------------- |
| 157 // Implementation of RelocInfo | 157 // Implementation of RelocInfo |
| 158 | 158 |
| 159 | 159 |
| 160 const int RelocInfo::kApplyMask = | 160 const int RelocInfo::kApplyMask = |
| 161 RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY | | 161 RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY | |
| 162 1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE; | 162 1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE; |
| 163 | 163 |
| 164 | 164 |
| 165 bool RelocInfo::IsCodedSpecially() { |
| 166 // The deserializer needs to know whether a pointer is specially coded. Being |
| 167 // specially coded on IA32 means that it is a relative address, as used by |
| 168 // branch instructions. These are also the ones that need changing when a |
| 169 // code object moves. |
| 170 return (1 << rmode_) & kApplyMask; |
| 171 } |
| 172 |
| 173 |
| 165 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { | 174 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { |
| 166 // Patch the code at the current address with the supplied instructions. | 175 // Patch the code at the current address with the supplied instructions. |
| 167 for (int i = 0; i < instruction_count; i++) { | 176 for (int i = 0; i < instruction_count; i++) { |
| 168 *(pc_ + i) = *(instructions + i); | 177 *(pc_ + i) = *(instructions + i); |
| 169 } | 178 } |
| 170 | 179 |
| 171 // Indicate that code has changed. | 180 // Indicate that code has changed. |
| 172 CPU::FlushICache(pc_, instruction_count); | 181 CPU::FlushICache(pc_, instruction_count); |
| 173 } | 182 } |
| 174 | 183 |
| (...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 fprintf(coverage_log, "%s\n", file_line); | 2541 fprintf(coverage_log, "%s\n", file_line); |
| 2533 fflush(coverage_log); | 2542 fflush(coverage_log); |
| 2534 } | 2543 } |
| 2535 } | 2544 } |
| 2536 | 2545 |
| 2537 #endif | 2546 #endif |
| 2538 | 2547 |
| 2539 } } // namespace v8::internal | 2548 } } // namespace v8::internal |
| 2540 | 2549 |
| 2541 #endif // V8_TARGET_ARCH_IA32 | 2550 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |