OLD | NEW |
---|---|
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 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2384 | 2384 |
2385 class FixedDoubleArray; | 2385 class FixedDoubleArray; |
2386 class IncrementalMarking; | 2386 class IncrementalMarking; |
2387 | 2387 |
2388 | 2388 |
2389 // FixedArray describes fixed-sized arrays with element type Object*. | 2389 // FixedArray describes fixed-sized arrays with element type Object*. |
2390 class FixedArray: public FixedArrayBase { | 2390 class FixedArray: public FixedArrayBase { |
2391 public: | 2391 public: |
2392 // Setter and getter for elements. | 2392 // Setter and getter for elements. |
2393 inline Object* get(int index) const; | 2393 inline Object* get(int index) const; |
2394 void SetValue(uint32_t index, Object* value); | 2394 inline void SetValue(uint32_t index, Object* value); |
Igor Sheludko
2015/09/01 16:05:50
Do we still need this method? I guess not.
| |
2395 static inline Handle<Object> get(Handle<FixedArray> array, int index); | 2395 static inline Handle<Object> get(Handle<FixedArray> array, int index); |
2396 // Setter that uses write barrier. | 2396 // Setter that uses write barrier. |
2397 inline void set(int index, Object* value); | 2397 inline void set(int index, Object* value); |
2398 inline bool is_the_hole(int index); | 2398 inline bool is_the_hole(int index); |
2399 | 2399 |
2400 // Setter that doesn't need write barrier. | 2400 // Setter that doesn't need write barrier. |
2401 inline void set(int index, Smi* value); | 2401 inline void set(int index, Smi* value); |
2402 // Setter with explicit barrier mode. | 2402 // Setter with explicit barrier mode. |
2403 inline void set(int index, Object* value, WriteBarrierMode mode); | 2403 inline void set(int index, Object* value, WriteBarrierMode mode); |
2404 | 2404 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2497 | 2497 |
2498 | 2498 |
2499 // FixedDoubleArray describes fixed-sized arrays with element type double. | 2499 // FixedDoubleArray describes fixed-sized arrays with element type double. |
2500 class FixedDoubleArray: public FixedArrayBase { | 2500 class FixedDoubleArray: public FixedArrayBase { |
2501 public: | 2501 public: |
2502 // Setter and getter for elements. | 2502 // Setter and getter for elements. |
2503 inline double get_scalar(int index); | 2503 inline double get_scalar(int index); |
2504 inline uint64_t get_representation(int index); | 2504 inline uint64_t get_representation(int index); |
2505 static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index); | 2505 static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index); |
2506 // This accessor has to get a Number as |value|. | 2506 // This accessor has to get a Number as |value|. |
2507 void SetValue(uint32_t index, Object* value); | 2507 inline void SetValue(uint32_t index, Object* value); |
Igor Sheludko
2015/09/01 16:05:50
Do we still need this method?
| |
2508 inline void set(int index, double value); | 2508 inline void set(int index, double value); |
2509 inline void set_the_hole(int index); | 2509 inline void set_the_hole(int index); |
2510 | 2510 |
2511 // Checking for the hole. | 2511 // Checking for the hole. |
2512 inline bool is_the_hole(int index); | 2512 inline bool is_the_hole(int index); |
2513 | 2513 |
2514 // Garbage collection support. | 2514 // Garbage collection support. |
2515 inline static int SizeFor(int length) { | 2515 inline static int SizeFor(int length) { |
2516 return kHeaderSize + length * kDoubleSize; | 2516 return kHeaderSize + length * kDoubleSize; |
2517 } | 2517 } |
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4296 | 4296 |
4297 inline ElementType get_scalar(int index); | 4297 inline ElementType get_scalar(int index); |
4298 static inline Handle<Object> get(Handle<FixedTypedArray> array, int index); | 4298 static inline Handle<Object> get(Handle<FixedTypedArray> array, int index); |
4299 inline void set(int index, ElementType value); | 4299 inline void set(int index, ElementType value); |
4300 | 4300 |
4301 static inline ElementType from_int(int value); | 4301 static inline ElementType from_int(int value); |
4302 static inline ElementType from_double(double value); | 4302 static inline ElementType from_double(double value); |
4303 | 4303 |
4304 // This accessor applies the correct conversion from Smi, HeapNumber | 4304 // This accessor applies the correct conversion from Smi, HeapNumber |
4305 // and undefined. | 4305 // and undefined. |
4306 void SetValue(uint32_t index, Object* value); | 4306 inline void SetValue(uint32_t index, Object* value); |
4307 | 4307 |
4308 DECLARE_PRINTER(FixedTypedArray) | 4308 DECLARE_PRINTER(FixedTypedArray) |
4309 DECLARE_VERIFIER(FixedTypedArray) | 4309 DECLARE_VERIFIER(FixedTypedArray) |
4310 | 4310 |
4311 private: | 4311 private: |
4312 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); | 4312 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray); |
4313 }; | 4313 }; |
4314 | 4314 |
4315 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ | 4315 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \ |
4316 class Type##ArrayTraits { \ | 4316 class Type##ArrayTraits { \ |
(...skipping 6065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10382 } else { | 10382 } else { |
10383 value &= ~(1 << bit_position); | 10383 value &= ~(1 << bit_position); |
10384 } | 10384 } |
10385 return value; | 10385 return value; |
10386 } | 10386 } |
10387 }; | 10387 }; |
10388 | 10388 |
10389 } } // namespace v8::internal | 10389 } } // namespace v8::internal |
10390 | 10390 |
10391 #endif // V8_OBJECTS_H_ | 10391 #endif // V8_OBJECTS_H_ |
OLD | NEW |