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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } else { | 359 } else { |
360 // no relocation needed | 360 // no relocation needed |
361 emit(reinterpret_cast<intptr_t>(obj)); | 361 emit(reinterpret_cast<intptr_t>(obj)); |
362 } | 362 } |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 void Assembler::emit(uint32_t x, RelocInfo::Mode rmode, TypeFeedbackId id) { | 366 void Assembler::emit(uint32_t x, RelocInfo::Mode rmode, TypeFeedbackId id) { |
367 if (rmode == RelocInfo::CODE_TARGET && !id.IsNone()) { | 367 if (rmode == RelocInfo::CODE_TARGET && !id.IsNone()) { |
368 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, id.ToInt()); | 368 RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, id.ToInt()); |
369 } else if (rmode != RelocInfo::NONE) { | 369 } else if (!RelocInfo::IsNone(rmode)) { |
370 RecordRelocInfo(rmode); | 370 RecordRelocInfo(rmode); |
371 } | 371 } |
372 emit(x); | 372 emit(x); |
373 } | 373 } |
374 | 374 |
375 | 375 |
376 void Assembler::emit(const Immediate& x) { | 376 void Assembler::emit(const Immediate& x) { |
377 if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) { | 377 if (x.rmode_ == RelocInfo::INTERNAL_REFERENCE) { |
378 Label* label = reinterpret_cast<Label*>(x.x_); | 378 Label* label = reinterpret_cast<Label*>(x.x_); |
379 emit_code_relative_offset(label); | 379 emit_code_relative_offset(label); |
380 return; | 380 return; |
381 } | 381 } |
382 if (x.rmode_ != RelocInfo::NONE) RecordRelocInfo(x.rmode_); | 382 if (!RelocInfo::IsNone(x.rmode_)) RecordRelocInfo(x.rmode_); |
383 emit(x.x_); | 383 emit(x.x_); |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 void Assembler::emit_code_relative_offset(Label* label) { | 387 void Assembler::emit_code_relative_offset(Label* label) { |
388 if (label->is_bound()) { | 388 if (label->is_bound()) { |
389 int32_t pos; | 389 int32_t pos; |
390 pos = label->pos() + Code::kHeaderSize - kHeapObjectTag; | 390 pos = label->pos() + Code::kHeaderSize - kHeapObjectTag; |
391 emit(pos); | 391 emit(pos); |
392 } else { | 392 } else { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 495 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
496 // [disp/r] | 496 // [disp/r] |
497 set_modrm(0, ebp); | 497 set_modrm(0, ebp); |
498 set_dispr(disp, rmode); | 498 set_dispr(disp, rmode); |
499 } | 499 } |
500 | 500 |
501 } } // namespace v8::internal | 501 } } // namespace v8::internal |
502 | 502 |
503 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 503 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
OLD | NEW |