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

Side by Side Diff: src/heap/heap.cc

Issue 1765713003: Reland "Speed up the LookupIterator" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: wrap in assertThrows Created 4 years, 9 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/api-natives.cc ('k') | src/heap/objects-visiting.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/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 3557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3568 DCHECK(!allocation.To(&obj) || !obj->IsJSGlobalObject()); 3568 DCHECK(!allocation.To(&obj) || !obj->IsJSGlobalObject());
3569 #endif 3569 #endif
3570 return allocation; 3570 return allocation;
3571 } 3571 }
3572 3572
3573 3573
3574 AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) { 3574 AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) {
3575 // Make the clone. 3575 // Make the clone.
3576 Map* map = source->map(); 3576 Map* map = source->map();
3577 3577
3578 // We can only clone regexps, normal objects or arrays. Copying anything else 3578 // We can only clone regexps, normal objects, api objects or arrays. Copying
3579 // will break invariants. 3579 // anything else will break invariants.
3580 CHECK(map->instance_type() == JS_REGEXP_TYPE || 3580 CHECK(map->instance_type() == JS_REGEXP_TYPE ||
3581 map->instance_type() == JS_OBJECT_TYPE || 3581 map->instance_type() == JS_OBJECT_TYPE ||
3582 map->instance_type() == JS_ARRAY_TYPE); 3582 map->instance_type() == JS_ARRAY_TYPE ||
3583 map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE);
3583 3584
3584 int object_size = map->instance_size(); 3585 int object_size = map->instance_size();
3585 HeapObject* clone = nullptr; 3586 HeapObject* clone = nullptr;
3586 3587
3587 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type())); 3588 DCHECK(site == NULL || AllocationSite::CanTrack(map->instance_type()));
3588 3589
3589 int adjusted_object_size = 3590 int adjusted_object_size =
3590 site != NULL ? object_size + AllocationMemento::kSize : object_size; 3591 site != NULL ? object_size + AllocationMemento::kSize : object_size;
3591 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE); 3592 AllocationResult allocation = AllocateRaw(adjusted_object_size, NEW_SPACE);
3592 if (!allocation.To(&clone)) return allocation; 3593 if (!allocation.To(&clone)) return allocation;
(...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 } 6344 }
6344 6345
6345 6346
6346 // static 6347 // static
6347 int Heap::GetStaticVisitorIdForMap(Map* map) { 6348 int Heap::GetStaticVisitorIdForMap(Map* map) {
6348 return StaticVisitorBase::GetVisitorId(map); 6349 return StaticVisitorBase::GetVisitorId(map);
6349 } 6350 }
6350 6351
6351 } // namespace internal 6352 } // namespace internal
6352 } // namespace v8 6353 } // namespace v8
OLDNEW
« no previous file with comments | « src/api-natives.cc ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698