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

Unified Diff: vm/object.cc

Issue 10829177: Address review comments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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
« no previous file with comments | « vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 10251)
+++ vm/object.cc (working copy)
@@ -10844,25 +10844,9 @@
}
-void Stacktrace::SetupStacktrace(intptr_t index,
- const GrowableArray<uword>& frame_pcs) const {
- Isolate* isolate = Isolate::Current();
- ASSERT(isolate != NULL);
- Code& code = Code::Handle(isolate, Code::null());
- Smi& pc_offset = Smi::Handle(isolate, Smi::New(0));
- const Array& code_array = Array::Handle(raw_ptr()->code_array_);
- const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_);
- for (intptr_t i = 0; i < frame_pcs.length(); i++) {
- code ^= code_array.At(i);
- pc_offset = Smi::New(frame_pcs[i] - code.EntryPoint());
- pc_offset_array.SetAt((index + i), pc_offset);
- }
-}
-
-
-RawStacktrace* Stacktrace::New(const GrowableArray<uword>& stack_frame_pcs,
- const GrowableObjectArray& func_list,
+RawStacktrace* Stacktrace::New(const GrowableObjectArray& func_list,
const GrowableObjectArray& code_list,
+ const GrowableObjectArray& pc_offset_list,
Heap::Space space) {
ASSERT(Isolate::Current()->object_store()->stacktrace_class() !=
Class::null());
@@ -10874,27 +10858,25 @@
NoGCScope no_gc;
result ^= raw;
}
- intptr_t length = stack_frame_pcs.length();
// Create arrays for the function, code and pc_offset triplet for each frame.
const Array& function_array = Array::Handle(Array::MakeArray(func_list));
const Array& code_array = Array::Handle(Array::MakeArray(code_list));
- const Array& pc_offset_array = Array::Handle(Array::New(length));
+ const Array& pc_offset_array =
+ Array::Handle(Array::MakeArray(pc_offset_list));
result.set_function_array(function_array);
result.set_code_array(code_array);
result.set_pc_offset_array(pc_offset_array);
- // Now populate the arrays with appropriate values from each frame.
- result.SetupStacktrace(0, stack_frame_pcs);
return result.raw();
}
-void Stacktrace::Append(const GrowableArray<uword>& stack_frame_pcs,
- const GrowableObjectArray& func_list,
- const GrowableObjectArray& code_list) const {
+void Stacktrace::Append(const GrowableObjectArray& func_list,
+ const GrowableObjectArray& code_list,
+ const GrowableObjectArray& pc_offset_list) const {
intptr_t old_length = Length();
- intptr_t new_length = old_length + stack_frame_pcs.length();
- ASSERT(stack_frame_pcs.length() == func_list.Length());
- ASSERT(stack_frame_pcs.length() == code_list.Length());
+ intptr_t new_length = old_length + pc_offset_list.Length();
+ ASSERT(pc_offset_list.Length() == func_list.Length());
+ ASSERT(pc_offset_list.Length() == code_list.Length());
// Grow the arrays for function, code and pc_offset triplet to accommodate
// the new stack frames.
@@ -10915,9 +10897,9 @@
function_array.SetAt(i, obj);
obj = code_list.At(j);
code_array.SetAt(i, obj);
+ obj = pc_offset_list.At(j);
+ pc_offset_array.SetAt(i, obj);
}
- // Now populate the arrays with appropriate values from each new frame.
- SetupStacktrace(old_length, stack_frame_pcs);
}
« no previous file with comments | « vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698