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

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

Issue 1936393002: Make array __proto__ manipulations not disturb the species protector (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tests, cleanup Created 4 years, 7 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 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 } 2254 }
2255 2255
2256 2256
2257 void Struct::InitializeBody(int object_size) { 2257 void Struct::InitializeBody(int object_size) {
2258 Object* value = GetHeap()->undefined_value(); 2258 Object* value = GetHeap()->undefined_value();
2259 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) { 2259 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) {
2260 WRITE_FIELD(this, offset, value); 2260 WRITE_FIELD(this, offset, value);
2261 } 2261 }
2262 } 2262 }
2263 2263
2264
2265 bool Object::ToArrayLength(uint32_t* index) { return Object::ToUint32(index); } 2264 bool Object::ToArrayLength(uint32_t* index) { return Object::ToUint32(index); }
2266 2265
2267 2266
2268 bool Object::ToArrayIndex(uint32_t* index) { 2267 bool Object::ToArrayIndex(uint32_t* index) {
2269 return Object::ToUint32(index) && *index != kMaxUInt32; 2268 return Object::ToUint32(index) && *index != kMaxUInt32;
2270 } 2269 }
2271 2270
2272 2271
2273 void Object::VerifyApiCallResultType() { 2272 void Object::VerifyApiCallResultType() {
2274 #if DEBUG 2273 #if DEBUG
(...skipping 5304 matching lines...) Expand 10 before | Expand all | Expand 10 after
7579 IsFastDoubleElementsKind(array->GetElementsKind())) || 7578 IsFastDoubleElementsKind(array->GetElementsKind())) ||
7580 ((storage->map() != array->GetHeap()->fixed_double_array_map()) && 7579 ((storage->map() != array->GetHeap()->fixed_double_array_map()) &&
7581 (IsFastObjectElementsKind(array->GetElementsKind()) || 7580 (IsFastObjectElementsKind(array->GetElementsKind()) ||
7582 (IsFastSmiElementsKind(array->GetElementsKind()) && 7581 (IsFastSmiElementsKind(array->GetElementsKind()) &&
7583 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles())))); 7582 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles()))));
7584 array->set_elements(*storage); 7583 array->set_elements(*storage);
7585 array->set_length(Smi::FromInt(storage->length())); 7584 array->set_length(Smi::FromInt(storage->length()));
7586 } 7585 }
7587 7586
7588 7587
7588 bool JSArray::HasArrayPrototype(Isolate* isolate) {
adamk 2016/05/03 00:45:31 You don't need to pass in the isolate, since JSArr
Camillo Bruni 2016/05/03 08:05:53 not sure what the performance impact is though. si
7589 return map()->prototype() == isolate->context()->initial_array_prototype();
adamk 2016/05/03 00:45:31 This should be coming off the native_context(). Bu
Dan Ehrenberg 2016/05/04 00:18:50 Done
7590 }
7591
7592
7589 int TypeFeedbackInfo::ic_total_count() { 7593 int TypeFeedbackInfo::ic_total_count() {
7590 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); 7594 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7591 return ICTotalCountField::decode(current); 7595 return ICTotalCountField::decode(current);
7592 } 7596 }
7593 7597
7594 7598
7595 void TypeFeedbackInfo::set_ic_total_count(int count) { 7599 void TypeFeedbackInfo::set_ic_total_count(int count) {
7596 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); 7600 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7597 value = ICTotalCountField::update(value, 7601 value = ICTotalCountField::update(value,
7598 ICTotalCountField::decode(count)); 7602 ICTotalCountField::decode(count));
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7851 #undef WRITE_INT64_FIELD 7855 #undef WRITE_INT64_FIELD
7852 #undef READ_BYTE_FIELD 7856 #undef READ_BYTE_FIELD
7853 #undef WRITE_BYTE_FIELD 7857 #undef WRITE_BYTE_FIELD
7854 #undef NOBARRIER_READ_BYTE_FIELD 7858 #undef NOBARRIER_READ_BYTE_FIELD
7855 #undef NOBARRIER_WRITE_BYTE_FIELD 7859 #undef NOBARRIER_WRITE_BYTE_FIELD
7856 7860
7857 } // namespace internal 7861 } // namespace internal
7858 } // namespace v8 7862 } // namespace v8
7859 7863
7860 #endif // V8_OBJECTS_INL_H_ 7864 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698