Chromium Code Reviews| 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 complete descriptor from src descriptor array to dst, dropping map |
| 2438 // this one. | 2438 // 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 MUST_USE_RESULT MaybeObject* CopyFrom(int dst_index, | |
|
Michael Starzinger
2012/02/13 14:04:17
Could you add a similar comment like above to this
| |
| 2446 DescriptorArray* src, | |
| 2447 int src_index, | |
| 2448 const WhitenessWitness&); | |
| 2443 | 2449 |
| 2444 // Copy the descriptor array, insert a new descriptor and optionally | 2450 // Copy the descriptor array, insert a new descriptor and optionally |
| 2445 // remove map transitions. If the descriptor is already present, it is | 2451 // remove map transitions. If the descriptor is already present, it is |
| 2446 // replaced. If a replaced descriptor is a real property (not a transition | 2452 // replaced. If a replaced descriptor is a real property (not a transition |
| 2447 // or null), its enumeration index is kept as is. | 2453 // or null), its enumeration index is kept as is. |
| 2448 // If adding a real property, map transitions must be removed. If adding | 2454 // 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. | 2455 // a transition, they must not be removed. All null descriptors are removed. |
| 2450 MUST_USE_RESULT MaybeObject* CopyInsert(Descriptor* descriptor, | 2456 MUST_USE_RESULT MaybeObject* CopyInsert(Descriptor* descriptor, |
| 2451 TransitionFlag transition_flag); | 2457 TransitionFlag transition_flag); |
| 2452 | 2458 |
| (...skipping 5322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7775 // * undefined: considered an accessor by the spec, too, strangely enough | 7781 // * undefined: considered an accessor by the spec, too, strangely enough |
| 7776 // * the hole: an accessor which has not been set | 7782 // * the hole: an accessor which has not been set |
| 7777 // * a pointer to a map: a transition used to ensure map sharing | 7783 // * a pointer to a map: a transition used to ensure map sharing |
| 7778 class AccessorPair: public Struct { | 7784 class AccessorPair: public Struct { |
| 7779 public: | 7785 public: |
| 7780 DECL_ACCESSORS(getter, Object) | 7786 DECL_ACCESSORS(getter, Object) |
| 7781 DECL_ACCESSORS(setter, Object) | 7787 DECL_ACCESSORS(setter, Object) |
| 7782 | 7788 |
| 7783 static inline AccessorPair* cast(Object* obj); | 7789 static inline AccessorPair* cast(Object* obj); |
| 7784 | 7790 |
| 7791 MaybeObject* CopyWithoutTransitions(); | |
|
Michael Starzinger
2012/02/13 14:10:25
This needs a MUST_USE_RESULT.
| |
| 7792 | |
| 7785 #ifdef OBJECT_PRINT | 7793 #ifdef OBJECT_PRINT |
| 7786 void AccessorPairPrint(FILE* out = stdout); | 7794 void AccessorPairPrint(FILE* out = stdout); |
| 7787 #endif | 7795 #endif |
| 7788 #ifdef DEBUG | 7796 #ifdef DEBUG |
| 7789 void AccessorPairVerify(); | 7797 void AccessorPairVerify(); |
| 7790 #endif | 7798 #endif |
| 7791 | 7799 |
| 7792 static const int kGetterOffset = HeapObject::kHeaderSize; | 7800 static const int kGetterOffset = HeapObject::kHeaderSize; |
| 7793 static const int kSetterOffset = kGetterOffset + kPointerSize; | 7801 static const int kSetterOffset = kGetterOffset + kPointerSize; |
| 7794 static const int kSize = kSetterOffset + kPointerSize; | 7802 static const int kSize = kSetterOffset + kPointerSize; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8286 } else { | 8294 } else { |
| 8287 value &= ~(1 << bit_position); | 8295 value &= ~(1 << bit_position); |
| 8288 } | 8296 } |
| 8289 return value; | 8297 return value; |
| 8290 } | 8298 } |
| 8291 }; | 8299 }; |
| 8292 | 8300 |
| 8293 } } // namespace v8::internal | 8301 } } // namespace v8::internal |
| 8294 | 8302 |
| 8295 #endif // V8_OBJECTS_H_ | 8303 #endif // V8_OBJECTS_H_ |
| OLD | NEW |