| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 | 343 |
| 344 void Assembler::Align(int m) { | 344 void Assembler::Align(int m) { |
| 345 DCHECK(base::bits::IsPowerOfTwo32(m)); | 345 DCHECK(base::bits::IsPowerOfTwo32(m)); |
| 346 int mask = m - 1; | 346 int mask = m - 1; |
| 347 int addr = pc_offset(); | 347 int addr = pc_offset(); |
| 348 Nop((m - (addr & mask)) & mask); | 348 Nop((m - (addr & mask)) & mask); |
| 349 } | 349 } |
| 350 | 350 |
| 351 | 351 |
| 352 void Assembler::DataAlign(int m) { |
| 353 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
| 354 while ((pc_offset() & (m - 1)) != 0) { |
| 355 db(0); |
| 356 } |
| 357 } |
| 358 |
| 359 |
| 352 bool Assembler::IsNop(Address addr) { | 360 bool Assembler::IsNop(Address addr) { |
| 353 Address a = addr; | 361 Address a = addr; |
| 354 while (*a == 0x66) a++; | 362 while (*a == 0x66) a++; |
| 355 if (*a == 0x90) return true; | 363 if (*a == 0x90) return true; |
| 356 if (a[0] == 0xf && a[1] == 0x1f) return true; | 364 if (a[0] == 0xf && a[1] == 0x1f) return true; |
| 357 return false; | 365 return false; |
| 358 } | 366 } |
| 359 | 367 |
| 360 | 368 |
| 361 void Assembler::Nop(int bytes) { | 369 void Assembler::Nop(int bytes) { |
| (...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2968 fflush(coverage_log); | 2976 fflush(coverage_log); |
| 2969 } | 2977 } |
| 2970 } | 2978 } |
| 2971 | 2979 |
| 2972 #endif | 2980 #endif |
| 2973 | 2981 |
| 2974 } // namespace internal | 2982 } // namespace internal |
| 2975 } // namespace v8 | 2983 } // namespace v8 |
| 2976 | 2984 |
| 2977 #endif // V8_TARGET_ARCH_IA32 | 2985 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |