| 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 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2922 // Mark both, the source and the target, as un-flushable because the | 2922 // Mark both, the source and the target, as un-flushable because the |
| 2923 // shared unoptimized code makes them impossible to enqueue in a list. | 2923 // shared unoptimized code makes them impossible to enqueue in a list. |
| 2924 ASSERT(target_shared->code()->gc_metadata() == NULL); | 2924 ASSERT(target_shared->code()->gc_metadata() == NULL); |
| 2925 ASSERT(source_shared->code()->gc_metadata() == NULL); | 2925 ASSERT(source_shared->code()->gc_metadata() == NULL); |
| 2926 target_shared->set_dont_flush(true); | 2926 target_shared->set_dont_flush(true); |
| 2927 source_shared->set_dont_flush(true); | 2927 source_shared->set_dont_flush(true); |
| 2928 | 2928 |
| 2929 // Set the code, scope info, formal parameter count, and the length | 2929 // Set the code, scope info, formal parameter count, and the length |
| 2930 // of the target shared function info. | 2930 // of the target shared function info. |
| 2931 target_shared->ReplaceCode(source_shared->code()); | 2931 target_shared->ReplaceCode(source_shared->code()); |
| 2932 target_shared->set_feedback_vector(source_shared->feedback_vector()); | |
| 2933 target_shared->set_scope_info(source_shared->scope_info()); | 2932 target_shared->set_scope_info(source_shared->scope_info()); |
| 2934 target_shared->set_length(source_shared->length()); | 2933 target_shared->set_length(source_shared->length()); |
| 2935 target_shared->set_formal_parameter_count( | 2934 target_shared->set_formal_parameter_count( |
| 2936 source_shared->formal_parameter_count()); | 2935 source_shared->formal_parameter_count()); |
| 2937 target_shared->set_script(source_shared->script()); | 2936 target_shared->set_script(source_shared->script()); |
| 2938 target_shared->set_start_position_and_type( | 2937 target_shared->set_start_position_and_type( |
| 2939 source_shared->start_position_and_type()); | 2938 source_shared->start_position_and_type()); |
| 2940 target_shared->set_end_position(source_shared->end_position()); | 2939 target_shared->set_end_position(source_shared->end_position()); |
| 2941 bool was_native = target_shared->native(); | 2940 bool was_native = target_shared->native(); |
| 2942 target_shared->set_compiler_hints(source_shared->compiler_hints()); | 2941 target_shared->set_compiler_hints(source_shared->compiler_hints()); |
| (...skipping 5528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8471 Deoptimizer::DeoptimizeFunction(*function); | 8470 Deoptimizer::DeoptimizeFunction(*function); |
| 8472 | 8471 |
| 8473 return isolate->heap()->undefined_value(); | 8472 return isolate->heap()->undefined_value(); |
| 8474 } | 8473 } |
| 8475 | 8474 |
| 8476 | 8475 |
| 8477 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { | 8476 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { |
| 8478 HandleScope scope(isolate); | 8477 HandleScope scope(isolate); |
| 8479 ASSERT(args.length() == 1); | 8478 ASSERT(args.length() == 1); |
| 8480 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8479 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 8481 function->shared()->ClearTypeFeedbackInfo(isolate->heap()); | |
| 8482 Code* unoptimized = function->shared()->code(); | 8480 Code* unoptimized = function->shared()->code(); |
| 8483 if (unoptimized->kind() == Code::FUNCTION) { | 8481 if (unoptimized->kind() == Code::FUNCTION) { |
| 8484 unoptimized->ClearInlineCaches(); | 8482 unoptimized->ClearInlineCaches(); |
| 8483 unoptimized->ClearTypeFeedbackInfo(isolate->heap()); |
| 8485 } | 8484 } |
| 8486 return isolate->heap()->undefined_value(); | 8485 return isolate->heap()->undefined_value(); |
| 8487 } | 8486 } |
| 8488 | 8487 |
| 8489 | 8488 |
| 8490 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { | 8489 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { |
| 8491 SealHandleScope shs(isolate); | 8490 SealHandleScope shs(isolate); |
| 8492 #if defined(USE_SIMULATOR) | 8491 #if defined(USE_SIMULATOR) |
| 8493 return isolate->heap()->true_value(); | 8492 return isolate->heap()->true_value(); |
| 8494 #else | 8493 #else |
| (...skipping 6479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14974 // Handle last resort GC and make sure to allow future allocations | 14973 // Handle last resort GC and make sure to allow future allocations |
| 14975 // to grow the heap without causing GCs (if possible). | 14974 // to grow the heap without causing GCs (if possible). |
| 14976 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14975 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14977 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14976 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14978 "Runtime::PerformGC"); | 14977 "Runtime::PerformGC"); |
| 14979 } | 14978 } |
| 14980 } | 14979 } |
| 14981 | 14980 |
| 14982 | 14981 |
| 14983 } } // namespace v8::internal | 14982 } } // namespace v8::internal |
| OLD | NEW |