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

Unified Diff: runtime/vm/object.cc

Issue 10885039: Deoptimization can occur at Dart calls (includes native calls to C) but not at runtime calls. This … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 11533)
+++ runtime/vm/object.cc (working copy)
@@ -3909,7 +3909,8 @@
bool Function::is_optimizable() const {
return OptimizableBit::decode(raw_ptr()->kind_tag_) &&
- (script() != Script::null());
+ (script() != Script::null()) &&
+ !is_native();
}
@@ -6654,13 +6655,14 @@
const char* PcDescriptors::KindAsStr(intptr_t index) const {
switch (DescriptorKind(index)) {
- case PcDescriptors::kDeopt: return "deopt ";
- case PcDescriptors::kDeoptIndex: return "deopt-ix";
- case PcDescriptors::kPatchCode: return "patch ";
- case PcDescriptors::kIcCall: return "ic-call ";
- case PcDescriptors::kFuncCall: return "fn-call ";
- case PcDescriptors::kReturn: return "return ";
- case PcDescriptors::kOther: return "other ";
+ case PcDescriptors::kDeoptBefore: return "deopt-before ";
+ case PcDescriptors::kDeoptAfter: return "deopt-after ";
+ case PcDescriptors::kDeoptIndex: return "deopt-ix ";
+ case PcDescriptors::kPatchCode: return "patch ";
+ case PcDescriptors::kIcCall: return "ic-call ";
+ case PcDescriptors::kFuncCall: return "fn-call ";
+ case PcDescriptors::kReturn: return "return ";
+ case PcDescriptors::kOther: return "other ";
}
UNREACHABLE();
return "";
@@ -6742,7 +6744,7 @@
// 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind.
intptr_t deopt_id = Isolate::kNoDeoptId;
if (check_ids) {
- if ((DescriptorKind(i) == PcDescriptors::kDeopt) ||
+ if ((DescriptorKind(i) == PcDescriptors::kDeoptBefore) ||
(DescriptorKind(i) == PcDescriptors::kIcCall)) {
deopt_id = DeoptId(i);
}
@@ -7286,11 +7288,11 @@
}
-uword Code::GetDeoptPcAtDeoptId(intptr_t deopt_id) const {
+uword Code::GetPcForDeoptId(intptr_t deopt_id, PcDescriptors::Kind kind) const {
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
for (intptr_t i = 0; i < descriptors.Length(); i++) {
if ((descriptors.DeoptId(i) == deopt_id) &&
- (descriptors.DescriptorKind(i) == PcDescriptors::kDeopt)) {
+ (descriptors.DescriptorKind(i) == kind)) {
return descriptors.PC(i);
}
}
@@ -7298,6 +7300,16 @@
}
+uword Code::GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const {
+ return GetPcForDeoptId(deopt_id, PcDescriptors::kDeoptBefore);
+}
+
+
+uword Code::GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const {
+ return GetPcForDeoptId(deopt_id, PcDescriptors::kDeoptAfter);
+}
+
+
const char* Code::ToCString() const {
const char* kFormat = "Code entry:0x%d";
intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()) + 1;
« runtime/vm/native_entry.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698