-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
VM Trace output fixes #1035 #1048
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1048 +/- ##
==========================================
- Coverage 58.69% 58.56% -0.14%
==========================================
Files 176 176
Lines 12389 12516 +127
==========================================
+ Hits 7272 7330 +58
- Misses 5117 5186 +69
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just have 1 question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some comments, but overall it looks good :)
while self.idx < self.instructions.len() { | ||
if self.is_trace { | ||
self.trace_print(false); | ||
}; | ||
|
||
while idx < self.instructions.len() { | ||
let _timer = | ||
BoaProfiler::global().start_event(&self.instructions[idx].to_string(), "vm"); | ||
match self.instructions[idx] { | ||
BoaProfiler::global().start_event(&self.instructions[self.idx].to_string(), "vm"); | ||
match self.instructions[self.idx] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I see we are iterating and using the index to retrieve the instruction. Couldn't we do this with iterators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m going to merge and come back to this
For the JS
Output is:
Currently this is on by default.
Preferably we would pass
--trace
to the cli to get this output, similar to other JS Cli's.This would mean needing to add a trace option to
eval()
here https://github.com/boa-dev/boa/blob/master/boa/src/context.rs#L751