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

Side by Side Diff: src/objects.cc

Issue 19595004: Rename AllocationSiteInfo to AllocationMemento (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/objects.h ('k') | src/objects-debug.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 8902 matching lines...) Expand 10 before | Expand all | Expand 10 after
8913 if (Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) { 8913 if (Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) {
8914 MemoryChunk::IncrementLiveBytesFromMutator(start_of_string, -delta); 8914 MemoryChunk::IncrementLiveBytesFromMutator(start_of_string, -delta);
8915 } 8915 }
8916 8916
8917 8917
8918 if (new_length == 0) return heap->isolate()->factory()->empty_string(); 8918 if (new_length == 0) return heap->isolate()->factory()->empty_string();
8919 return string; 8919 return string;
8920 } 8920 }
8921 8921
8922 8922
8923 AllocationSiteInfo* AllocationSiteInfo::FindForJSObject(JSObject* object) { 8923 AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) {
8924 // Currently, AllocationSiteInfo objects are only allocated immediately 8924 // Currently, AllocationMemento objects are only allocated immediately
8925 // after JSArrays in NewSpace, and detecting whether a JSArray has one 8925 // after JSArrays in NewSpace, and detecting whether a JSArray has one
8926 // involves carefully checking the object immediately after the JSArray 8926 // involves carefully checking the object immediately after the JSArray
8927 // (if there is one) to see if it's an AllocationSiteInfo. 8927 // (if there is one) to see if it's an AllocationMemento.
8928 if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) { 8928 if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) {
8929 Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) + 8929 Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
8930 object->Size(); 8930 object->Size();
8931 if ((ptr_end + AllocationSiteInfo::kSize) <= 8931 if ((ptr_end + AllocationMemento::kSize) <=
8932 object->GetHeap()->NewSpaceTop()) { 8932 object->GetHeap()->NewSpaceTop()) {
8933 // There is room in newspace for allocation info. Do we have some? 8933 // There is room in newspace for allocation info. Do we have some?
8934 Map** possible_allocation_site_info_map = 8934 Map** possible_allocation_memento_map =
8935 reinterpret_cast<Map**>(ptr_end); 8935 reinterpret_cast<Map**>(ptr_end);
8936 if (*possible_allocation_site_info_map == 8936 if (*possible_allocation_memento_map ==
8937 object->GetHeap()->allocation_site_info_map()) { 8937 object->GetHeap()->allocation_memento_map()) {
8938 AllocationSiteInfo* info = AllocationSiteInfo::cast( 8938 AllocationMemento* memento = AllocationMemento::cast(
8939 reinterpret_cast<Object*>(ptr_end + 1)); 8939 reinterpret_cast<Object*>(ptr_end + 1));
8940 return info; 8940 return memento;
8941 } 8941 }
8942 } 8942 }
8943 } 8943 }
8944 return NULL; 8944 return NULL;
8945 } 8945 }
8946 8946
8947 8947
8948 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) { 8948 uint32_t StringHasher::MakeArrayIndexHash(uint32_t value, int length) {
8949 // For array indexes mix the length into the hash as an array index could 8949 // For array indexes mix the length into the hash as an array index could
8950 // be zero. 8950 // be zero.
(...skipping 3419 matching lines...) Expand 10 before | Expand all | Expand 10 after
12370 object->TransitionElementsKind(to_kind), 12370 object->TransitionElementsKind(to_kind),
12371 Object); 12371 Object);
12372 } 12372 }
12373 12373
12374 12374
12375 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { 12375 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) {
12376 if (!FLAG_track_allocation_sites || !IsJSArray()) { 12376 if (!FLAG_track_allocation_sites || !IsJSArray()) {
12377 return this; 12377 return this;
12378 } 12378 }
12379 12379
12380 AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(this); 12380 AllocationMemento* memento = AllocationMemento::FindForJSObject(this);
12381 if (info == NULL || !info->IsValid()) { 12381 if (memento == NULL || !memento->IsValid()) {
12382 return this; 12382 return this;
12383 } 12383 }
12384 12384
12385 // Walk through to the Allocation Site 12385 // Walk through to the Allocation Site
12386 AllocationSite* site = info->GetAllocationSite(); 12386 AllocationSite* site = memento->GetAllocationSite();
12387 if (site->IsLiteralSite()) { 12387 if (site->IsLiteralSite()) {
12388 JSArray* transition_info = JSArray::cast(site->transition_info()); 12388 JSArray* transition_info = JSArray::cast(site->transition_info());
12389 ElementsKind kind = transition_info->GetElementsKind(); 12389 ElementsKind kind = transition_info->GetElementsKind();
12390 // if kind is holey ensure that to_kind is as well. 12390 // if kind is holey ensure that to_kind is as well.
12391 if (IsHoleyElementsKind(kind)) { 12391 if (IsHoleyElementsKind(kind)) {
12392 to_kind = GetHoleyElementsKind(to_kind); 12392 to_kind = GetHoleyElementsKind(to_kind);
12393 } 12393 }
12394 if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) { 12394 if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) {
12395 // If the array is huge, it's not likely to be defined in a local 12395 // If the array is huge, it's not likely to be defined in a local
12396 // function, so we shouldn't make new instances of it very often. 12396 // function, so we shouldn't make new instances of it very often.
(...skipping 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after
15955 15955
15956 void PropertyCell::AddDependentCode(Handle<Code> code) { 15956 void PropertyCell::AddDependentCode(Handle<Code> code) {
15957 Handle<DependentCode> codes = DependentCode::Insert( 15957 Handle<DependentCode> codes = DependentCode::Insert(
15958 Handle<DependentCode>(dependent_code()), 15958 Handle<DependentCode>(dependent_code()),
15959 DependentCode::kPropertyCellChangedGroup, code); 15959 DependentCode::kPropertyCellChangedGroup, code);
15960 if (*codes != dependent_code()) set_dependent_code(*codes); 15960 if (*codes != dependent_code()) set_dependent_code(*codes);
15961 } 15961 }
15962 15962
15963 15963
15964 } } // namespace v8::internal 15964 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698