Chromium Code Reviews

Side by Side Diff: src/heap.cc

Issue 226153002: Callers of ElementsAccessor::Validate() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« src/heap.h ('K') | « src/heap.h ('k') | src/objects.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 4629 matching lines...)
4640 } 4640 }
4641 } 4641 }
4642 if (!maybe_elms->To(&elms)) return maybe_elms; 4642 if (!maybe_elms->To(&elms)) return maybe_elms;
4643 4643
4644 array->set_elements(elms); 4644 array->set_elements(elms);
4645 array->set_length(Smi::FromInt(length)); 4645 array->set_length(Smi::FromInt(length));
4646 return array; 4646 return array;
4647 } 4647 }
4648 4648
4649 4649
4650 MaybeObject* Heap::AllocateJSArrayWithElements( 4650 Handle<JSArray> Heap::AllocateJSArrayWithElements(
Yang 2014/04/07 07:20:48 Since this is now handlified, it belongs to factor
Igor Sheludko 2014/04/07 09:29:17 Done.
4651 FixedArrayBase* elements, 4651 Handle<FixedArrayBase> elements,
4652 ElementsKind elements_kind, 4652 ElementsKind elements_kind,
4653 int length, 4653 int length,
4654 PretenureFlag pretenure) { 4654 PretenureFlag pretenure) {
4655 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); 4655 ASSERT(length <= elements->length());
4656 JSArray* array; 4656 Handle<JSArray> array =
4657 if (!maybe_array->To(&array)) return maybe_array; 4657 isolate()->factory()->NewJSArray(elements_kind, pretenure);
4658 4658
4659 array->set_elements(elements); 4659 array->set_elements(*elements);
4660 array->set_length(Smi::FromInt(length)); 4660 array->set_length(Smi::FromInt(length));
4661 array->ValidateElements(); 4661 JSObject::ValidateElements(array);
4662 return array; 4662 return array;
4663 } 4663 }
4664 4664
4665 4665
4666 MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) { 4666 MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) {
4667 // Allocate map. 4667 // Allocate map.
4668 // TODO(rossberg): Once we optimize proxies, think about a scheme to share 4668 // TODO(rossberg): Once we optimize proxies, think about a scheme to share
4669 // maps. Will probably depend on the identity of the handler object, too. 4669 // maps. Will probably depend on the identity of the handler object, too.
4670 Map* map; 4670 Map* map;
4671 MaybeObject* maybe_map_obj = AllocateMap(JS_PROXY_TYPE, JSProxy::kSize); 4671 MaybeObject* maybe_map_obj = AllocateMap(JS_PROXY_TYPE, JSProxy::kSize);
(...skipping 3193 matching lines...)
7865 static_cast<int>(object_sizes_last_time_[index])); 7865 static_cast<int>(object_sizes_last_time_[index]));
7866 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7866 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7867 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7867 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7868 7868
7869 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7869 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7870 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7870 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7871 ClearObjectStats(); 7871 ClearObjectStats();
7872 } 7872 }
7873 7873
7874 } } // namespace v8::internal 7874 } } // namespace v8::internal
OLDNEW
« src/heap.h ('K') | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine