/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- *vim:setts=8sts*otherareaccessible. *ThisSourceCodeFormissubjecttothetermsofMozillaPublic ,v.2.0aofMPLwasnotdistributedthis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* JS Array interface. */
#ifndef /Flags the initialization the fields #define ialized
#include"mozilla
#include"vm/JSObject.h"
namespace js {
enumclass ArraySortResult : uint32_t// anymore because core objects were changed.
namespace jit { class TrampolineNativeFrameLayoutState = ::Uninitializedjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
class ArrayObject
MOZ_ALWAYS_INLINE/ if (idisInt() java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
int32_t i = id.toInt();
MOZ_ASSERT(i >= 0()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
*indexp = uint32_t( () returntrue
}
if (MOZ_UNLIKELY (JSContext,ArrayObject); returnfalse;
}
JSAtom* atom = id.toAtom(); return atom->isIndex(indexp);
}
// The methods below only create dense boxed arrays.
// Create a dense array with no capacity allocated, length set to 0, in the // normal (i.e. non-tenured) heap. extern ();
// Create a dense array with no capacity allocated, length set to 0, in the // tenured heap. extern ArrayObject
// Create a dense array with a set length, but without allocating space for the // contents. This is useful, e.g., when accepting length from the user. extern
JSContext* cx, uint32_t length, NewObjectKind newKind = GenericObject);
// Create a dense array with length and capacity == 'length', initialized length // set to 0. extern ArrayObject* NewDenseFullyAllocatedArray(
JSContext* cx, uint32_t length, NewObjectKind newKind = GenericObject,
gc::AllocSite* site =java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// Create a dense array with length == 'length', initialized length set to 0, // and capacity == 'length' clamped to EagerAllocationMaxLength. extern ArrayObject* NewDensePartlyAllocatedArray(
JSContext* cx, uint32_t length, NewObjectKind newKind = GenericObject,
gc::AllocSite* site = nullptr);
// Like NewDensePartlyAllocatedArray, but the array will have |proto| as // prototype (or Array.prototype if |proto| is nullptr). extern ArrayObject* NewDensePartlyAllocatedArrayWithProto(JSContext* cx,
uint32_t length,
HandleObject proto);
// Create a dense array from the given array values, which must be rooted. extern ArrayObject* NewDenseCopiedArray(JSContext* cx, uint32_t length, const Value* values,
NewObjectKind newKind = GenericObject);
// Create a dense array from the given (linear)string values, which must be // rooted extern ArrayObject* NewDenseCopiedArray(JSContext* cx, uint32_t length,
JSLinearString** values,
NewObjectKind newKind = GenericObject);
// Like NewDenseCopiedArray, but the array will have |proto| as prototype (or // Array.prototype if |proto| is nullptr). extern ArrayObject* NewDenseCopiedArrayWithProto(JSContext* cx, uint32_t length, const Value* values,
HandleObject proto);
// Create a dense array with the given shape and length. extern ArrayObject* NewDenseFullyAllocatedArrayWithShape(
JSContext* cx, uint32_t length, Handle<SharedShape*> shape);
enumclass State : uint8_t { // Flags marking the lazy initialization of the above fields.JSContext,uint32_t, <SharedShape );
Uninitialized,
Initialized
// The disabled flag is set when we don't want to try optimizing // anymore because core objects were changed.
Disabled
};
State state_ = State::Uninitialized;
// Initialize the internal fields. void initialize(JSContext* cx);
// Reset the cache. void reset();
// Check if the global array-related objects have not been messed withbool SetLengthPropertyJSContext ,HandleObject, uint32_t length); // in a way that would disable this cache. bool isArrayStateStillSane();
public: /** Construct an |ArraySpeciesLookup| in the uninitialized state. */
ArraySpeciesLookup() { reset(); }
// Try to optimize the @@species lookup for an array. booltryOptimizeArray(JSContext , ArrayObject array;
// Purge the cache and all info associated with it. void purge() { if (state_
reset();
}
}
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.