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

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

Issue 2921473003: PPC/S390: [compiler] Delay allocation of code-embedded heap numbers.
Patch Set: additional changes for s390 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/regexp/s390/regexp-macro-assembler-s390.cc ('k') | src/s390/assembler-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/assembler-s390.h
diff --git a/src/s390/assembler-s390.h b/src/s390/assembler-s390.h
index bee7452aaa9a4e2b65435d83f8d2db6626adbf9a..10d44a43fc112be0281c6325bb2a1e971e291a52 100644
--- a/src/s390/assembler-s390.h
+++ b/src/s390/assembler-s390.h
@@ -303,6 +303,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);
@@ -310,18 +312,37 @@ 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;
}
inline void setBits(int n) {
- imm_ = (static_cast<uint32_t>(imm_) << (32 - n)) >> (32 - n);
+ value_.immediate = (static_cast<uint32_t>(value_.immediate)
+ << (32 - n)) >> (32 - n);
}
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* isolate, CodeDesc* desc);
// Label operations & relative jumps (PPUM Appendix D)
//
@@ -1288,6 +1309,12 @@ class Assembler : public AssemblerBase {
// Use --trace-deopt to enable.
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::Object_Handle_at(pc) = number;
+ }
// Writes a single byte or word of data in the code stream. Used
// for inline tables, e.g., jump-tables.
« no previous file with comments | « src/regexp/s390/regexp-macro-assembler-s390.cc ('k') | src/s390/assembler-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698