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 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3230 current_block()->FinishExit(instr); | 3230 current_block()->FinishExit(instr); |
3231 set_current_block(NULL); | 3231 set_current_block(NULL); |
3232 } | 3232 } |
3233 | 3233 |
3234 // If the checksum of the number of type info changes is the same as the | 3234 // If the checksum of the number of type info changes is the same as the |
3235 // last time this function was compiled, then this recompile is likely not | 3235 // last time this function was compiled, then this recompile is likely not |
3236 // due to missing/inadequate type feedback, but rather too aggressive | 3236 // due to missing/inadequate type feedback, but rather too aggressive |
3237 // optimization. Disable optimistic LICM in that case. | 3237 // optimization. Disable optimistic LICM in that case. |
3238 Handle<Code> unoptimized_code(info()->shared_info()->code()); | 3238 Handle<Code> unoptimized_code(info()->shared_info()->code()); |
3239 ASSERT(unoptimized_code->kind() == Code::FUNCTION); | 3239 ASSERT(unoptimized_code->kind() == Code::FUNCTION); |
3240 Handle<Object> maybe_type_info(unoptimized_code->type_feedback_info()); | 3240 Handle<Object> maybe_type_info(unoptimized_code->type_feedback_info(), |
Michael Starzinger
2012/11/15 21:24:25
I know this isn't your change, it must be somethin
Sven Panne
2012/11/16 08:24:37
Done.
| |
3241 isolate()); | |
3241 Handle<TypeFeedbackInfo> type_info( | 3242 Handle<TypeFeedbackInfo> type_info( |
3242 Handle<TypeFeedbackInfo>::cast(maybe_type_info)); | 3243 Handle<TypeFeedbackInfo>::cast(maybe_type_info)); |
3243 int checksum = type_info->own_type_change_checksum(); | 3244 int checksum = type_info->own_type_change_checksum(); |
3244 int composite_checksum = graph()->update_type_change_checksum(checksum); | 3245 int composite_checksum = graph()->update_type_change_checksum(checksum); |
3245 graph()->set_use_optimistic_licm( | 3246 graph()->set_use_optimistic_licm( |
3246 !type_info->matches_inlined_type_change_checksum(composite_checksum)); | 3247 !type_info->matches_inlined_type_change_checksum(composite_checksum)); |
3247 type_info->set_inlined_type_change_checksum(composite_checksum); | 3248 type_info->set_inlined_type_change_checksum(composite_checksum); |
3248 } | 3249 } |
3249 | 3250 |
3250 return graph(); | 3251 return graph(); |
(...skipping 3857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7108 target_shared->DisableOptimization("inlining bailed out"); | 7109 target_shared->DisableOptimization("inlining bailed out"); |
7109 inline_bailout_ = true; | 7110 inline_bailout_ = true; |
7110 delete target_state; | 7111 delete target_state; |
7111 return true; | 7112 return true; |
7112 } | 7113 } |
7113 | 7114 |
7114 // Update inlined nodes count. | 7115 // Update inlined nodes count. |
7115 inlined_count_ += nodes_added; | 7116 inlined_count_ += nodes_added; |
7116 | 7117 |
7117 ASSERT(unoptimized_code->kind() == Code::FUNCTION); | 7118 ASSERT(unoptimized_code->kind() == Code::FUNCTION); |
7118 Handle<Object> maybe_type_info(unoptimized_code->type_feedback_info()); | 7119 Handle<Object> maybe_type_info(unoptimized_code->type_feedback_info(), |
Michael Starzinger
2012/11/15 21:24:25
Likewise.
Sven Panne
2012/11/16 08:24:37
Done.
| |
7120 isolate()); | |
7119 Handle<TypeFeedbackInfo> type_info( | 7121 Handle<TypeFeedbackInfo> type_info( |
7120 Handle<TypeFeedbackInfo>::cast(maybe_type_info)); | 7122 Handle<TypeFeedbackInfo>::cast(maybe_type_info)); |
7121 graph()->update_type_change_checksum(type_info->own_type_change_checksum()); | 7123 graph()->update_type_change_checksum(type_info->own_type_change_checksum()); |
7122 | 7124 |
7123 TraceInline(target, caller, NULL); | 7125 TraceInline(target, caller, NULL); |
7124 | 7126 |
7125 if (current_block() != NULL) { | 7127 if (current_block() != NULL) { |
7126 FunctionState* state = function_state(); | 7128 FunctionState* state = function_state(); |
7127 if (state->inlining_kind() == CONSTRUCT_CALL_RETURN) { | 7129 if (state->inlining_kind() == CONSTRUCT_CALL_RETURN) { |
7128 // Falling off the end of an inlined construct call. In a test context the | 7130 // Falling off the end of an inlined construct call. In a test context the |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7635 HValue* context = environment()->LookupContext(); | 7637 HValue* context = environment()->LookupContext(); |
7636 call = PreProcessCall( | 7638 call = PreProcessCall( |
7637 new(zone()) HCallNamed(context, name, argument_count)); | 7639 new(zone()) HCallNamed(context, name, argument_count)); |
7638 } | 7640 } |
7639 | 7641 |
7640 } else { | 7642 } else { |
7641 expr->RecordTypeFeedback(oracle(), CALL_AS_FUNCTION); | 7643 expr->RecordTypeFeedback(oracle(), CALL_AS_FUNCTION); |
7642 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 7644 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
7643 bool global_call = proxy != NULL && proxy->var()->IsUnallocated(); | 7645 bool global_call = proxy != NULL && proxy->var()->IsUnallocated(); |
7644 | 7646 |
7645 if (proxy != NULL && proxy->var()->is_possibly_eval()) { | 7647 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) { |
7646 return Bailout("possible direct call to eval"); | 7648 return Bailout("possible direct call to eval"); |
7647 } | 7649 } |
7648 | 7650 |
7649 if (global_call) { | 7651 if (global_call) { |
7650 Variable* var = proxy->var(); | 7652 Variable* var = proxy->var(); |
7651 bool known_global_function = false; | 7653 bool known_global_function = false; |
7652 // If there is a global property cell for the name at compile time and | 7654 // If there is a global property cell for the name at compile time and |
7653 // access check is not enabled we assume that the function will not change | 7655 // access check is not enabled we assume that the function will not change |
7654 // and generate optimized code for calling the function. | 7656 // and generate optimized code for calling the function. |
7655 LookupResult lookup(isolate()); | 7657 LookupResult lookup(isolate()); |
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10037 } | 10039 } |
10038 } | 10040 } |
10039 | 10041 |
10040 #ifdef DEBUG | 10042 #ifdef DEBUG |
10041 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10043 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10042 if (allocator_ != NULL) allocator_->Verify(); | 10044 if (allocator_ != NULL) allocator_->Verify(); |
10043 #endif | 10045 #endif |
10044 } | 10046 } |
10045 | 10047 |
10046 } } // namespace v8::internal | 10048 } } // namespace v8::internal |
OLD | NEW |