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

Side by Side Diff: src/handles.cc

Issue 72333004: Match max property descriptor length to corresponding bit fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 1 month 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/arm/macro-assembler-arm.cc ('k') | src/heap.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 // 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 bool cache_result) { 630 bool cache_result) {
631 Isolate* isolate = object->GetIsolate(); 631 Isolate* isolate = object->GetIsolate();
632 if (object->HasFastProperties()) { 632 if (object->HasFastProperties()) {
633 if (object->map()->instance_descriptors()->HasEnumCache()) { 633 if (object->map()->instance_descriptors()->HasEnumCache()) {
634 int own_property_count = object->map()->EnumLength(); 634 int own_property_count = object->map()->EnumLength();
635 // If we have an enum cache, but the enum length of the given map is set 635 // If we have an enum cache, but the enum length of the given map is set
636 // to kInvalidEnumCache, this means that the map itself has never used the 636 // to kInvalidEnumCache, this means that the map itself has never used the
637 // present enum cache. The first step to using the cache is to set the 637 // present enum cache. The first step to using the cache is to set the
638 // enum length of the map by counting the number of own descriptors that 638 // enum length of the map by counting the number of own descriptors that
639 // are not DONT_ENUM or SYMBOLIC. 639 // are not DONT_ENUM or SYMBOLIC.
640 if (own_property_count == Map::kInvalidEnumCache) { 640 if (own_property_count == kInvalidEnumCacheSentinel) {
641 own_property_count = object->map()->NumberOfDescribedProperties( 641 own_property_count = object->map()->NumberOfDescribedProperties(
642 OWN_DESCRIPTORS, DONT_SHOW); 642 OWN_DESCRIPTORS, DONT_SHOW);
643 643
644 if (cache_result) object->map()->SetEnumLength(own_property_count); 644 if (cache_result) object->map()->SetEnumLength(own_property_count);
645 } 645 }
646 646
647 DescriptorArray* desc = object->map()->instance_descriptors(); 647 DescriptorArray* desc = object->map()->instance_descriptors();
648 Handle<FixedArray> keys(desc->GetEnumCache(), isolate); 648 Handle<FixedArray> keys(desc->GetEnumCache(), isolate);
649 649
650 // In case the number of properties required in the enum are actually 650 // In case the number of properties required in the enum are actually
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 Handle<Code> code) { 795 Handle<Code> code) {
796 heap->EnsureWeakObjectToCodeTable(); 796 heap->EnsureWeakObjectToCodeTable();
797 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); 797 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object));
798 dep = DependentCode::Insert(dep, DependentCode::kWeaklyEmbeddedGroup, code); 798 dep = DependentCode::Insert(dep, DependentCode::kWeaklyEmbeddedGroup, code);
799 CALL_HEAP_FUNCTION_VOID(heap->isolate(), 799 CALL_HEAP_FUNCTION_VOID(heap->isolate(),
800 heap->AddWeakObjectToCodeDependency(*object, *dep)); 800 heap->AddWeakObjectToCodeDependency(*object, *dep));
801 } 801 }
802 802
803 803
804 } } // namespace v8::internal 804 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698