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