Commit 88a444ba authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[profview] Avoid treating embedded builtins as CPP code.

Instead attribute them properly as Bultin or BytecodeHandler.

Bug: v8:6240
Change-Id: I773a533b318afe52d63152edf5b16463801db8e9
Reviewed-on: https://chromium-review.googlesource.com/1249202Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56262}
parent 94364486
......@@ -123,8 +123,19 @@ Code* BuiltinDeserializer::DeserializeBuiltinRaw(int builtin_id) {
Assembler::FlushICache(code->raw_instruction_start(),
code->raw_instruction_size());
PROFILE(isolate(), CodeCreateEvent(CodeEventListener::BUILTIN_TAG,
AbstractCode::cast(code),
CodeEventListener::LogEventsAndTags code_tag;
switch (code->kind()) {
case AbstractCode::BUILTIN:
code_tag = CodeEventListener::BUILTIN_TAG;
break;
case AbstractCode::BYTECODE_HANDLER:
code_tag = CodeEventListener::BYTECODE_HANDLER_TAG;
break;
default:
UNREACHABLE();
}
PROFILE(isolate(), CodeCreateEvent(code_tag, AbstractCode::cast(code),
Builtins::name(builtin_id)));
LOG_CODE_EVENT(isolate(),
CodeLinePosInfoRecordEvent(
......
......@@ -892,16 +892,24 @@ JsonProfile.prototype.addStaticCode = function(
JsonProfile.prototype.addCode = function(
kind, name, timestamp, start, size) {
let codeId = this.codeEntries_.length;
// Find out if we have a static code entry for the code. If yes, we will
// make sure it is written to the JSON file just once.
let staticEntry = this.codeMap_.findAddress(start);
if (staticEntry && staticEntry.entry.type === 'CPP') {
codeId = staticEntry.entry.codeId;
}
var entry = new CodeMap.CodeEntry(size, name, 'CODE');
this.codeMap_.addCode(start, entry);
entry.codeId = this.codeEntries_.length;
this.codeEntries_.push({
entry.codeId = codeId;
this.codeEntries_[codeId] = {
name : entry.name,
timestamp: timestamp,
type : entry.type,
kind : kind
});
};
return entry;
};
......
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