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

Unified Diff: src/arm64/assembler-arm64.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 | « src/arm/codegen-arm.cc ('k') | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/assembler-arm64.h
diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h
index 18d41152493864c093087de98601352b90335847..e1bf448c77f0ccd0bb80f714b1762793b57d6ee8 100644
--- a/src/arm64/assembler-arm64.h
+++ b/src/arm64/assembler-arm64.h
@@ -550,6 +550,20 @@ class Operand {
Extend extend,
unsigned shift_amount = 0);
+ static Operand EmbeddedNumber(double value); // Smi or HeapNumber.
+
+ bool is_heap_number() const {
+ DCHECK_IMPLIES(is_heap_number_, reg_.Is(NoReg));
+ DCHECK_IMPLIES(is_heap_number_,
+ immediate_.rmode() == RelocInfo::EMBEDDED_OBJECT);
+ return is_heap_number_;
+ }
+
+ double heap_number() const {
+ DCHECK(is_heap_number());
+ return bit_cast<double>(immediate_.value());
+ }
+
template<typename T>
inline explicit Operand(Handle<T> handle);
@@ -590,6 +604,7 @@ class Operand {
Shift shift_;
Extend extend_;
unsigned shift_amount_;
+ bool is_heap_number_ = false;
};
@@ -740,7 +755,7 @@ class Assembler : public AssemblerBase {
//
// The descriptor (desc) can be NULL. In that case, the code is finalized as
// usual, but the descriptor is not populated.
- void GetCode(CodeDesc* desc);
+ void GetCode(Isolate* isolate, CodeDesc* desc);
// Insert the smallest number of nop instructions
// possible to align the pc offset to a multiple
@@ -924,6 +939,10 @@ 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);
// Instruction set functions ------------------------------------------------
@@ -1360,6 +1379,7 @@ class Assembler : public AssemblerBase {
// Load literal to register.
void ldr(const CPURegister& rt, const Immediate& imm);
+ void ldr(const CPURegister& rt, const Operand& operand);
// Load-acquire word.
void ldar(const Register& rt, const Register& rn);
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698