Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: src/type-info.cc

Issue 246743003: Dictionary::New() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698