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

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

Issue 2809923002: Unify implementations of Map handles vectors and lists (Closed)
Patch Set: Review feedback Created 3 years, 7 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
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/type-info.h" 5 #include "src/type-info.h"
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 CollectReceiverTypes(&nexus, types); 438 CollectReceiverTypes(&nexus, types);
439 } else { 439 } else {
440 DCHECK(IsKeyedStoreICKind(kind)); 440 DCHECK(IsKeyedStoreICKind(kind));
441 KeyedStoreICNexus nexus(feedback_vector_, slot); 441 KeyedStoreICNexus nexus(feedback_vector_, slot);
442 CollectReceiverTypes(&nexus, types); 442 CollectReceiverTypes(&nexus, types);
443 } 443 }
444 } 444 }
445 445
446 void TypeFeedbackOracle::CollectReceiverTypes(FeedbackNexus* nexus, 446 void TypeFeedbackOracle::CollectReceiverTypes(FeedbackNexus* nexus,
447 SmallMapList* types) { 447 SmallMapList* types) {
448 MapHandleList maps; 448 MapHandles maps;
449 if (nexus->ExtractMaps(&maps) == 0) { 449 if (nexus->ExtractMaps(&maps) == 0) {
450 return; 450 return;
451 } 451 }
452 452
453 types->Reserve(maps.length(), zone()); 453 types->Reserve(static_cast<int>(maps.size()), zone());
454 for (int i = 0; i < maps.length(); i++) { 454 for (Handle<Map> map : maps) {
455 types->AddMapIfMissing(maps.at(i), zone()); 455 types->AddMapIfMissing(map, zone());
456 } 456 }
457 } 457 }
458 458
459 459
460 uint16_t TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) { 460 uint16_t TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
461 Handle<Object> object = GetInfo(id); 461 Handle<Object> object = GetInfo(id);
462 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0; 462 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0;
463 } 463 }
464 464
465 465
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 // Dictionary has been allocated with sufficient size for all elements. 540 // Dictionary has been allocated with sufficient size for all elements.
541 DisallowHeapAllocation no_need_to_resize_dictionary; 541 DisallowHeapAllocation no_need_to_resize_dictionary;
542 HandleScope scope(isolate()); 542 HandleScope scope(isolate());
543 USE(UnseededNumberDictionary::AtNumberPut( 543 USE(UnseededNumberDictionary::AtNumberPut(
544 dictionary_, IdToKey(ast_id), handle(target, isolate()))); 544 dictionary_, IdToKey(ast_id), handle(target, isolate())));
545 } 545 }
546 546
547 547
548 } // namespace internal 548 } // namespace internal
549 } // namespace v8 549 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698