summaryrefslogtreecommitdiff
path: root/deps/v8/src/profiler/profile-generator.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-09-04 21:22:51 +0200
committerMichaël Zasso <targos@protonmail.com>2018-09-07 21:07:09 +0200
commit7766baf943a61843eaf706f349dd663218639e8c (patch)
tree8b4f4cb2677ef8933413993a76845801f1f6c284 /deps/v8/src/profiler/profile-generator.h
parent56d7411be3c70a3e99cbc60aadee06bbc99a233e (diff)
downloadandroid-node-v8-7766baf943a61843eaf706f349dd663218639e8c.tar.gz
android-node-v8-7766baf943a61843eaf706f349dd663218639e8c.tar.bz2
android-node-v8-7766baf943a61843eaf706f349dd663218639e8c.zip
deps: cherry-pick ba752ea from upstream V8
Original commit message: [cpu-profiler] Use instruction start as the key for the CodeMap Previously we used the start address of the AbstractCode object. This doesn't make sense for off-heap builtins, where the code isn't contained in the object itself. It also hides other potential problems - sometimes the sample.pc is inside the AbstractCode object header - this is never valid. There were a few changes necessary to make this happen: - Change the interface of CodeMoveEvent. Now 'to' and 'from' are both AbstractCode objects, which is nice because many users were taking 'to' and adding the header offset to it to try and find the instruction start address. This isn't valid for off-heap builtins. - Fix a bug in CodeMap::MoveCode where we didn't update the CodeEntry object to reflect the new instruction_start. - Rename the 'start' field in all of the CodeEventRecord sub-classes to make it clear that this is the address of the first instruction. - Fix the confusion in RecordTickSample between 'tos' and 'pc' which caused pc_offset to be calculated incorrectly. Bug: v8:7983 Change-Id: I3e9dddf74e4b2e96a5f031d216ef7008d6f184d1 Reviewed-on: https://chromium-review.googlesource.com/1148457 Commit-Queue: Peter Marshall <petermarshall@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#54749} Refs: https://github.com/v8/v8/commit/ba752ea4c50713dff1e94f45a79db3ba968a8d66 PR-URL: https://github.com/nodejs/node/pull/21983 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/profiler/profile-generator.h')
-rw-r--r--deps/v8/src/profiler/profile-generator.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/deps/v8/src/profiler/profile-generator.h b/deps/v8/src/profiler/profile-generator.h
index 3e301a4082..8eef05bcdb 100644
--- a/deps/v8/src/profiler/profile-generator.h
+++ b/deps/v8/src/profiler/profile-generator.h
@@ -108,7 +108,9 @@ class CodeEntry {
const std::vector<std::unique_ptr<CodeEntry>>* GetInlineStack(
int pc_offset) const;
+ void set_instruction_start(Address start) { instruction_start_ = start; }
Address instruction_start() const { return instruction_start_; }
+
CodeEventListener::LogEventsAndTags tag() const {
return TagField::decode(bit_field_);
}