Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(jsruntime): improve exception handling #201

Open
masnagam opened this issue Jun 14, 2024 · 1 comment
Open

perf(jsruntime): improve exception handling #201

masnagam opened this issue Jun 14, 2024 · 1 comment

Comments

@masnagam
Copy link
Member

performance degraration occurred in b720076 (bencher report).

this degraration probably caused due to the exception handling in Compiler::Call():

// Handle an exception if it's thrown.
auto* is_exception =
builder_->CreateICmpEQ(status, builder_->getInt32(static_cast<int32_t>(Status::Exception)));
auto* then_block = llvm::BasicBlock::Create(*context_, "", function_);
auto* else_block = llvm::BasicBlock::Create(*context_, "", function_);
builder_->CreateCondBr(is_exception, then_block, else_block);
builder_->SetInsertPoint(then_block);
// Store the exception.
builder_->CreateStore(status, status_);
builder_->CreateMemCpy(
ret_, llvm::MaybeAlign(), ret, llvm::MaybeAlign(), builder_->getInt32(sizeof(Value)));
assert(!catch_stack_.empty());
auto* catch_block = catch_stack_.back();
builder_->CreateBr(catch_block);

by this change, the exception handling always performs every function call.

in this issue, we investigate ways to improve the exception handling.

@masnagam
Copy link
Member Author

llvm has its own exception handling: Exception Handling in LLVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant