OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2637 class IncrementalMarking; | 2637 class IncrementalMarking; |
2638 | 2638 |
2639 | 2639 |
2640 // FixedArray describes fixed-sized arrays with element type Object*. | 2640 // FixedArray describes fixed-sized arrays with element type Object*. |
2641 class FixedArray: public FixedArrayBase { | 2641 class FixedArray: public FixedArrayBase { |
2642 public: | 2642 public: |
2643 // Setter and getter for elements. | 2643 // Setter and getter for elements. |
2644 inline Object* get(int index) const; | 2644 inline Object* get(int index) const; |
2645 static inline Handle<Object> get(FixedArray* array, int index, | 2645 static inline Handle<Object> get(FixedArray* array, int index, |
2646 Isolate* isolate); | 2646 Isolate* isolate); |
2647 template <class T> | |
2648 MaybeHandle<T> GetValue(int index) const; | |
2649 | |
2650 template <class T> | |
2651 Handle<T> GetValueChecked(int index) const; | |
2652 | |
2653 // Setter that uses write barrier. | 2647 // Setter that uses write barrier. |
2654 inline void set(int index, Object* value); | 2648 inline void set(int index, Object* value); |
2655 inline bool is_the_hole(int index); | 2649 inline bool is_the_hole(int index); |
2656 | 2650 |
2657 // Setter that doesn't need write barrier. | 2651 // Setter that doesn't need write barrier. |
2658 inline void set(int index, Smi* value); | 2652 inline void set(int index, Smi* value); |
2659 // Setter with explicit barrier mode. | 2653 // Setter with explicit barrier mode. |
2660 inline void set(int index, Object* value, WriteBarrierMode mode); | 2654 inline void set(int index, Object* value, WriteBarrierMode mode); |
2661 | 2655 |
2662 // Setters for frequently used oddballs located in old space. | 2656 // Setters for frequently used oddballs located in old space. |
(...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4419 | 4413 |
4420 // ByteArray represents fixed sized byte arrays. Used for the relocation info | 4414 // ByteArray represents fixed sized byte arrays. Used for the relocation info |
4421 // that is attached to code objects. | 4415 // that is attached to code objects. |
4422 class ByteArray: public FixedArrayBase { | 4416 class ByteArray: public FixedArrayBase { |
4423 public: | 4417 public: |
4424 inline int Size(); | 4418 inline int Size(); |
4425 | 4419 |
4426 // Setter and getter. | 4420 // Setter and getter. |
4427 inline byte get(int index); | 4421 inline byte get(int index); |
4428 inline void set(int index, byte value); | 4422 inline void set(int index, byte value); |
4429 inline const byte* data() const; | |
4430 | 4423 |
4431 // Copy in / copy out whole byte slices. | 4424 // Copy in / copy out whole byte slices. |
4432 inline void copy_out(int index, byte* buffer, int length); | 4425 inline void copy_out(int index, byte* buffer, int length); |
4433 inline void copy_in(int index, const byte* buffer, int length); | 4426 inline void copy_in(int index, const byte* buffer, int length); |
4434 | 4427 |
4435 // Treat contents as an int array. | 4428 // Treat contents as an int array. |
4436 inline int get_int(int index); | 4429 inline int get_int(int index); |
4437 inline void set_int(int index, int value); | 4430 inline void set_int(int index, int value); |
4438 | 4431 |
4439 static int SizeFor(int length) { | 4432 static int SizeFor(int length) { |
(...skipping 6482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10922 } | 10915 } |
10923 return value; | 10916 return value; |
10924 } | 10917 } |
10925 }; | 10918 }; |
10926 | 10919 |
10927 | 10920 |
10928 } // NOLINT, false-positive due to second-order macros. | 10921 } // NOLINT, false-positive due to second-order macros. |
10929 } // NOLINT, false-positive due to second-order macros. | 10922 } // NOLINT, false-positive due to second-order macros. |
10930 | 10923 |
10931 #endif // V8_OBJECTS_H_ | 10924 #endif // V8_OBJECTS_H_ |
OLD | NEW |