OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 8446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8457 OS::Sleep(50); | 8457 OS::Sleep(50); |
8458 } | 8458 } |
8459 } | 8459 } |
8460 return isolate->heap()->undefined_value(); | 8460 return isolate->heap()->undefined_value(); |
8461 } | 8461 } |
8462 | 8462 |
8463 | 8463 |
8464 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { | 8464 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { |
8465 HandleScope scope(isolate); | 8465 HandleScope scope(isolate); |
8466 ASSERT(args.length() == 1); | 8466 ASSERT(args.length() == 1); |
8467 // The least significant bit (after untagging) indicates whether the | 8467 // The least significant bit (after untagging) indicates whether the |
Jakob Kummerow
2013/07/15 14:26:28
While you're here, please delete this comment. It
| |
8468 // function is currently optimized, regardless of reason. | 8468 // function is currently optimized, regardless of reason. |
8469 if (!V8::UseCrankshaft()) { | 8469 if (!V8::UseCrankshaft()) { |
8470 return Smi::FromInt(4); // 4 == "never". | 8470 return Smi::FromInt(4); // 4 == "never". |
8471 } | 8471 } |
8472 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8472 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
8473 if (FLAG_parallel_recompilation) { | 8473 if (FLAG_parallel_recompilation) { |
8474 if (function->IsMarkedForLazyRecompilation()) { | 8474 if (function->IsMarkedForLazyRecompilation()) { |
8475 return Smi::FromInt(5); | 8475 return Smi::FromInt(5); |
Jakob Kummerow
2013/07/15 14:26:28
Also, let's add a description here:
// 5 == "paral
| |
8476 } | 8476 } |
8477 } | 8477 } |
8478 if (FLAG_always_opt) { | 8478 if (FLAG_always_opt) { |
8479 // We may have always opt, but that is more best-effort than a real | 8479 // We may have always opt, but that is more best-effort than a real |
8480 // promise, so we still say "no" if it is not optimized. | 8480 // promise, so we still say "no" if it is not optimized. |
8481 return function->IsOptimized() ? Smi::FromInt(3) // 3 == "always". | 8481 return function->IsOptimized() ? Smi::FromInt(3) // 3 == "always". |
8482 : Smi::FromInt(2); // 2 == "no". | 8482 : Smi::FromInt(2); // 2 == "no". |
8483 } | 8483 } |
8484 if (FLAG_deopt_every_n_times) { | |
8485 return Smi::FromInt(6); // 6 == "maybe deopted". | |
8486 } | |
8484 return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes". | 8487 return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes". |
8485 : Smi::FromInt(2); // 2 == "no". | 8488 : Smi::FromInt(2); // 2 == "no". |
8486 } | 8489 } |
8487 | 8490 |
8488 | 8491 |
8489 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) { | 8492 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) { |
8490 HandleScope scope(isolate); | 8493 HandleScope scope(isolate); |
8491 ASSERT(args.length() == 1); | 8494 ASSERT(args.length() == 1); |
8492 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8495 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
8493 return Smi::FromInt(function->shared()->opt_count()); | 8496 return Smi::FromInt(function->shared()->opt_count()); |
(...skipping 5583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
14077 // Handle last resort GC and make sure to allow future allocations | 14080 // Handle last resort GC and make sure to allow future allocations |
14078 // to grow the heap without causing GCs (if possible). | 14081 // to grow the heap without causing GCs (if possible). |
14079 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14082 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14080 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14083 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14081 "Runtime::PerformGC"); | 14084 "Runtime::PerformGC"); |
14082 } | 14085 } |
14083 } | 14086 } |
14084 | 14087 |
14085 | 14088 |
14086 } } // namespace v8::internal | 14089 } } // namespace v8::internal |
OLD | NEW |