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 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 ASSERT(target_shared->code()->gc_metadata() == NULL); | 3124 ASSERT(target_shared->code()->gc_metadata() == NULL); |
3125 ASSERT(source_shared->code()->gc_metadata() == NULL); | 3125 ASSERT(source_shared->code()->gc_metadata() == NULL); |
3126 target_shared->set_dont_flush(true); | 3126 target_shared->set_dont_flush(true); |
3127 source_shared->set_dont_flush(true); | 3127 source_shared->set_dont_flush(true); |
3128 | 3128 |
3129 // Set the code, scope info, formal parameter count, and the length | 3129 // Set the code, scope info, formal parameter count, and the length |
3130 // of the target shared function info. | 3130 // of the target shared function info. |
3131 target_shared->ReplaceCode(source_shared->code()); | 3131 target_shared->ReplaceCode(source_shared->code()); |
3132 target_shared->set_scope_info(source_shared->scope_info()); | 3132 target_shared->set_scope_info(source_shared->scope_info()); |
3133 target_shared->set_length(source_shared->length()); | 3133 target_shared->set_length(source_shared->length()); |
| 3134 target_shared->set_feedback_vector(source_shared->feedback_vector()); |
3134 target_shared->set_formal_parameter_count( | 3135 target_shared->set_formal_parameter_count( |
3135 source_shared->formal_parameter_count()); | 3136 source_shared->formal_parameter_count()); |
3136 target_shared->set_script(source_shared->script()); | 3137 target_shared->set_script(source_shared->script()); |
3137 target_shared->set_start_position_and_type( | 3138 target_shared->set_start_position_and_type( |
3138 source_shared->start_position_and_type()); | 3139 source_shared->start_position_and_type()); |
3139 target_shared->set_end_position(source_shared->end_position()); | 3140 target_shared->set_end_position(source_shared->end_position()); |
3140 bool was_native = target_shared->native(); | 3141 bool was_native = target_shared->native(); |
3141 target_shared->set_compiler_hints(source_shared->compiler_hints()); | 3142 target_shared->set_compiler_hints(source_shared->compiler_hints()); |
3142 target_shared->set_native(was_native); | 3143 target_shared->set_native(was_native); |
3143 | 3144 |
(...skipping 5466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8610 Deoptimizer::DeoptimizeFunction(*function); | 8611 Deoptimizer::DeoptimizeFunction(*function); |
8611 | 8612 |
8612 return isolate->heap()->undefined_value(); | 8613 return isolate->heap()->undefined_value(); |
8613 } | 8614 } |
8614 | 8615 |
8615 | 8616 |
8616 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { | 8617 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { |
8617 HandleScope scope(isolate); | 8618 HandleScope scope(isolate); |
8618 ASSERT(args.length() == 1); | 8619 ASSERT(args.length() == 1); |
8619 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8620 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 8621 function->shared()->ClearTypeFeedbackInfo(isolate->heap()); |
8620 Code* unoptimized = function->shared()->code(); | 8622 Code* unoptimized = function->shared()->code(); |
8621 if (unoptimized->kind() == Code::FUNCTION) { | 8623 if (unoptimized->kind() == Code::FUNCTION) { |
8622 unoptimized->ClearInlineCaches(); | 8624 unoptimized->ClearInlineCaches(); |
8623 unoptimized->ClearTypeFeedbackInfo(isolate->heap()); | |
8624 } | 8625 } |
8625 return isolate->heap()->undefined_value(); | 8626 return isolate->heap()->undefined_value(); |
8626 } | 8627 } |
8627 | 8628 |
8628 | 8629 |
8629 RUNTIME_FUNCTION(Runtime_RunningInSimulator) { | 8630 RUNTIME_FUNCTION(Runtime_RunningInSimulator) { |
8630 SealHandleScope shs(isolate); | 8631 SealHandleScope shs(isolate); |
8631 ASSERT(args.length() == 0); | 8632 ASSERT(args.length() == 0); |
8632 #if defined(USE_SIMULATOR) | 8633 #if defined(USE_SIMULATOR) |
8633 return isolate->heap()->true_value(); | 8634 return isolate->heap()->true_value(); |
(...skipping 6510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15144 } | 15145 } |
15145 return NULL; | 15146 return NULL; |
15146 } | 15147 } |
15147 | 15148 |
15148 | 15149 |
15149 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15150 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15150 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15151 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15151 } | 15152 } |
15152 | 15153 |
15153 } } // namespace v8::internal | 15154 } } // namespace v8::internal |
OLD | NEW |