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 12 matching lines...) Loading... |
23 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 23 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
24 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 24 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
26 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | 26 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
27 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 27 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
28 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 28 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
31 // The original source code covered by the above license above has been | 31 // The original source code covered by the above license above has been |
32 // modified significantly by Google Inc. | 32 // modified significantly by Google Inc. |
33 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 33 // Copyright 2011 the V8 project authors. All rights reserved. |
34 | 34 |
35 // A light-weight IA32 Assembler. | 35 // A light-weight IA32 Assembler. |
36 | 36 |
37 #ifndef V8_IA32_ASSEMBLER_IA32_INL_H_ | 37 #ifndef V8_IA32_ASSEMBLER_IA32_INL_H_ |
38 #define V8_IA32_ASSEMBLER_IA32_INL_H_ | 38 #define V8_IA32_ASSEMBLER_IA32_INL_H_ |
39 | 39 |
40 #include "cpu.h" | 40 #include "cpu.h" |
41 #include "debug.h" | 41 #include "debug.h" |
42 | 42 |
43 namespace v8 { | 43 namespace v8 { |
(...skipping 260 matching lines...) Loading... |
304 if (obj->IsHeapObject()) { | 304 if (obj->IsHeapObject()) { |
305 emit(reinterpret_cast<intptr_t>(handle.location()), | 305 emit(reinterpret_cast<intptr_t>(handle.location()), |
306 RelocInfo::EMBEDDED_OBJECT); | 306 RelocInfo::EMBEDDED_OBJECT); |
307 } else { | 307 } else { |
308 // no relocation needed | 308 // no relocation needed |
309 emit(reinterpret_cast<intptr_t>(obj)); | 309 emit(reinterpret_cast<intptr_t>(obj)); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 | 313 |
314 void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) { | 314 void Assembler::emit(uint32_t x, RelocInfo::Mode rmode, unsigned id) { |
315 if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode); | 315 if (rmode == RelocInfo::CODE_TARGET && id != kNoASTId) { |
| 316 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, static_cast<intptr_t>(id)); |
| 317 } else if (rmode != RelocInfo::NONE) { |
| 318 RecordRelocInfo(rmode); |
| 319 } |
316 emit(x); | 320 emit(x); |
317 } | 321 } |
318 | 322 |
319 | 323 |
320 void Assembler::emit(const Immediate& x) { | 324 void Assembler::emit(const Immediate& x) { |
321 if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) { | 325 if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) { |
322 Label* label = reinterpret_cast<Label*>(x.x_); | 326 Label* label = reinterpret_cast<Label*>(x.x_); |
323 emit_code_relative_offset(label); | 327 emit_code_relative_offset(label); |
324 return; | 328 return; |
325 } | 329 } |
(...skipping 95 matching lines...) Loading... |
421 | 425 |
422 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 426 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
423 // [disp/r] | 427 // [disp/r] |
424 set_modrm(0, ebp); | 428 set_modrm(0, ebp); |
425 set_dispr(disp, rmode); | 429 set_dispr(disp, rmode); |
426 } | 430 } |
427 | 431 |
428 } } // namespace v8::internal | 432 } } // namespace v8::internal |
429 | 433 |
430 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 434 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |