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

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

Issue 1637753004: [es7] refactor and fix Object.values() / Object.entries() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: keepin it fresh Created 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 DCHECK(index >= 0 && index < this->length()); 2381 DCHECK(index >= 0 && index < this->length());
2382 DCHECK(reinterpret_cast<Object*>(value)->IsSmi()); 2382 DCHECK(reinterpret_cast<Object*>(value)->IsSmi());
2383 int offset = kHeaderSize + index * kPointerSize; 2383 int offset = kHeaderSize + index * kPointerSize;
2384 WRITE_FIELD(this, offset, value); 2384 WRITE_FIELD(this, offset, value);
2385 } 2385 }
2386 2386
2387 2387
2388 void FixedArray::set(int index, Object* value) { 2388 void FixedArray::set(int index, Object* value) {
2389 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map()); 2389 DCHECK_NE(GetHeap()->fixed_cow_array_map(), map());
2390 DCHECK(IsFixedArray()); 2390 DCHECK(IsFixedArray());
2391 DCHECK(index >= 0 && index < this->length()); 2391 DCHECK_GE(index, 0);
2392 DCHECK_LT(index, this->length());
2392 int offset = kHeaderSize + index * kPointerSize; 2393 int offset = kHeaderSize + index * kPointerSize;
2393 WRITE_FIELD(this, offset, value); 2394 WRITE_FIELD(this, offset, value);
2394 WRITE_BARRIER(GetHeap(), this, offset, value); 2395 WRITE_BARRIER(GetHeap(), this, offset, value);
2395 } 2396 }
2396 2397
2397 2398
2398 double FixedDoubleArray::get_scalar(int index) { 2399 double FixedDoubleArray::get_scalar(int index) {
2399 DCHECK(map() != GetHeap()->fixed_cow_array_map() && 2400 DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
2400 map() != GetHeap()->fixed_array_map()); 2401 map() != GetHeap()->fixed_array_map());
2401 DCHECK(index >= 0 && index < this->length()); 2402 DCHECK(index >= 0 && index < this->length());
(...skipping 5440 matching lines...) Expand 10 before | Expand all | Expand 10 after
7842 #undef WRITE_INT64_FIELD 7843 #undef WRITE_INT64_FIELD
7843 #undef READ_BYTE_FIELD 7844 #undef READ_BYTE_FIELD
7844 #undef WRITE_BYTE_FIELD 7845 #undef WRITE_BYTE_FIELD
7845 #undef NOBARRIER_READ_BYTE_FIELD 7846 #undef NOBARRIER_READ_BYTE_FIELD
7846 #undef NOBARRIER_WRITE_BYTE_FIELD 7847 #undef NOBARRIER_WRITE_BYTE_FIELD
7847 7848
7848 } // namespace internal 7849 } // namespace internal
7849 } // namespace v8 7850 } // namespace v8
7850 7851
7851 #endif // V8_OBJECTS_INL_H_ 7852 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | test/mjsunit/harmony/object-entries.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698