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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 for (RelocIterator it(*code, mask); !it.done(); it.next()) { | 438 for (RelocIterator it(*code, mask); !it.done(); it.next()) { |
439 infos->Add(*it.rinfo(), zone()); | 439 infos->Add(*it.rinfo(), zone()); |
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 void TypeFeedbackOracle::CreateDictionary(Handle<Code> code, | 444 void TypeFeedbackOracle::CreateDictionary(Handle<Code> code, |
445 ZoneList<RelocInfo>* infos) { | 445 ZoneList<RelocInfo>* infos) { |
446 AllowHeapAllocation allocation_allowed; | 446 AllowHeapAllocation allocation_allowed; |
447 Code* old_code = *code; | 447 Code* old_code = *code; |
448 dictionary_ = | 448 dictionary_ = UnseededNumberDictionary::New(isolate(), infos->length()); |
449 isolate()->factory()->NewUnseededNumberDictionary(infos->length()); | |
450 RelocateRelocInfos(infos, old_code, *code); | 449 RelocateRelocInfos(infos, old_code, *code); |
451 } | 450 } |
452 | 451 |
453 | 452 |
454 void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos, | 453 void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos, |
455 Code* old_code, | 454 Code* old_code, |
456 Code* new_code) { | 455 Code* new_code) { |
457 for (int i = 0; i < infos->length(); i++) { | 456 for (int i = 0; i < infos->length(); i++) { |
458 RelocInfo* info = &(*infos)[i]; | 457 RelocInfo* info = &(*infos)[i]; |
459 info->set_host(new_code); | 458 info->set_host(new_code); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 UnseededNumberDictionary::kNotFound); | 493 UnseededNumberDictionary::kNotFound); |
495 // Dictionary has been allocated with sufficient size for all elements. | 494 // Dictionary has been allocated with sufficient size for all elements. |
496 DisallowHeapAllocation no_need_to_resize_dictionary; | 495 DisallowHeapAllocation no_need_to_resize_dictionary; |
497 HandleScope scope(isolate()); | 496 HandleScope scope(isolate()); |
498 UnseededNumberDictionary::AtNumberPut( | 497 UnseededNumberDictionary::AtNumberPut( |
499 dictionary_, IdToKey(ast_id), handle(target, isolate())); | 498 dictionary_, IdToKey(ast_id), handle(target, isolate())); |
500 } | 499 } |
501 | 500 |
502 | 501 |
503 } } // namespace v8::internal | 502 } } // namespace v8::internal |
OLD | NEW |