Index: src/assembler.h |
diff --git a/src/assembler.h b/src/assembler.h |
index 3670d7fa5c5ca24026b22a235b02b2e7acb7243a..fc4721072f1195f70ce318b861a55b40eccb5abc 100644 |
--- a/src/assembler.h |
+++ b/src/assembler.h |
@@ -421,7 +421,8 @@ class RelocInfo { |
// This is not an actual reloc mode, but used to encode a long pc jump that |
// cannot be encoded as part of another record. |
PC_JUMP, |
- |
+ WASM_DIRECT_CALL, |
+ WASM_IMPORT_CALL, |
// Pseudo-types |
NUMBER_OF_MODES, |
NONE32, // never recorded 32-bit value |
@@ -529,6 +530,9 @@ class RelocInfo { |
static inline bool IsWasmMemorySizeReference(Mode mode) { |
return mode == WASM_MEMORY_SIZE_REFERENCE; |
} |
+ static inline bool IsWasmCall(Mode mode) { |
+ return mode == WASM_DIRECT_CALL || mode == WASM_IMPORT_CALL; |
+ } |
static inline int ModeMask(Mode mode) { return 1 << mode; } |
// Accessors |
@@ -557,6 +561,8 @@ class RelocInfo { |
Address wasm_memory_reference(); |
uint32_t wasm_memory_size_reference(); |
+ uint32_t wasm_function_index(); |
+ |
void update_wasm_memory_reference( |
Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH); |
@@ -665,6 +671,8 @@ class RelocInfo { |
#endif |
static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; |
+ static const int kWasmDirectCallMask = 1 << WASM_DIRECT_CALL; |
+ static const int kWasmImportCallMask = 1 << WASM_IMPORT_CALL; |
static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; |
static const int kDataMask = |
(1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
@@ -731,6 +739,10 @@ class RelocInfoWriter BASE_EMBEDDED { |
// Here we use the maximum of the two. |
static const int kMaxSize = 15; |
+ // Update the mode. This should be used carefully, the new mode should have |
+ // the same schema as the old one. |
+ void WriteModeNoAdvance(RelocInfo::Mode rmode); |
+ |
private: |
inline uint32_t WriteLongPCJump(uint32_t pc_delta); |
@@ -785,6 +797,8 @@ class RelocIterator: public Malloced { |
return &rinfo_; |
} |
+ byte* mode_pos() const { return mode_pos_; } |
+ |
private: |
// Advance* moves the position before/after reading. |
// *Read* reads from current byte(s) into rinfo_. |
@@ -814,6 +828,7 @@ class RelocIterator: public Malloced { |
} |
byte* pos_; |
+ byte* mode_pos_; |
byte* end_; |
byte* code_age_sequence_; |
RelocInfo rinfo_; |