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

Side by Side Diff: src/builtins.cc

Issue 15094018: Create AllocationSite objects, pointed to by AllocationSiteInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment response 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/ast.cc ('k') | src/code-stubs.h » ('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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 JSArray* array; 206 JSArray* array;
207 if (CalledAsConstructor(isolate)) { 207 if (CalledAsConstructor(isolate)) {
208 array = JSArray::cast((*args)[0]); 208 array = JSArray::cast((*args)[0]);
209 // Initialize elements and length in case later allocations fail so that the 209 // Initialize elements and length in case later allocations fail so that the
210 // array object is initialized in a valid state. 210 // array object is initialized in a valid state.
211 MaybeObject* maybe_array = array->Initialize(0); 211 MaybeObject* maybe_array = array->Initialize(0);
212 if (maybe_array->IsFailure()) return maybe_array; 212 if (maybe_array->IsFailure()) return maybe_array;
213 213
214 AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(array); 214 AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(array);
215 ElementsKind to_kind = array->GetElementsKind(); 215 if (info != NULL && info->IsValid()) {
216 if (info != NULL && info->GetElementsKindPayload(&to_kind)) { 216 AllocationSite* site = info->GetAllocationSite();
217 ElementsKind to_kind = site->GetElementsKindPayload();
217 if (IsMoreGeneralElementsKindTransition(array->GetElementsKind(), 218 if (IsMoreGeneralElementsKindTransition(array->GetElementsKind(),
218 to_kind)) { 219 to_kind)) {
219 // We have advice that we should change the elements kind 220 // We have advice that we should change the elements kind
220 if (FLAG_trace_track_allocation_sites) { 221 if (FLAG_trace_track_allocation_sites) {
221 PrintF("AllocationSiteInfo: pre-transitioning array %p(%s->%s)\n", 222 PrintF("AllocationSiteInfo: pre-transitioning array %p(%s->%s)\n",
222 reinterpret_cast<void*>(array), 223 reinterpret_cast<void*>(array),
223 ElementsKindToString(array->GetElementsKind()), 224 ElementsKindToString(array->GetElementsKind()),
224 ElementsKindToString(to_kind)); 225 ElementsKindToString(to_kind));
225 } 226 }
226 227
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 return Handle<Code>(code_address); \ 1835 return Handle<Code>(code_address); \
1835 } 1836 }
1836 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1837 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1837 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1838 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1838 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1839 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1839 #undef DEFINE_BUILTIN_ACCESSOR_C 1840 #undef DEFINE_BUILTIN_ACCESSOR_C
1840 #undef DEFINE_BUILTIN_ACCESSOR_A 1841 #undef DEFINE_BUILTIN_ACCESSOR_A
1841 1842
1842 1843
1843 } } // namespace v8::internal 1844 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698