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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 | 656 |
657 void TypeFeedbackOracle::CreateDictionary(Handle<Code> code, | 657 void TypeFeedbackOracle::CreateDictionary(Handle<Code> code, |
658 ZoneList<RelocInfo>* infos) { | 658 ZoneList<RelocInfo>* infos) { |
659 DisableAssertNoAllocation allocation_allowed; | 659 DisableAssertNoAllocation allocation_allowed; |
660 int cell_count = code->type_feedback_info()->IsTypeFeedbackInfo() | 660 int cell_count = code->type_feedback_info()->IsTypeFeedbackInfo() |
661 ? TypeFeedbackInfo::cast(code->type_feedback_info())-> | 661 ? TypeFeedbackInfo::cast(code->type_feedback_info())-> |
662 type_feedback_cells()->CellCount() | 662 type_feedback_cells()->CellCount() |
663 : 0; | 663 : 0; |
664 int length = infos->length() + cell_count; | 664 int length = infos->length() + cell_count; |
665 byte* old_start = code->instruction_start(); | 665 byte* old_start = code->instruction_start(); |
666 dictionary_ = FACTORY->NewUnseededNumberDictionary(length); | 666 dictionary_ = isolate()->factory()->NewUnseededNumberDictionary(length); |
667 byte* new_start = code->instruction_start(); | 667 byte* new_start = code->instruction_start(); |
668 RelocateRelocInfos(infos, old_start, new_start); | 668 RelocateRelocInfos(infos, old_start, new_start); |
669 } | 669 } |
670 | 670 |
671 | 671 |
672 void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos, | 672 void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos, |
673 byte* old_start, | 673 byte* old_start, |
674 byte* new_start) { | 674 byte* new_start) { |
675 for (int i = 0; i < infos->length(); i++) { | 675 for (int i = 0; i < infos->length(); i++) { |
676 RelocInfo* info = &(*infos)[i]; | 676 RelocInfo* info = &(*infos)[i]; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 USE(maybe_result); | 758 USE(maybe_result); |
759 #ifdef DEBUG | 759 #ifdef DEBUG |
760 Object* result = NULL; | 760 Object* result = NULL; |
761 // Dictionary has been allocated with sufficient size for all elements. | 761 // Dictionary has been allocated with sufficient size for all elements. |
762 ASSERT(maybe_result->ToObject(&result)); | 762 ASSERT(maybe_result->ToObject(&result)); |
763 ASSERT(*dictionary_ == result); | 763 ASSERT(*dictionary_ == result); |
764 #endif | 764 #endif |
765 } | 765 } |
766 | 766 |
767 } } // namespace v8::internal | 767 } } // namespace v8::internal |
OLD | NEW |