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

Unified Diff: runtime/vm/compiler.cc

Issue 10948007: Revert "Deoptimization support in inlined code." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/compiler.h ('k') | runtime/vm/deopt_instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index a8fff537219b110e7836dfbf0d3db1a4a2efeea6..df20d4d2653426c4e3b09e81352abb3cd95133ff 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -57,6 +57,24 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
}
+// Returns an array indexed by deopt id, containing the extracted ICData.
+static RawArray* ExtractTypeFeedbackArray(const Code& code) {
+ ASSERT(!code.IsNull() && !code.is_optimized());
+ GrowableArray<intptr_t> deopt_ids;
+ const GrowableObjectArray& ic_data_objs =
+ GrowableObjectArray::Handle(GrowableObjectArray::New());
+ const intptr_t max_id =
+ code.ExtractIcDataArraysAtCalls(&deopt_ids, ic_data_objs);
+ const Array& result = Array::Handle(Array::New(max_id + 1));
+ for (intptr_t i = 0; i < deopt_ids.length(); i++) {
+ intptr_t result_index = deopt_ids[i];
+ ASSERT(result.At(result_index) == Object::null());
+ result.SetAt(result_index, Object::Handle(ic_data_objs.At(i)));
+ }
+ return result.raw();
+}
+
+
RawError* Compiler::Compile(const Library& library, const Script& script) {
Isolate* isolate = Isolate::Current();
LongJump* base = isolate->long_jump_base();
@@ -139,7 +157,7 @@ static bool CompileParsedFunctionHelper(const ParsedFunction& parsed_function,
const Code& unoptimized_code =
Code::Handle(parsed_function.function().unoptimized_code());
isolate->set_ic_data_array(
- unoptimized_code.ExtractTypeFeedbackArray());
+ ExtractTypeFeedbackArray(unoptimized_code));
}
}
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/deopt_instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698