Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/arm/assembler-arm.h

Issue 2900683002: [compiler] Delay allocation of code-embedded heap numbers. (Closed)
Patch Set: Fix rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm/assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/assembler-arm.h
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
index b9f022a5ab7aec40e2017e85fddcebb78d6377f1..ac51f5a5cdcdcb489aef8120fb8222599f089b18 100644
--- a/src/arm/assembler-arm.h
+++ b/src/arm/assembler-arm.h
@@ -524,6 +524,8 @@ class Operand BASE_EMBEDDED {
// rm <shift_op> rs
explicit Operand(Register rm, ShiftOp shift_op, Register rs);
+ static Operand EmbeddedNumber(double value); // Smi or HeapNumber
+
// Return true if this is a register operand.
INLINE(bool is_reg() const) {
return rm_.is_valid() &&
@@ -548,19 +550,35 @@ class Operand BASE_EMBEDDED {
inline int32_t immediate() const {
DCHECK(!rm_.is_valid());
- return imm32_;
+ DCHECK(!is_heap_number());
+ return value_.immediate;
+ }
+
+ double heap_number() const {
+ DCHECK(is_heap_number());
+ return value_.heap_number;
}
Register rm() const { return rm_; }
Register rs() const { return rs_; }
ShiftOp shift_op() const { return shift_op_; }
+ 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_;
Register rs_;
ShiftOp shift_op_;
- int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg
- int32_t imm32_; // 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;
@@ -703,7 +721,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* isolate, CodeDesc* desc);
// Label operations & relative jumps (PPUM Appendix D)
//
@@ -1538,6 +1556,14 @@ class Assembler : public AssemblerBase {
// the marker and branch over the data.
void RecordConstPool(int size);
+ // 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(constant_pool_entry_address(pc, 0 /* 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. CheckConstantPool() should be
// called before any use of db/dd/dq/dp to ensure that constant pools
« no previous file with comments | « no previous file | src/arm/assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698