Commit e677d54a authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Use inline field inits

R=clemensh@chromium.org

Change-Id: Ib1a0105e3347a5ccafdb72dadd9aa144ab77732c
Reviewed-on: https://chromium-review.googlesource.com/1046970Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53035}
parent 386caa2e
...@@ -677,10 +677,10 @@ class LiftoffStackSlots { ...@@ -677,10 +677,10 @@ class LiftoffStackSlots {
RegPairHalf half) RegPairHalf half)
: src_(src), src_index_(src_index), half_(half) {} : src_(src), src_index_(src_index), half_(half) {}
explicit Slot(const LiftoffAssembler::VarState& src) explicit Slot(const LiftoffAssembler::VarState& src)
: src_(src), src_index_(0), half_(kLowWord) {} : src_(src), half_(kLowWord) {}
const LiftoffAssembler::VarState src_; const LiftoffAssembler::VarState src_;
uint32_t src_index_; uint32_t src_index_ = 0;
RegPairHalf half_; RegPairHalf half_;
}; };
......
...@@ -370,14 +370,13 @@ class BranchTableIterator { ...@@ -370,14 +370,13 @@ class BranchTableIterator {
: decoder_(decoder), : decoder_(decoder),
start_(imm.start), start_(imm.start),
pc_(imm.table), pc_(imm.table),
index_(0),
table_count_(imm.table_count) {} table_count_(imm.table_count) {}
private: private:
Decoder* decoder_; Decoder* decoder_;
const byte* start_; const byte* start_;
const byte* pc_; const byte* pc_;
uint32_t index_; // the current index. uint32_t index_ = 0; // the current index.
uint32_t table_count_; // the count of entries, not including default. uint32_t table_count_; // the count of entries, not including default.
}; };
......
...@@ -71,9 +71,9 @@ class WasmGraphBuildingInterface { ...@@ -71,9 +71,9 @@ class WasmGraphBuildingInterface {
struct TryInfo : public ZoneObject { struct TryInfo : public ZoneObject {
SsaEnv* catch_env; SsaEnv* catch_env;
TFNode* exception; TFNode* exception = nullptr;
explicit TryInfo(SsaEnv* c) : catch_env(c), exception(nullptr) {} explicit TryInfo(SsaEnv* c) : catch_env(c) {}
}; };
struct Control : public ControlWithNamedConstructors<Control, Value> { struct Control : public ControlWithNamedConstructors<Control, Value> {
......
...@@ -77,11 +77,11 @@ inline DecodeResult BuildTFGraph(AccountingAllocator* allocator, ...@@ -77,11 +77,11 @@ inline DecodeResult BuildTFGraph(AccountingAllocator* allocator,
struct BodyLocalDecls { struct BodyLocalDecls {
// The size of the encoded declarations. // The size of the encoded declarations.
uint32_t encoded_size; // size of encoded declarations uint32_t encoded_size = 0; // size of encoded declarations
ZoneVector<ValueType> type_list; ZoneVector<ValueType> type_list;
explicit BodyLocalDecls(Zone* zone) : encoded_size(0), type_list(zone) {} explicit BodyLocalDecls(Zone* zone) : type_list(zone) {}
}; };
V8_EXPORT_PRIVATE bool DecodeLocalDecls(BodyLocalDecls* decls, V8_EXPORT_PRIVATE bool DecodeLocalDecls(BodyLocalDecls* decls,
......
...@@ -656,18 +656,17 @@ struct InterpreterCode { ...@@ -656,18 +656,17 @@ struct InterpreterCode {
class SideTable : public ZoneObject { class SideTable : public ZoneObject {
public: public:
ControlTransferMap map_; ControlTransferMap map_;
uint32_t max_stack_height_; uint32_t max_stack_height_ = 0;
SideTable(Zone* zone, const WasmModule* module, InterpreterCode* code) SideTable(Zone* zone, const WasmModule* module, InterpreterCode* code)
: map_(zone), max_stack_height_(0) { : map_(zone) {
// Create a zone for all temporary objects. // Create a zone for all temporary objects.
Zone control_transfer_zone(zone->allocator(), ZONE_NAME); Zone control_transfer_zone(zone->allocator(), ZONE_NAME);
// Represents a control flow label. // Represents a control flow label.
class CLabel : public ZoneObject { class CLabel : public ZoneObject {
explicit CLabel(Zone* zone, uint32_t target_stack_height, uint32_t arity) explicit CLabel(Zone* zone, uint32_t target_stack_height, uint32_t arity)
: target(nullptr), : target_stack_height(target_stack_height),
target_stack_height(target_stack_height),
arity(arity), arity(arity),
refs(zone) {} refs(zone) {}
...@@ -676,7 +675,7 @@ class SideTable : public ZoneObject { ...@@ -676,7 +675,7 @@ class SideTable : public ZoneObject {
const byte* from_pc; const byte* from_pc;
const uint32_t stack_height; const uint32_t stack_height;
}; };
const byte* target; const byte* target = nullptr;
uint32_t target_stack_height; uint32_t target_stack_height;
// Arity when branching to this label. // Arity when branching to this label.
const uint32_t arity; const uint32_t arity;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment