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

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

Issue 1979473003: Version 5.1.281.35 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime/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 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 //
11 11
12 #ifndef V8_OBJECTS_INL_H_ 12 #ifndef V8_OBJECTS_INL_H_
13 #define V8_OBJECTS_INL_H_ 13 #define V8_OBJECTS_INL_H_
14 14
15 #include "src/base/atomicops.h" 15 #include "src/base/atomicops.h"
16 #include "src/base/bits.h" 16 #include "src/base/bits.h"
17 #include "src/contexts-inl.h" 17 #include "src/contexts-inl.h"
18 #include "src/conversions-inl.h" 18 #include "src/conversions-inl.h"
19 #include "src/factory.h" 19 #include "src/factory.h"
20 #include "src/field-index-inl.h" 20 #include "src/field-index-inl.h"
21 #include "src/handles-inl.h" 21 #include "src/handles-inl.h"
22 #include "src/heap/heap-inl.h" 22 #include "src/heap/heap-inl.h"
23 #include "src/heap/heap.h" 23 #include "src/heap/heap.h"
24 #include "src/isolate.h" 24 #include "src/isolate.h"
25 #include "src/isolate-inl.h"
25 #include "src/layout-descriptor-inl.h" 26 #include "src/layout-descriptor-inl.h"
26 #include "src/lookup.h" 27 #include "src/lookup.h"
27 #include "src/objects.h" 28 #include "src/objects.h"
28 #include "src/property.h" 29 #include "src/property.h"
29 #include "src/prototype.h" 30 #include "src/prototype.h"
30 #include "src/transitions-inl.h" 31 #include "src/transitions-inl.h"
31 #include "src/type-feedback-vector-inl.h" 32 #include "src/type-feedback-vector-inl.h"
32 #include "src/v8memory.h" 33 #include "src/v8memory.h"
33 34
34 namespace v8 { 35 namespace v8 {
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2244 } 2245 }
2245 2246
2246 2247
2247 void Struct::InitializeBody(int object_size) { 2248 void Struct::InitializeBody(int object_size) {
2248 Object* value = GetHeap()->undefined_value(); 2249 Object* value = GetHeap()->undefined_value();
2249 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) { 2250 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) {
2250 WRITE_FIELD(this, offset, value); 2251 WRITE_FIELD(this, offset, value);
2251 } 2252 }
2252 } 2253 }
2253 2254
2254
2255 bool Object::ToArrayLength(uint32_t* index) { return Object::ToUint32(index); } 2255 bool Object::ToArrayLength(uint32_t* index) { return Object::ToUint32(index); }
2256 2256
2257 2257
2258 bool Object::ToArrayIndex(uint32_t* index) { 2258 bool Object::ToArrayIndex(uint32_t* index) {
2259 return Object::ToUint32(index) && *index != kMaxUInt32; 2259 return Object::ToUint32(index) && *index != kMaxUInt32;
2260 } 2260 }
2261 2261
2262 2262
2263 void Object::VerifyApiCallResultType() { 2263 void Object::VerifyApiCallResultType() {
2264 #if DEBUG 2264 #if DEBUG
(...skipping 5312 matching lines...) Expand 10 before | Expand all | Expand 10 after
7577 IsFastDoubleElementsKind(array->GetElementsKind())) || 7577 IsFastDoubleElementsKind(array->GetElementsKind())) ||
7578 ((storage->map() != array->GetHeap()->fixed_double_array_map()) && 7578 ((storage->map() != array->GetHeap()->fixed_double_array_map()) &&
7579 (IsFastObjectElementsKind(array->GetElementsKind()) || 7579 (IsFastObjectElementsKind(array->GetElementsKind()) ||
7580 (IsFastSmiElementsKind(array->GetElementsKind()) && 7580 (IsFastSmiElementsKind(array->GetElementsKind()) &&
7581 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles())))); 7581 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles()))));
7582 array->set_elements(*storage); 7582 array->set_elements(*storage);
7583 array->set_length(Smi::FromInt(storage->length())); 7583 array->set_length(Smi::FromInt(storage->length()));
7584 } 7584 }
7585 7585
7586 7586
7587 bool JSArray::HasArrayPrototype(Isolate* isolate) {
7588 return map()->prototype() == *isolate->initial_array_prototype();
7589 }
7590
7591
7587 int TypeFeedbackInfo::ic_total_count() { 7592 int TypeFeedbackInfo::ic_total_count() {
7588 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); 7593 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7589 return ICTotalCountField::decode(current); 7594 return ICTotalCountField::decode(current);
7590 } 7595 }
7591 7596
7592 7597
7593 void TypeFeedbackInfo::set_ic_total_count(int count) { 7598 void TypeFeedbackInfo::set_ic_total_count(int count) {
7594 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); 7599 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7595 value = ICTotalCountField::update(value, 7600 value = ICTotalCountField::update(value,
7596 ICTotalCountField::decode(count)); 7601 ICTotalCountField::decode(count));
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7849 #undef WRITE_INT64_FIELD 7854 #undef WRITE_INT64_FIELD
7850 #undef READ_BYTE_FIELD 7855 #undef READ_BYTE_FIELD
7851 #undef WRITE_BYTE_FIELD 7856 #undef WRITE_BYTE_FIELD
7852 #undef NOBARRIER_READ_BYTE_FIELD 7857 #undef NOBARRIER_READ_BYTE_FIELD
7853 #undef NOBARRIER_WRITE_BYTE_FIELD 7858 #undef NOBARRIER_WRITE_BYTE_FIELD
7854 7859
7855 } // namespace internal 7860 } // namespace internal
7856 } // namespace v8 7861 } // namespace v8
7857 7862
7858 #endif // V8_OBJECTS_INL_H_ 7863 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698