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 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2935 // Mark both, the source and the target, as un-flushable because the | 2935 // Mark both, the source and the target, as un-flushable because the |
2936 // shared unoptimized code makes them impossible to enqueue in a list. | 2936 // shared unoptimized code makes them impossible to enqueue in a list. |
2937 ASSERT(target_shared->code()->gc_metadata() == NULL); | 2937 ASSERT(target_shared->code()->gc_metadata() == NULL); |
2938 ASSERT(source_shared->code()->gc_metadata() == NULL); | 2938 ASSERT(source_shared->code()->gc_metadata() == NULL); |
2939 target_shared->set_dont_flush(true); | 2939 target_shared->set_dont_flush(true); |
2940 source_shared->set_dont_flush(true); | 2940 source_shared->set_dont_flush(true); |
2941 | 2941 |
2942 // Set the code, scope info, formal parameter count, and the length | 2942 // Set the code, scope info, formal parameter count, and the length |
2943 // of the target shared function info. | 2943 // of the target shared function info. |
2944 target_shared->ReplaceCode(source_shared->code()); | 2944 target_shared->ReplaceCode(source_shared->code()); |
| 2945 target_shared->set_feedback_vector(source_shared->feedback_vector()); |
2945 target_shared->set_scope_info(source_shared->scope_info()); | 2946 target_shared->set_scope_info(source_shared->scope_info()); |
2946 target_shared->set_length(source_shared->length()); | 2947 target_shared->set_length(source_shared->length()); |
2947 target_shared->set_formal_parameter_count( | 2948 target_shared->set_formal_parameter_count( |
2948 source_shared->formal_parameter_count()); | 2949 source_shared->formal_parameter_count()); |
2949 target_shared->set_script(source_shared->script()); | 2950 target_shared->set_script(source_shared->script()); |
2950 target_shared->set_start_position_and_type( | 2951 target_shared->set_start_position_and_type( |
2951 source_shared->start_position_and_type()); | 2952 source_shared->start_position_and_type()); |
2952 target_shared->set_end_position(source_shared->end_position()); | 2953 target_shared->set_end_position(source_shared->end_position()); |
2953 bool was_native = target_shared->native(); | 2954 bool was_native = target_shared->native(); |
2954 target_shared->set_compiler_hints(source_shared->compiler_hints()); | 2955 target_shared->set_compiler_hints(source_shared->compiler_hints()); |
(...skipping 5554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8509 Deoptimizer::DeoptimizeFunction(*function); | 8510 Deoptimizer::DeoptimizeFunction(*function); |
8510 | 8511 |
8511 return isolate->heap()->undefined_value(); | 8512 return isolate->heap()->undefined_value(); |
8512 } | 8513 } |
8513 | 8514 |
8514 | 8515 |
8515 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { | 8516 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { |
8516 HandleScope scope(isolate); | 8517 HandleScope scope(isolate); |
8517 ASSERT(args.length() == 1); | 8518 ASSERT(args.length() == 1); |
8518 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8519 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 8520 function->shared()->ClearTypeFeedbackInfo(isolate->heap()); |
8519 Code* unoptimized = function->shared()->code(); | 8521 Code* unoptimized = function->shared()->code(); |
8520 if (unoptimized->kind() == Code::FUNCTION) { | 8522 if (unoptimized->kind() == Code::FUNCTION) { |
8521 unoptimized->ClearInlineCaches(); | 8523 unoptimized->ClearInlineCaches(); |
8522 unoptimized->ClearTypeFeedbackInfo(isolate->heap()); | |
8523 } | 8524 } |
8524 return isolate->heap()->undefined_value(); | 8525 return isolate->heap()->undefined_value(); |
8525 } | 8526 } |
8526 | 8527 |
8527 | 8528 |
8528 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { | 8529 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { |
8529 SealHandleScope shs(isolate); | 8530 SealHandleScope shs(isolate); |
8530 #if defined(USE_SIMULATOR) | 8531 #if defined(USE_SIMULATOR) |
8531 return isolate->heap()->true_value(); | 8532 return isolate->heap()->true_value(); |
8532 #else | 8533 #else |
(...skipping 6412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14945 // Handle last resort GC and make sure to allow future allocations | 14946 // Handle last resort GC and make sure to allow future allocations |
14946 // to grow the heap without causing GCs (if possible). | 14947 // to grow the heap without causing GCs (if possible). |
14947 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14948 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14948 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14949 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14949 "Runtime::PerformGC"); | 14950 "Runtime::PerformGC"); |
14950 } | 14951 } |
14951 } | 14952 } |
14952 | 14953 |
14953 | 14954 |
14954 } } // namespace v8::internal | 14955 } } // namespace v8::internal |
OLD | NEW |