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

Side by Side Diff: src/objects-inl.h

Issue 650043: Faster moving FixedArray elements around. (Closed)
Patch Set: First round of Soren's comments Created 10 years, 10 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/objects.h ('k') | src/runtime.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 } 1387 }
1388 1388
1389 1389
1390 void FixedArray::set_the_hole(int index) { 1390 void FixedArray::set_the_hole(int index) {
1391 ASSERT(index >= 0 && index < this->length()); 1391 ASSERT(index >= 0 && index < this->length());
1392 ASSERT(!Heap::InNewSpace(Heap::the_hole_value())); 1392 ASSERT(!Heap::InNewSpace(Heap::the_hole_value()));
1393 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, Heap::the_hole_value()); 1393 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, Heap::the_hole_value());
1394 } 1394 }
1395 1395
1396 1396
1397 Object** FixedArray::data_start() {
1398 return HeapObject::RawField(this, kHeaderSize);
1399 }
1400
1401
1397 bool DescriptorArray::IsEmpty() { 1402 bool DescriptorArray::IsEmpty() {
1398 ASSERT(this == Heap::empty_descriptor_array() || 1403 ASSERT(this == Heap::empty_descriptor_array() ||
1399 this->length() > 2); 1404 this->length() > 2);
1400 return this == Heap::empty_descriptor_array(); 1405 return this == Heap::empty_descriptor_array();
1401 } 1406 }
1402 1407
1403 1408
1404 void DescriptorArray::fast_swap(FixedArray* array, int first, int second) { 1409 void DescriptorArray::fast_swap(FixedArray* array, int first, int second) {
1405 Object* tmp = array->get(first); 1410 Object* tmp = array->get(first);
1406 fast_set(array, first, array->get(second)); 1411 fast_set(array, first, array->get(second));
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
3047 #undef WRITE_INT_FIELD 3052 #undef WRITE_INT_FIELD
3048 #undef READ_SHORT_FIELD 3053 #undef READ_SHORT_FIELD
3049 #undef WRITE_SHORT_FIELD 3054 #undef WRITE_SHORT_FIELD
3050 #undef READ_BYTE_FIELD 3055 #undef READ_BYTE_FIELD
3051 #undef WRITE_BYTE_FIELD 3056 #undef WRITE_BYTE_FIELD
3052 3057
3053 3058
3054 } } // namespace v8::internal 3059 } } // namespace v8::internal
3055 3060
3056 #endif // V8_OBJECTS_INL_H_ 3061 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698