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

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

Issue 660245: Faster moving FixedArray elements around. (Closed)
Patch Set: Next round Created 10 years, 9 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 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 } 1390 }
1391 1391
1392 1392
1393 void FixedArray::set_the_hole(int index) { 1393 void FixedArray::set_the_hole(int index) {
1394 ASSERT(index >= 0 && index < this->length()); 1394 ASSERT(index >= 0 && index < this->length());
1395 ASSERT(!Heap::InNewSpace(Heap::the_hole_value())); 1395 ASSERT(!Heap::InNewSpace(Heap::the_hole_value()));
1396 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, Heap::the_hole_value()); 1396 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, Heap::the_hole_value());
1397 } 1397 }
1398 1398
1399 1399
1400 Object** FixedArray::data_start() {
1401 return HeapObject::RawField(this, kHeaderSize);
1402 }
1403
1404
1400 bool DescriptorArray::IsEmpty() { 1405 bool DescriptorArray::IsEmpty() {
1401 ASSERT(this == Heap::empty_descriptor_array() || 1406 ASSERT(this == Heap::empty_descriptor_array() ||
1402 this->length() > 2); 1407 this->length() > 2);
1403 return this == Heap::empty_descriptor_array(); 1408 return this == Heap::empty_descriptor_array();
1404 } 1409 }
1405 1410
1406 1411
1407 void DescriptorArray::fast_swap(FixedArray* array, int first, int second) { 1412 void DescriptorArray::fast_swap(FixedArray* array, int first, int second) {
1408 Object* tmp = array->get(first); 1413 Object* tmp = array->get(first);
1409 fast_set(array, first, array->get(second)); 1414 fast_set(array, first, array->get(second));
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 #undef WRITE_INT_FIELD 3053 #undef WRITE_INT_FIELD
3049 #undef READ_SHORT_FIELD 3054 #undef READ_SHORT_FIELD
3050 #undef WRITE_SHORT_FIELD 3055 #undef WRITE_SHORT_FIELD
3051 #undef READ_BYTE_FIELD 3056 #undef READ_BYTE_FIELD
3052 #undef WRITE_BYTE_FIELD 3057 #undef WRITE_BYTE_FIELD
3053 3058
3054 3059
3055 } } // namespace v8::internal 3060 } } // namespace v8::internal
3056 3061
3057 #endif // V8_OBJECTS_INL_H_ 3062 #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