| Index: src/ppc/assembler-ppc.h
|
| diff --git a/src/ppc/assembler-ppc.h b/src/ppc/assembler-ppc.h
|
| index 5eebdbbd17b30ae4b915f4eeed436193ebc3d5e5..fa927458f1f539cf6a5c0a068d6f2a8e8a29c090 100644
|
| --- a/src/ppc/assembler-ppc.h
|
| +++ b/src/ppc/assembler-ppc.h
|
| @@ -309,6 +309,8 @@ class Operand BASE_EMBEDDED {
|
| // rm
|
| INLINE(explicit Operand(Register rm));
|
|
|
| + static Operand EmbeddedNumber(double value); // Smi or HeapNumber
|
| +
|
| // Return true if this is a register operand.
|
| INLINE(bool is_reg() const);
|
|
|
| @@ -316,14 +318,33 @@ class Operand BASE_EMBEDDED {
|
|
|
| inline intptr_t immediate() const {
|
| DCHECK(!rm_.is_valid());
|
| - return imm_;
|
| + DCHECK(!is_heap_number());
|
| + return value_.immediate;
|
| + }
|
| +
|
| + double heap_number() const {
|
| + DCHECK(is_heap_number());
|
| + return value_.heap_number;
|
| }
|
|
|
| Register rm() const { return rm_; }
|
|
|
| + bool is_heap_number() const {
|
| + DCHECK_IMPLIES(is_heap_number_, !rm_.is_valid());
|
| + DCHECK_IMPLIES(is_heap_number_, rmode_ == RelocInfo::EMBEDDED_OBJECT);
|
| + return is_heap_number_;
|
| + }
|
| +
|
| +
|
| private:
|
| Register rm_;
|
| - intptr_t imm_; // valid if rm_ == no_reg
|
| + int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg
|
| + union {
|
| + double heap_number; // if is_heap_number_
|
| + int32_t immediate; // otherwise
|
| + } value_; // valid if rm_ == no_reg
|
| + bool is_heap_number_ = false;
|
| +
|
| RelocInfo::Mode rmode_;
|
|
|
| friend class Assembler;
|
| @@ -405,7 +426,7 @@ class Assembler : public AssemblerBase {
|
| // GetCode emits any pending (non-emitted) code and fills the descriptor
|
| // desc. GetCode() is idempotent; it returns the same result if no other
|
| // Assembler functions are invoked in between GetCode() calls.
|
| - void GetCode(CodeDesc* desc);
|
| + void GetCode(Isolate* islate, CodeDesc* desc);
|
|
|
| // Label operations & relative jumps (PPUM Appendix D)
|
| //
|
| @@ -1288,6 +1309,16 @@ class Assembler : public AssemblerBase {
|
| void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position,
|
| int id);
|
|
|
| + // Patch the dummy heap number that we emitted during code assembly in the
|
| + // constant pool entry referenced by {pc}. Replace it with the actual heap
|
| + // object (handle).
|
| + static void set_heap_number(Handle<HeapObject> number, Address pc) {
|
| + Memory::Address_at(
|
| + target_constant_pool_address_at(pc, 0, ConstantPoolEntry::REGULAR,
|
| + ConstantPoolEntry::INTPTR /* unused */)) =
|
| + reinterpret_cast<Address>(number.location());
|
| + }
|
| +
|
| // Writes a single byte or word of data in the code stream. Used
|
| // for inline tables, e.g., jump-tables.
|
| void db(uint8_t data);
|
|
|