summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2016-02-24 10:30:04 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-02-24 10:30:04 +0000
commit21ce0dae31a72cee459dba352b4aa1ccb5157a5d (patch)
treebe293c89806b919143b7dcd203bae14f5f4eaf04 /compiler/optimizing/code_generator.h
parent0e02ee9efbf1dbdde05d2b10f7307bbe191c52f5 (diff)
parent9cd6d378bd573cdc14d049d32bdd22a97fa4d84a (diff)
Merge "Associate slow paths with the instruction that they belong to."
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 789bf4019f..9297fc956f 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -69,7 +69,7 @@ class CodeAllocator {
class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> {
public:
- SlowPathCode() {
+ explicit SlowPathCode(HInstruction* instruction) : instruction_(instruction) {
for (size_t i = 0; i < kMaximumNumberOfExpectedRegisters; ++i) {
saved_core_stack_offsets_[i] = kRegisterNotSaved;
saved_fpu_stack_offsets_[i] = kRegisterNotSaved;
@@ -106,9 +106,15 @@ class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> {
Label* GetEntryLabel() { return &entry_label_; }
Label* GetExitLabel() { return &exit_label_; }
+ uint32_t GetDexPc() const {
+ return instruction_ != nullptr ? instruction_->GetDexPc() : kNoDexPc;
+ }
+
protected:
static constexpr size_t kMaximumNumberOfExpectedRegisters = 32;
static constexpr uint32_t kRegisterNotSaved = -1;
+ // The instruction where this slow path is happening.
+ HInstruction* instruction_;
uint32_t saved_core_stack_offsets_[kMaximumNumberOfExpectedRegisters];
uint32_t saved_fpu_stack_offsets_[kMaximumNumberOfExpectedRegisters];