Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(773)

Unified Diff: runtime/vm/object.cc

Issue 17233003: Reapply "Initial implementation of on-stack replacement (OSR)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stack_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 12cfe2d0a32fce9d193a126c1e0216e1581ce4fb..c0e5a6536e8bf9d8f4ad7b218970e1e8a8d5cb3b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -22,6 +22,7 @@
#include "vm/datastream.h"
#include "vm/debugger.h"
#include "vm/deopt_instructions.h"
+#include "vm/disassembler.h"
#include "vm/double_conversion.h"
#include "vm/exceptions.h"
#include "vm/flow_graph_builder.h"
@@ -7292,6 +7293,7 @@ const char* PcDescriptors::KindAsStr(intptr_t index) const {
case PcDescriptors::kClosureCall: return "closure-call ";
case PcDescriptors::kReturn: return "return ";
case PcDescriptors::kRuntimeCall: return "runtime-call ";
+ case PcDescriptors::kOsrEntry: return "osr-entry ";
case PcDescriptors::kOther: return "other ";
}
UNREACHABLE();
@@ -7999,6 +8001,13 @@ void Code::SetStaticCallTargetCodeAt(uword pc, const Code& code) const {
}
+void Code::Disassemble() const {
+ const Instructions& instr = Instructions::Handle(instructions());
+ uword start = instr.EntryPoint();
+ Disassembler::Disassemble(start, start + instr.size(), comments());
+}
+
+
const Code::Comments& Code::comments() const {
Comments* comments = new Code::Comments(Array::Handle(raw_ptr()->comments_));
return *comments;
@@ -8151,6 +8160,18 @@ uword Code::GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const {
}
+intptr_t Code::GetDeoptIdForOsr(uword pc) const {
+ const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
+ for (intptr_t i = 0; i < descriptors.Length(); ++i) {
+ if ((descriptors.PC(i) == pc) &&
+ (descriptors.DescriptorKind(i) == PcDescriptors::kOsrEntry)) {
+ return descriptors.DeoptId(i);
+ }
+ }
+ return Isolate::kNoDeoptId;
+}
+
+
const char* Code::ToCString() const {
const char* kFormat = "Code entry:%p";
intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()) + 1;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stack_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698