34 using namespace v8::internal;
39 int old_linear_size =
static_cast<int>(space->
limit() - space->
top());
40 space->
Free(space->
top(), old_linear_size);
47 static MaybeObject* AllocateAfterFailures() {
48 static int attempts = 0;
50 Heap* heap = Isolate::Current()->heap();
55 while (new_space->
Available() > kNewSpaceFillerSize) {
56 int available_before =
static_cast<int>(new_space->
Available());
58 if (available_before == new_space->
Available()) {
74 *Isolate::Current()->object_function())->ToObjectChecked();
86 static const int kLargeObjectSpaceFillerLength = 300000;
88 kLargeObjectSpaceFillerLength);
104 CHECK(!heap->
CopyCode(Isolate::Current()->builtins()->builtin(
105 Builtins::kIllegal))->IsFailure());
127 static MaybeObject* TestAccessorGet(
Object*
object,
void*) {
128 return AllocateAfterFailures();
147 FACTORY->NewJSObject(
function);
148 function->ReplaceCode(Isolate::Current()->builtins()->builtin(
149 Builtins::kEmptyFunction));
156 ASSERT(instance_descriptors->IsEmpty());
161 map->set_instance_descriptors(*new_descriptors);
165 static_cast<PropertyAttributes>(0),
166 v8::internal::PropertyDetails::kInitialIndex);
167 map->AppendDescriptor(&d, witness);
189 static uint32_t
lo = 2345;
190 lo = 18273 * (lo & 0xFFFF) + (lo >> 16);
199 : base(base_arg), size(size_arg) {}
207 const int code_range_size = 32*
MB;
209 Isolate::Current()->InitializeLoggingAndCounters();
211 code_range->
SetUp(code_range_size);
212 int current_allocated = 0;
213 int total_allocated = 0;
216 while (total_allocated < 5 * code_range_size) {
217 if (current_allocated < code_range_size / 10) {
226 size_t allocated = 0;
229 blocks.
Add(
Block(base, static_cast<int>(allocated)));
230 current_allocated +=
static_cast<int>(allocated);
231 total_allocated +=
static_cast<int>(allocated);
235 code_range->
FreeRawMemory(blocks[index].base, blocks[index].size);
236 current_allocated -= blocks[index].size;
237 if (index < blocks.length() - 1) {
238 blocks[index] = blocks.RemoveLast();
MUST_USE_RESULT MaybeObject * CopyCode(Code *code)
static Local< Script > Compile(Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *pre_data=NULL, Handle< String > script_data=Handle< String >())
#define CHECK_EQ(expected, value)
MUST_USE_RESULT MaybeObject * AllocateFixedArray(int length, PretenureFlag pretenure)
void SetTop(Address top, Address limit)
bool SetUp(const size_t requested_size)
static Smi * FromInt(int value)
MUST_USE_RESULT MaybeObject * AllocateJSObject(JSFunction *constructor, PretenureFlag pretenure=NOT_TENURED)
static V8EXPORT Local< String > New(const char *data, int length=-1)
MUST_USE_RESULT MaybeObject * AllocateByteArray(int length, PretenureFlag pretenure)
MUST_USE_RESULT MaybeObject * AllocateRawAsciiString(int length, PretenureFlag pretenure=NOT_TENURED)
#define ASSERT(condition)
MUST_USE_RESULT MaybeObject * CopyJSObject(JSObject *source)
MUST_USE_RESULT MaybeObject * AllocateHeapNumber(double value, PretenureFlag pretenure)
static Smi * cast(Object *object)
unsigned int Pseudorandom()
static Failure * RetryAfterGC()
#define CALL_HEAP_FUNCTION(ISOLATE, FUNCTION_CALL, TYPE)
V8EXPORT int32_t Int32Value() const
OldSpace * old_pointer_space()
static const int kMaxNonCodeHeapObjectSize
MUST_USE_RESULT Address AllocateRawMemory(const size_t requested, size_t *allocated)
void SimulateFullSpace(PagedSpace *space)
int Free(Address start, int size_in_bytes)
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static int SizeFor(int length)
static int SizeFor(int length)
MUST_USE_RESULT MaybeObject * AllocateArgumentsObject(Object *callee, int length)
Block(Address base_arg, int size_arg)
static const int kHeaderSize
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
const AccessorDescriptor kDescriptor
static Persistent< Context > New(ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
void FreeRawMemory(Address buf, size_t length)
intptr_t OldGenerationSpaceAvailable()
MUST_USE_RESULT MaybeObject * AllocateMap(InstanceType instance_type, int instance_size, ElementsKind elements_kind=TERMINAL_FAST_ELEMENTS_KIND)
static JSObject * cast(Object *obj)
OldSpace * old_data_space()