Skip to content

Commit a7c9616

Browse files
committed
Fix bugs and improve code performance
Signed-off-by: Ádám László Kulcsár <[email protected]>
1 parent 765ca38 commit a7c9616

File tree

5 files changed

+343
-259
lines changed

5 files changed

+343
-259
lines changed

src/interpreter/ByteCode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ std::vector<Walrus::ByteCodeStackOffset> ByteCode::getByteCodeStackOffsets(Funct
540540
for (uint32_t i = 0; i < call->functionType()->param().size(); i++) {
541541
offsets.push_back(call->stackOffsets()[offsetCounter]);
542542

543-
if (call->functionType()->param()[i] == Walrus::Value::Type::V128) {
543+
if (call->functionType()->param().types()[i] == Walrus::Value::Type::V128) {
544544
offsets.push_back(call->stackOffsets()[offsetCounter]);
545545
offsetCounter++;
546546
}
@@ -551,7 +551,7 @@ std::vector<Walrus::ByteCodeStackOffset> ByteCode::getByteCodeStackOffsets(Funct
551551
offsets.push_back(call->stackOffsets()[offsetCounter]);
552552
offsetCounter++;
553553

554-
if (call->functionType()->result()[i] == Walrus::Value::Type::V128) {
554+
if (call->functionType()->result().types()[i] == Walrus::Value::Type::V128) {
555555
offsets.push_back(call->stackOffsets()[offsetCounter]);
556556
offsetCounter++;
557557
}
@@ -561,7 +561,7 @@ std::vector<Walrus::ByteCodeStackOffset> ByteCode::getByteCodeStackOffsets(Funct
561561
offsets.push_back(call->stackOffsets()[offsetCounter]);
562562
offsetCounter++;
563563

564-
switch (call->functionType()->param()[i]) {
564+
switch (call->functionType()->param().types()[i]) {
565565
case Walrus::Value::Type::I64:
566566
case Walrus::Value::Type::F64: {
567567
offsets.push_back(call->stackOffsets()[offsetCounter]);

src/interpreter/Interpreter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,7 @@ ByteCodeStackOffset* Interpreter::interpret(ExecutionState& state,
22262226
auto& param = tag->functionType()->param().types();
22272227
for (size_t i = 0; i < param.size(); i++) {
22282228
auto sz = valueStackAllocatedSize(param[i]);
2229+
// auto sz = valueSize(param[i]);
22292230
memcpy(ptr, bp + code->dataOffsets()[i], sz);
22302231
ptr += sz;
22312232
}

0 commit comments

Comments
 (0)