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

Unified Diff: runtime/vm/object.cc

Issue 1096203007: VM: Use canonical empty-array for empty inlining meta-data. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: saved one more array per unoptimized code object Created 5 years, 8 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/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 45397)
+++ runtime/vm/object.cc (working copy)
@@ -12567,7 +12567,8 @@
descriptors.PrintToJSONObject(&desc, false);
}
const Array& inlined_function_table = Array::Handle(inlined_id_to_function());
- if (!inlined_function_table.IsNull()) {
+ if (!inlined_function_table.IsNull() &&
+ (inlined_function_table.Length() > 0)) {
JSONArray inlined_functions(&jsobj, "_inlinedFunctions");
Function& function = Function::Handle();
for (intptr_t i = 0; i < inlined_function_table.Length(); i++) {
@@ -12577,7 +12578,7 @@
}
}
const Array& intervals = Array::Handle(inlined_intervals());
- if (!intervals.IsNull()) {
+ if (!intervals.IsNull() && (intervals.Length() > 0)) {
Smi& start = Smi::Handle();
Smi& end = Smi::Handle();
Smi& temp_smi = Smi::Handle();
@@ -12657,6 +12658,7 @@
intptr_t Code::GetCallerId(intptr_t inlined_id) const {
if (inlined_id < 0) return -1;
const Array& intervals = Array::Handle(inlined_intervals());
+ if (intervals.IsNull() || (intervals.Length() == 0)) return -1;
Smi& temp_smi = Smi::Handle();
for (intptr_t i = 0; i < intervals.Length() - Code::kInlIntNumEntries;
i += Code::kInlIntNumEntries) {
@@ -12674,7 +12676,7 @@
intptr_t offset, GrowableArray<Function*>* fs) const {
fs->Clear();
const Array& intervals = Array::Handle(inlined_intervals());
- if (intervals.IsNull()) {
+ if (intervals.IsNull() || (intervals.Length() == 0)) {
// E.g., for code stubs.
return;
}
@@ -12716,6 +12718,7 @@
void Code::DumpInlinedIntervals() const {
OS::Print("Inlined intervals:\n");
const Array& intervals = Array::Handle(inlined_intervals());
+ if (intervals.IsNull() || (intervals.Length() == 0)) return;
Smi& start = Smi::Handle();
Smi& inlining_id = Smi::Handle();
Smi& caller_id = Smi::Handle();
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698