OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 private: | 2427 private: |
2428 IncrementalMarking* marking_; | 2428 IncrementalMarking* marking_; |
2429 }; | 2429 }; |
2430 | 2430 |
2431 // Accessor for complete descriptor. | 2431 // Accessor for complete descriptor. |
2432 inline void Get(int descriptor_number, Descriptor* desc); | 2432 inline void Get(int descriptor_number, Descriptor* desc); |
2433 inline void Set(int descriptor_number, | 2433 inline void Set(int descriptor_number, |
2434 Descriptor* desc, | 2434 Descriptor* desc, |
2435 const WhitenessWitness&); | 2435 const WhitenessWitness&); |
2436 | 2436 |
2437 // Transfer complete descriptor from another descriptor array to | 2437 // Transfer a complete descriptor from the src descriptor array to the dst |
2438 // this one. | 2438 // one, dropping map transitions in CALLBACKS. |
2439 inline void CopyFrom(int index, | 2439 static void CopyFrom(Handle<DescriptorArray> dst, |
2440 DescriptorArray* src, | 2440 int dst_index, |
| 2441 Handle<DescriptorArray> src, |
2441 int src_index, | 2442 int src_index, |
2442 const WhitenessWitness&); | 2443 const WhitenessWitness& witness); |
| 2444 |
| 2445 // Transfer a complete descriptor from the src descriptor array to this |
| 2446 // descriptor array, dropping map transitions in CALLBACKS. |
| 2447 MUST_USE_RESULT MaybeObject* CopyFrom(int dst_index, |
| 2448 DescriptorArray* src, |
| 2449 int src_index, |
| 2450 const WhitenessWitness&); |
2443 | 2451 |
2444 // Copy the descriptor array, insert a new descriptor and optionally | 2452 // Copy the descriptor array, insert a new descriptor and optionally |
2445 // remove map transitions. If the descriptor is already present, it is | 2453 // remove map transitions. If the descriptor is already present, it is |
2446 // replaced. If a replaced descriptor is a real property (not a transition | 2454 // replaced. If a replaced descriptor is a real property (not a transition |
2447 // or null), its enumeration index is kept as is. | 2455 // or null), its enumeration index is kept as is. |
2448 // If adding a real property, map transitions must be removed. If adding | 2456 // If adding a real property, map transitions must be removed. If adding |
2449 // a transition, they must not be removed. All null descriptors are removed. | 2457 // a transition, they must not be removed. All null descriptors are removed. |
2450 MUST_USE_RESULT MaybeObject* CopyInsert(Descriptor* descriptor, | 2458 MUST_USE_RESULT MaybeObject* CopyInsert(Descriptor* descriptor, |
2451 TransitionFlag transition_flag); | 2459 TransitionFlag transition_flag); |
2452 | 2460 |
(...skipping 5322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7775 // * undefined: considered an accessor by the spec, too, strangely enough | 7783 // * undefined: considered an accessor by the spec, too, strangely enough |
7776 // * the hole: an accessor which has not been set | 7784 // * the hole: an accessor which has not been set |
7777 // * a pointer to a map: a transition used to ensure map sharing | 7785 // * a pointer to a map: a transition used to ensure map sharing |
7778 class AccessorPair: public Struct { | 7786 class AccessorPair: public Struct { |
7779 public: | 7787 public: |
7780 DECL_ACCESSORS(getter, Object) | 7788 DECL_ACCESSORS(getter, Object) |
7781 DECL_ACCESSORS(setter, Object) | 7789 DECL_ACCESSORS(setter, Object) |
7782 | 7790 |
7783 static inline AccessorPair* cast(Object* obj); | 7791 static inline AccessorPair* cast(Object* obj); |
7784 | 7792 |
| 7793 MUST_USE_RESULT MaybeObject* CopyWithoutTransitions(); |
| 7794 |
7785 #ifdef OBJECT_PRINT | 7795 #ifdef OBJECT_PRINT |
7786 void AccessorPairPrint(FILE* out = stdout); | 7796 void AccessorPairPrint(FILE* out = stdout); |
7787 #endif | 7797 #endif |
7788 #ifdef DEBUG | 7798 #ifdef DEBUG |
7789 void AccessorPairVerify(); | 7799 void AccessorPairVerify(); |
7790 #endif | 7800 #endif |
7791 | 7801 |
7792 static const int kGetterOffset = HeapObject::kHeaderSize; | 7802 static const int kGetterOffset = HeapObject::kHeaderSize; |
7793 static const int kSetterOffset = kGetterOffset + kPointerSize; | 7803 static const int kSetterOffset = kGetterOffset + kPointerSize; |
7794 static const int kSize = kSetterOffset + kPointerSize; | 7804 static const int kSize = kSetterOffset + kPointerSize; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8286 } else { | 8296 } else { |
8287 value &= ~(1 << bit_position); | 8297 value &= ~(1 << bit_position); |
8288 } | 8298 } |
8289 return value; | 8299 return value; |
8290 } | 8300 } |
8291 }; | 8301 }; |
8292 | 8302 |
8293 } } // namespace v8::internal | 8303 } } // namespace v8::internal |
8294 | 8304 |
8295 #endif // V8_OBJECTS_H_ | 8305 #endif // V8_OBJECTS_H_ |
OLD | NEW |