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

Side by Side Diff: src/objects.h

Issue 1248483007: Store offset between fixed typed array base and data start in object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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/mips64/lithium-mips64.cc ('k') | src/objects-inl.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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 4518 matching lines...) Expand 10 before | Expand all | Expand 10 after
4529 private: 4529 private:
4530 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat64Array); 4530 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat64Array);
4531 }; 4531 };
4532 4532
4533 4533
4534 class FixedTypedArrayBase: public FixedArrayBase { 4534 class FixedTypedArrayBase: public FixedArrayBase {
4535 public: 4535 public:
4536 // [base_pointer]: For now, points to the FixedTypedArrayBase itself. 4536 // [base_pointer]: For now, points to the FixedTypedArrayBase itself.
4537 DECL_ACCESSORS(base_pointer, Object) 4537 DECL_ACCESSORS(base_pointer, Object)
4538 4538
4539 // [external_pointer]: For now, contains the offset between base_pointer and
4540 // the start of the data.
4541 DECL_ACCESSORS(external_pointer, void)
4542
4539 // Dispatched behavior. 4543 // Dispatched behavior.
4540 inline void FixedTypedArrayBaseIterateBody(ObjectVisitor* v); 4544 inline void FixedTypedArrayBaseIterateBody(ObjectVisitor* v);
4541 4545
4542 template <typename StaticVisitor> 4546 template <typename StaticVisitor>
4543 inline void FixedTypedArrayBaseIterateBody(); 4547 inline void FixedTypedArrayBaseIterateBody();
4544 4548
4545 DECLARE_CAST(FixedTypedArrayBase) 4549 DECLARE_CAST(FixedTypedArrayBase)
4546 4550
4547 static const int kBasePointerOffset = 4551 static const int kBasePointerOffset = FixedArrayBase::kHeaderSize;
4548 FixedArrayBase::kHeaderSize + kPointerSize; 4552 static const int kExternalPointerOffset = kBasePointerOffset + kPointerSize;
4549 static const int kHeaderSize = kBasePointerOffset + kPointerSize; 4553 static const int kHeaderSize =
4554 DOUBLE_POINTER_ALIGN(kExternalPointerOffset + kPointerSize);
4550 4555
4551 static const int kDataOffset = DOUBLE_POINTER_ALIGN(kHeaderSize); 4556 static const int kDataOffset = kHeaderSize;
4552 4557
4553 inline int size(); 4558 inline int size();
4554 4559
4555 static inline int TypedArraySize(InstanceType type, int length); 4560 static inline int TypedArraySize(InstanceType type, int length);
4556 inline int TypedArraySize(InstanceType type); 4561 inline int TypedArraySize(InstanceType type);
4557 4562
4558 // Use with care: returns raw pointer into heap. 4563 // Use with care: returns raw pointer into heap.
4559 inline void* DataPtr(); 4564 inline void* DataPtr();
4560 4565
4561 inline int DataSize(); 4566 inline int DataSize();
(...skipping 6233 matching lines...) Expand 10 before | Expand all | Expand 10 after
10795 } else { 10800 } else {
10796 value &= ~(1 << bit_position); 10801 value &= ~(1 << bit_position);
10797 } 10802 }
10798 return value; 10803 return value;
10799 } 10804 }
10800 }; 10805 };
10801 10806
10802 } } // namespace v8::internal 10807 } } // namespace v8::internal
10803 10808
10804 #endif // V8_OBJECTS_H_ 10809 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips64/lithium-mips64.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698