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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 void TypeFeedbackOracle::ProcessTypeFeedbackCells(Handle<Code> code) { | 755 void TypeFeedbackOracle::ProcessTypeFeedbackCells(Handle<Code> code) { |
756 Object* raw_info = code->type_feedback_info(); | 756 Object* raw_info = code->type_feedback_info(); |
757 if (!raw_info->IsTypeFeedbackInfo()) return; | 757 if (!raw_info->IsTypeFeedbackInfo()) return; |
758 Handle<TypeFeedbackCells> cache( | 758 Handle<TypeFeedbackCells> cache( |
759 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells()); | 759 TypeFeedbackInfo::cast(raw_info)->type_feedback_cells()); |
760 for (int i = 0; i < cache->CellCount(); i++) { | 760 for (int i = 0; i < cache->CellCount(); i++) { |
761 TypeFeedbackId ast_id = cache->AstId(i); | 761 TypeFeedbackId ast_id = cache->AstId(i); |
762 JSGlobalPropertyCell* cell = cache->Cell(i); | 762 JSGlobalPropertyCell* cell = cache->Cell(i); |
763 Object* value = cell->value(); | 763 Object* value = cell->value(); |
764 if (value->IsSmi() || | 764 if (value->IsSmi() || |
| 765 value->IsAllocationSite() || |
765 (value->IsJSFunction() && | 766 (value->IsJSFunction() && |
766 !CanRetainOtherContext(JSFunction::cast(value), | 767 !CanRetainOtherContext(JSFunction::cast(value), |
767 *native_context_))) { | 768 *native_context_))) { |
768 SetInfo(ast_id, cell); | 769 SetInfo(ast_id, cell); |
769 } | 770 } |
770 } | 771 } |
771 } | 772 } |
772 | 773 |
773 | 774 |
774 void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) { | 775 void TypeFeedbackOracle::SetInfo(TypeFeedbackId ast_id, Object* target) { |
775 ASSERT(dictionary_->FindEntry(IdToKey(ast_id)) == | 776 ASSERT(dictionary_->FindEntry(IdToKey(ast_id)) == |
776 UnseededNumberDictionary::kNotFound); | 777 UnseededNumberDictionary::kNotFound); |
777 MaybeObject* maybe_result = dictionary_->AtNumberPut(IdToKey(ast_id), target); | 778 MaybeObject* maybe_result = dictionary_->AtNumberPut(IdToKey(ast_id), target); |
778 USE(maybe_result); | 779 USE(maybe_result); |
779 #ifdef DEBUG | 780 #ifdef DEBUG |
780 Object* result = NULL; | 781 Object* result = NULL; |
781 // Dictionary has been allocated with sufficient size for all elements. | 782 // Dictionary has been allocated with sufficient size for all elements. |
782 ASSERT(maybe_result->ToObject(&result)); | 783 ASSERT(maybe_result->ToObject(&result)); |
783 ASSERT(*dictionary_ == result); | 784 ASSERT(*dictionary_ == result); |
784 #endif | 785 #endif |
785 } | 786 } |
786 | 787 |
787 } } // namespace v8::internal | 788 } } // namespace v8::internal |
OLD | NEW |