 Chromium Code Reviews
 Chromium Code Reviews Issue 6893156:
  Unified CallWrapper and PostCallGenerator classes, the former is a  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
    
  
    Issue 6893156:
  Unified CallWrapper and PostCallGenerator classes, the former is a  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/| 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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1573 void Assembler::call(byte* entry, RelocInfo::Mode rmode) { | 1573 void Assembler::call(byte* entry, RelocInfo::Mode rmode) { | 
| 1574 positions_recorder()->WriteRecordedPositions(); | 1574 positions_recorder()->WriteRecordedPositions(); | 
| 1575 EnsureSpace ensure_space(this); | 1575 EnsureSpace ensure_space(this); | 
| 1576 last_pc_ = pc_; | 1576 last_pc_ = pc_; | 
| 1577 ASSERT(!RelocInfo::IsCodeTarget(rmode)); | 1577 ASSERT(!RelocInfo::IsCodeTarget(rmode)); | 
| 1578 EMIT(0xE8); | 1578 EMIT(0xE8); | 
| 1579 emit(entry - (pc_ + sizeof(int32_t)), rmode); | 1579 emit(entry - (pc_ + sizeof(int32_t)), rmode); | 
| 1580 } | 1580 } | 
| 1581 | 1581 | 
| 1582 | 1582 | 
| 1583 int Assembler::CallSize(const Operand& adr) { | |
| 1584 return 1 /* EMIT */ + adr.len_ /* emit_operand */; | |
| 
Kevin Millikin (Chromium)
2011/05/03 08:43:19
I find the inline comments distracting here.  I'd
 
Sven Panne
2011/05/03 09:09:54
Done.
 | |
| 1585 } | |
| 1586 | |
| 1587 | |
| 1583 void Assembler::call(const Operand& adr) { | 1588 void Assembler::call(const Operand& adr) { | 
| 1584 positions_recorder()->WriteRecordedPositions(); | 1589 positions_recorder()->WriteRecordedPositions(); | 
| 1585 EnsureSpace ensure_space(this); | 1590 EnsureSpace ensure_space(this); | 
| 1586 last_pc_ = pc_; | 1591 last_pc_ = pc_; | 
| 1587 EMIT(0xFF); | 1592 EMIT(0xFF); | 
| 1588 emit_operand(edx, adr); | 1593 emit_operand(edx, adr); | 
| 
Kevin Millikin (Chromium)
2011/05/03 08:43:19
You could ASSERT(pc_ - last_pc_ == CallSize(adr)),
 
Sven Panne
2011/05/03 09:09:54
Good idea, CallSize is a bit fragile.
 | |
| 1589 } | 1594 } | 
| 1590 | 1595 | 
| 1591 | 1596 | 
| 1597 int Assembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) { | |
| 1598 return 1 /* EMIT */ + sizeof(uint32_t) /* emit */; | |
| 1599 } | |
| 1600 | |
| 1601 | |
| 1592 void Assembler::call(Handle<Code> code, | 1602 void Assembler::call(Handle<Code> code, | 
| 1593 RelocInfo::Mode rmode, | 1603 RelocInfo::Mode rmode, | 
| 1594 unsigned ast_id) { | 1604 unsigned ast_id) { | 
| 1595 positions_recorder()->WriteRecordedPositions(); | 1605 positions_recorder()->WriteRecordedPositions(); | 
| 1596 EnsureSpace ensure_space(this); | 1606 EnsureSpace ensure_space(this); | 
| 1597 last_pc_ = pc_; | 1607 last_pc_ = pc_; | 
| 1598 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 1608 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 
| 1599 EMIT(0xE8); | 1609 EMIT(0xE8); | 
| 1600 emit(reinterpret_cast<intptr_t>(code.location()), rmode, ast_id); | 1610 emit(reinterpret_cast<intptr_t>(code.location()), rmode, ast_id); | 
| 1601 } | 1611 } | 
| (...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2839 fprintf(coverage_log, "%s\n", file_line); | 2849 fprintf(coverage_log, "%s\n", file_line); | 
| 2840 fflush(coverage_log); | 2850 fflush(coverage_log); | 
| 2841 } | 2851 } | 
| 2842 } | 2852 } | 
| 2843 | 2853 | 
| 2844 #endif | 2854 #endif | 
| 2845 | 2855 | 
| 2846 } } // namespace v8::internal | 2856 } } // namespace v8::internal | 
| 2847 | 2857 | 
| 2848 #endif // V8_TARGET_ARCH_IA32 | 2858 #endif // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |