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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 | 381 |
382 | 382 |
383 void Assembler::set_target_address_at(Address pc, Address target) { | 383 void Assembler::set_target_address_at(Address pc, Address target) { |
384 int32_t* p = reinterpret_cast<int32_t*>(pc); | 384 int32_t* p = reinterpret_cast<int32_t*>(pc); |
385 *p = target - (pc + sizeof(int32_t)); | 385 *p = target - (pc + sizeof(int32_t)); |
386 CPU::FlushICache(p, sizeof(int32_t)); | 386 CPU::FlushICache(p, sizeof(int32_t)); |
387 } | 387 } |
388 | 388 |
389 | 389 |
| 390 Address Assembler::target_address_from_return_address(Address pc) { |
| 391 return pc - kCallTargetAddressOffset; |
| 392 } |
| 393 |
| 394 |
390 Displacement Assembler::disp_at(Label* L) { | 395 Displacement Assembler::disp_at(Label* L) { |
391 return Displacement(long_at(L->pos())); | 396 return Displacement(long_at(L->pos())); |
392 } | 397 } |
393 | 398 |
394 | 399 |
395 void Assembler::disp_at_put(Label* L, Displacement disp) { | 400 void Assembler::disp_at_put(Label* L, Displacement disp) { |
396 long_at_put(L->pos(), disp.data()); | 401 long_at_put(L->pos(), disp.data()); |
397 } | 402 } |
398 | 403 |
399 | 404 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 466 |
462 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 467 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
463 // [disp/r] | 468 // [disp/r] |
464 set_modrm(0, ebp); | 469 set_modrm(0, ebp); |
465 set_dispr(disp, rmode); | 470 set_dispr(disp, rmode); |
466 } | 471 } |
467 | 472 |
468 } } // namespace v8::internal | 473 } } // namespace v8::internal |
469 | 474 |
470 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 475 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |