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

Unified Diff: runtime/vm/object.cc

Issue 1067383002: VM: Enable collection of unoptimized code for optimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/gc_marker.cc ('k') | runtime/vm/raw_object.h » ('j') | 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 44996)
+++ runtime/vm/object.cc (working copy)
@@ -59,8 +59,6 @@
DEFINE_FLAG(bool, show_internal_names, false,
"Show names of internal classes (e.g. \"OneByteString\") in error messages "
"instead of showing the corresponding interface names (e.g. \"String\")");
-DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
- "Trace disabling optimized code.");
DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false,
"Throw an exception when the result of an integer calculation will not "
"fit into a javascript integer.");
@@ -5094,7 +5092,7 @@
Isolate* isolate = Isolate::Current();
const Code& current_code = Code::Handle(isolate, CurrentCode());
- if (FLAG_trace_deoptimization) {
+ if (FLAG_trace_deoptimization_verbose) {
OS::Print("Disabling optimized code: '%s' entry: %#" Px "\n",
ToFullyQualifiedCString(),
current_code.EntryPoint());
@@ -5101,7 +5099,7 @@
}
// Patch entry of the optimized code.
CodePatcher::PatchEntry(current_code);
- // Use previously compiled unoptimized code.
+ Compiler::EnsureUnoptimizedCode(Thread::Current(), *this);
AttachCode(Code::Handle(isolate, unoptimized_code()));
CodePatcher::RestoreEntry(Code::Handle(isolate, unoptimized_code()));
isolate->TrackDeoptimizedCode(current_code);
@@ -5109,7 +5107,7 @@
void Function::set_unoptimized_code(const Code& value) const {
- ASSERT(!value.is_optimized());
+ ASSERT(value.IsNull() || !value.is_optimized());
StorePointer(&raw_ptr()->unoptimized_code_, value.raw());
}
@@ -5551,13 +5549,9 @@
if (is_optimizable() && (script() != Script::null()) &&
((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) {
// Additional check needed for implicit getters.
- if (HasCode() &&
- (Code::Handle(unoptimized_code()).Size() >=
- FLAG_huge_method_cutoff_in_code_size)) {
- return false;
- } else {
- return true;
- }
+ return (unoptimized_code() == Object::null()) ||
+ (Code::Handle(unoptimized_code()).Size() <
+ FLAG_huge_method_cutoff_in_code_size);
}
return false;
}
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698