diff options
Diffstat (limited to 'chromium/v8/src/transitions.h')
-rw-r--r-- | chromium/v8/src/transitions.h | 79 |
1 files changed, 32 insertions, 47 deletions
diff --git a/chromium/v8/src/transitions.h b/chromium/v8/src/transitions.h index b2e98396784..ec99c8b6053 100644 --- a/chromium/v8/src/transitions.h +++ b/chromium/v8/src/transitions.h @@ -1,38 +1,15 @@ // Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef V8_TRANSITIONS_H_ #define V8_TRANSITIONS_H_ -#include "elements-kind.h" -#include "heap.h" -#include "isolate.h" -#include "objects.h" -#include "v8checks.h" +#include "src/elements-kind.h" +#include "src/heap.h" +#include "src/isolate.h" +#include "src/objects.h" +#include "src/v8checks.h" namespace v8 { namespace internal { @@ -85,7 +62,6 @@ class TransitionArray: public FixedArray { WriteBarrierMode mode = UPDATE_WRITE_BARRIER); inline Object** GetPrototypeTransitionsSlot(); inline bool HasPrototypeTransitions(); - inline HeapObject* UncheckedPrototypeTransitions(); // Returns the number of transitions in the array. int number_of_transitions() { @@ -96,30 +72,25 @@ class TransitionArray: public FixedArray { inline int number_of_entries() { return number_of_transitions(); } - // Allocate a new transition array with a single entry. - static MUST_USE_RESULT MaybeObject* NewWith( - SimpleTransitionFlag flag, - Name* key, - Map* target, - Object* back_pointer); + // Creates a FullTransitionArray from a SimpleTransitionArray in + // containing_map. + static Handle<TransitionArray> ExtendToFullTransitionArray( + Handle<Map> containing_map); - MUST_USE_RESULT MaybeObject* ExtendToFullTransitionArray(); - - // Copy the transition array, inserting a new transition. + // Create a transition array, copying from the owning map if it already has + // one, otherwise creating a new one according to flag. // TODO(verwaest): This should not cause an existing transition to be // overwritten. - MUST_USE_RESULT MaybeObject* CopyInsert(Name* name, Map* target); - - // Copy a single transition from the origin array. - inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin, - int origin_transition, - int target_transition); + static Handle<TransitionArray> CopyInsert(Handle<Map> map, + Handle<Name> name, + Handle<Map> target, + SimpleTransitionFlag flag); // Search a transition for a given property name. inline int Search(Name* name); // Allocates a TransitionArray. - MUST_USE_RESULT static MaybeObject* Allocate( + static Handle<TransitionArray> Allocate( Isolate* isolate, int number_of_transitions); bool IsSimpleTransition() { @@ -199,10 +170,24 @@ class TransitionArray: public FixedArray { kTransitionTarget; } + static Handle<TransitionArray> AllocateSimple( + Isolate* isolate, Handle<Map> target); + + // Allocate a new transition array with a single entry. + static Handle<TransitionArray> NewWith(Handle<Map> map, + Handle<Name> name, + Handle<Map> target, + SimpleTransitionFlag flag); + inline void NoIncrementalWriteBarrierSet(int transition_number, Name* key, Map* target); + // Copy a single transition from the origin array. + inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin, + int origin_transition, + int target_transition); + DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); }; |