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

Unified Diff: runtime/vm/code_generator.cc

Issue 9465028: Move CodeGenerator::DescriptorList into shared part. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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/code_generator.h ('k') | runtime/vm/code_generator_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 4579)
+++ runtime/vm/code_generator.cc (working copy)
@@ -28,6 +28,39 @@
DECLARE_FLAG(bool, trace_type_checks);
+void CodeGenerator::DescriptorList::AddDescriptor(
+ PcDescriptors::Kind kind,
+ intptr_t pc_offset,
+ intptr_t node_id,
+ intptr_t token_index,
+ intptr_t try_index) {
+ struct PcDesc data;
+ data.pc_offset = pc_offset;
+ data.kind = kind;
+ data.node_id = node_id;
+ data.token_index = token_index;
+ data.try_index = try_index;
+ list_.Add(data);
+}
+
+
+RawPcDescriptors* CodeGenerator::DescriptorList::FinalizePcDescriptors(
+ uword entry_point) {
+ intptr_t num_descriptors = Length();
+ const PcDescriptors& descriptors =
+ PcDescriptors::Handle(PcDescriptors::New(num_descriptors));
+ for (intptr_t i = 0; i < num_descriptors; i++) {
+ descriptors.AddDescriptor(i,
+ (entry_point + PcOffset(i)),
+ Kind(i),
+ NodeId(i),
+ TokenIndex(i),
+ TryIndex(i));
+ }
+ return descriptors.raw();
+}
+
+
const Array& CodeGenerator::ArgumentsDescriptor(
int num_arguments,
const Array& optional_arguments_names) {
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/code_generator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698