| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index c16699f1a03348db206e0f83da9331090ae2e07f..f18d64babadf24633e6676b8c7df21b4bab0fa21 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -1743,6 +1743,7 @@ static MaybeObject* Runtime_SetCode(Arguments args) {
|
| // Array, and Object, and some web code
|
| // doesn't like seeing source code for constructors.
|
| target->shared()->set_script(Heap::undefined_value());
|
| + target->shared()->code()->set_optimizable(false);
|
| // Clear the optimization hints related to the compiled code as these are no
|
| // longer valid when the code is overwritten.
|
| target->shared()->ClearThisPropertyAssignmentsInfo();
|
| @@ -6706,12 +6707,24 @@ static MaybeObject* Runtime_LazyRecompile(Arguments args) {
|
| // code from the full compiler.
|
| if (!function->shared()->code()->optimizable() ||
|
| Debug::has_break_points()) {
|
| + if (FLAG_trace_opt) {
|
| + PrintF("[failed to optimize ");
|
| + function->PrintName();
|
| + PrintF(": is code optimizable: %s, is debugger enabled: %s]\n",
|
| + function->shared()->code()->optimizable() ? "T" : "F",
|
| + Debug::has_break_points() ? "T" : "F");
|
| + }
|
| function->ReplaceCode(function->shared()->code());
|
| return function->code();
|
| }
|
| if (CompileOptimized(function, AstNode::kNoNumber)) {
|
| return function->code();
|
| }
|
| + if (FLAG_trace_opt) {
|
| + PrintF("[failed to optimize ");
|
| + function->PrintName();
|
| + PrintF(": optimized compilation failed]\n");
|
| + }
|
| function->ReplaceCode(function->shared()->code());
|
| return Failure::Exception();
|
| }
|
|
|