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 8259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8270 ASSERT(args.length() == 1); | 8270 ASSERT(args.length() == 1); |
8271 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8271 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
8272 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); | 8272 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); |
8273 | 8273 |
8274 Deoptimizer::DeoptimizeFunction(*function); | 8274 Deoptimizer::DeoptimizeFunction(*function); |
8275 | 8275 |
8276 return isolate->heap()->undefined_value(); | 8276 return isolate->heap()->undefined_value(); |
8277 } | 8277 } |
8278 | 8278 |
8279 | 8279 |
| 8280 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { |
| 8281 HandleScope scope(isolate); |
| 8282 ASSERT(args.length() == 1); |
| 8283 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 8284 Code* unoptimized = function->shared()->code(); |
| 8285 if (unoptimized->kind() == Code::FUNCTION) { |
| 8286 unoptimized->ClearInlineCaches(); |
| 8287 unoptimized->ClearTypeFeedbackCells(isolate->heap()); |
| 8288 } |
| 8289 return isolate->heap()->undefined_value(); |
| 8290 } |
| 8291 |
| 8292 |
8280 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { | 8293 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { |
8281 #if defined(USE_SIMULATOR) | 8294 #if defined(USE_SIMULATOR) |
8282 return isolate->heap()->true_value(); | 8295 return isolate->heap()->true_value(); |
8283 #else | 8296 #else |
8284 return isolate->heap()->false_value(); | 8297 return isolate->heap()->false_value(); |
8285 #endif | 8298 #endif |
8286 } | 8299 } |
8287 | 8300 |
8288 | 8301 |
8289 RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) { | 8302 RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) { |
(...skipping 5202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13492 // Handle last resort GC and make sure to allow future allocations | 13505 // Handle last resort GC and make sure to allow future allocations |
13493 // to grow the heap without causing GCs (if possible). | 13506 // to grow the heap without causing GCs (if possible). |
13494 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13507 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13495 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13508 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13496 "Runtime::PerformGC"); | 13509 "Runtime::PerformGC"); |
13497 } | 13510 } |
13498 } | 13511 } |
13499 | 13512 |
13500 | 13513 |
13501 } } // namespace v8::internal | 13514 } } // namespace v8::internal |
OLD | NEW |