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

Unified Diff: src/assembler.h

Issue 2039233005: Consider reloc info mode when merging constant pool entries Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
Index: src/assembler.h
diff --git a/src/assembler.h b/src/assembler.h
index 3670d7fa5c5ca24026b22a235b02b2e7acb7243a..12484101777b31ed0364df38f75fa89ae0e37911 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -426,6 +426,7 @@ class RelocInfo {
NUMBER_OF_MODES,
NONE32, // never recorded 32-bit value
NONE64, // never recorded 64-bit value
+ NONEINTPTR, // never recorded intptr value
bradnelson 2016/06/08 00:58:32 Maybe highlight in the commit message that you're
Mircea Trofin 2016/06/08 03:32:16 Done.
CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by
// code aging.
@@ -515,7 +516,7 @@ class RelocInfo {
return mode == DEBUGGER_STATEMENT;
}
static inline bool IsNone(Mode mode) {
- return mode == NONE32 || mode == NONE64;
+ return mode == NONE32 || mode == NONE64 || mode == NONEINTPTR;
}
static inline bool IsCodeAgeSequence(Mode mode) {
return mode == CODE_AGE_SEQUENCE;
@@ -1229,12 +1230,17 @@ class CheckDebugStepCallWrapper : public CallWrapper {
class ConstantPoolEntry {
public:
ConstantPoolEntry() {}
- ConstantPoolEntry(int position, intptr_t value, bool sharing_ok)
+ ConstantPoolEntry(int position, intptr_t value, bool sharing_ok,
+ RelocInfo::Mode rmode)
: position_(position),
merged_index_(sharing_ok ? SHARING_ALLOWED : SHARING_PROHIBITED),
+ rmode_(rmode),
value_(value) {}
ConstantPoolEntry(int position, double value)
- : position_(position), merged_index_(SHARING_ALLOWED), value64_(value) {}
+ : position_(position),
+ merged_index_(SHARING_ALLOWED),
+ rmode_(RelocInfo::NONE64),
+ value64_(value) {}
int position() const { return position_; }
bool sharing_ok() const { return merged_index_ != SHARING_PROHIBITED; }
@@ -1257,6 +1263,9 @@ class ConstantPoolEntry {
}
intptr_t value() const { return value_; }
uint64_t value64() const { return bit_cast<uint64_t>(value64_); }
+ bool IntValueMayBeMergedWith(ConstantPoolEntry& other) const {
+ return rmode_ == other.rmode_ && value() == other.value();
bradnelson 2016/06/08 00:58:32 Why not have this handle checking both the 32/64 c
Mircea Trofin 2016/06/08 03:32:16 See my previous comment about the scope of this ch
+ }
enum Type { INTPTR, DOUBLE, NUMBER_OF_TYPES };
@@ -1269,6 +1278,7 @@ class ConstantPoolEntry {
private:
int position_;
int merged_index_;
+ RelocInfo::Mode rmode_;
union {
intptr_t value_;
double value64_;
@@ -1285,9 +1295,10 @@ class ConstantPoolBuilder BASE_EMBEDDED {
ConstantPoolBuilder(int ptr_reach_bits, int double_reach_bits);
// Add pointer-sized constant to the embedded constant pool
- ConstantPoolEntry::Access AddEntry(int position, intptr_t value,
- bool sharing_ok) {
- ConstantPoolEntry entry(position, value, sharing_ok);
+ ConstantPoolEntry::Access AddEntry(
+ int position, intptr_t value, bool sharing_ok,
+ RelocInfo::Mode rmode = RelocInfo::NONEINTPTR) {
+ ConstantPoolEntry entry(position, value, sharing_ok, rmode);
return AddEntry(entry, ConstantPoolEntry::INTPTR);
}
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/assembler.cc » ('j') | src/assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698