OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 7280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7291 } | 7291 } |
7292 | 7292 |
7293 | 7293 |
7294 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) { | 7294 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) { |
7295 HandleScope scope(isolate); | 7295 HandleScope scope(isolate); |
7296 ASSERT(args.length() == 1); | 7296 ASSERT(args.length() == 1); |
7297 Handle<JSFunction> function = args.at<JSFunction>(0); | 7297 Handle<JSFunction> function = args.at<JSFunction>(0); |
7298 // If the function is not optimizable or debugger is active continue using the | 7298 // If the function is not optimizable or debugger is active continue using the |
7299 // code from the full compiler. | 7299 // code from the full compiler. |
7300 if (!function->shared()->code()->optimizable() || | 7300 if (!function->shared()->code()->optimizable() || |
7301 isolate->debug()->has_break_points()) { | 7301 isolate->DebuggerHasBreakPoints()) { |
7302 if (FLAG_trace_opt) { | 7302 if (FLAG_trace_opt) { |
7303 PrintF("[failed to optimize "); | 7303 PrintF("[failed to optimize "); |
7304 function->PrintName(); | 7304 function->PrintName(); |
7305 PrintF(": is code optimizable: %s, is debugger enabled: %s]\n", | 7305 PrintF(": is code optimizable: %s, is debugger enabled: %s]\n", |
7306 function->shared()->code()->optimizable() ? "T" : "F", | 7306 function->shared()->code()->optimizable() ? "T" : "F", |
7307 isolate->debug()->has_break_points() ? "T" : "F"); | 7307 isolate->DebuggerHasBreakPoints() ? "T" : "F"); |
7308 } | 7308 } |
7309 function->ReplaceCode(function->shared()->code()); | 7309 function->ReplaceCode(function->shared()->code()); |
7310 return function->code(); | 7310 return function->code(); |
7311 } | 7311 } |
7312 if (CompileOptimized(function, AstNode::kNoNumber, CLEAR_EXCEPTION)) { | 7312 if (CompileOptimized(function, AstNode::kNoNumber, CLEAR_EXCEPTION)) { |
7313 return function->code(); | 7313 return function->code(); |
7314 } | 7314 } |
7315 if (FLAG_trace_opt) { | 7315 if (FLAG_trace_opt) { |
7316 PrintF("[failed to optimize "); | 7316 PrintF("[failed to optimize "); |
7317 function->PrintName(); | 7317 function->PrintName(); |
(...skipping 4667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11985 } else { | 11985 } else { |
11986 // Handle last resort GC and make sure to allow future allocations | 11986 // Handle last resort GC and make sure to allow future allocations |
11987 // to grow the heap without causing GCs (if possible). | 11987 // to grow the heap without causing GCs (if possible). |
11988 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11988 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11989 isolate->heap()->CollectAllGarbage(false); | 11989 isolate->heap()->CollectAllGarbage(false); |
11990 } | 11990 } |
11991 } | 11991 } |
11992 | 11992 |
11993 | 11993 |
11994 } } // namespace v8::internal | 11994 } } // namespace v8::internal |
OLD | NEW |