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

Unified Diff: src/objects-inl.h

Issue 8177005: Active smi-only optimizations for large array literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index c579d373f7207416134bfd8d47dd7f8a539c9e90..cebf9be074b3ec0458a523754de240e174a2fcde 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1306,8 +1306,7 @@ FixedArrayBase* JSObject::elements() {
void JSObject::ValidateSmiOnlyElements() {
#if DEBUG
- if (FLAG_smi_only_arrays &&
- map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS) {
+ if (map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS) {
Heap* heap = GetHeap();
// Don't use elements, since integrity checks will fail if there
// are filler pointers in the array.
@@ -1332,8 +1331,7 @@ MaybeObject* JSObject::EnsureCanContainNonSmiElements() {
#if DEBUG
ValidateSmiOnlyElements();
#endif
- if (FLAG_smi_only_arrays &&
- (map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS)) {
+ if ((map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS)) {
Object* obj;
MaybeObject* maybe_obj = GetElementsTransitionMap(FAST_ELEMENTS);
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
@@ -1345,8 +1343,7 @@ MaybeObject* JSObject::EnsureCanContainNonSmiElements() {
MaybeObject* JSObject::EnsureCanContainElements(Object** objects,
uint32_t count) {
- if (FLAG_smi_only_arrays &&
- map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS) {
+ if (map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS) {
for (uint32_t i = 0; i < count; ++i) {
Object* current = *objects++;
if (!current->IsSmi() && current != GetHeap()->the_hole_value()) {
@@ -1359,13 +1356,9 @@ MaybeObject* JSObject::EnsureCanContainElements(Object** objects,
MaybeObject* JSObject::EnsureCanContainElements(FixedArray* elements) {
- if (FLAG_smi_only_arrays) {
- Object** objects = reinterpret_cast<Object**>(
- FIELD_ADDR(elements, elements->OffsetOfElementAt(0)));
- return EnsureCanContainElements(objects, elements->length());
- } else {
- return this;
- }
+ Object** objects = reinterpret_cast<Object**>(
+ FIELD_ADDR(elements, elements->OffsetOfElementAt(0)));
+ return EnsureCanContainElements(objects, elements->length());
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698