34 using namespace v8::internal;
37 static inline void SimulateFullSpace(
PagedSpace* space) {
38 int old_linear_size =
static_cast<int>(space->
limit() - space->
top());
39 space->
Free(space->
top(), old_linear_size);
46 static MaybeObject* AllocateAfterFailures() {
47 static int attempts = 0;
49 Heap* heap = Isolate::Current()->heap();
54 while (new_space->
Available() > kNewSpaceFillerSize) {
55 int available_before =
static_cast<int>(new_space->
Available());
57 if (available_before == new_space->
Available()) {
73 *Isolate::Current()->object_function())->ToObjectChecked();
85 static const int kLargeObjectSpaceFillerLength = 300000;
87 kLargeObjectSpaceFillerLength);
103 CHECK(!heap->
CopyCode(Isolate::Current()->builtins()->builtin(
104 Builtins::kIllegal))->IsFailure());
126 static MaybeObject* TestAccessorGet(
Object*
object,
void*) {
127 return AllocateAfterFailures();
146 FACTORY->NewJSObject(
function);
147 function->ReplaceCode(Isolate::Current()->builtins()->builtin(
148 Builtins::kEmptyFunction));
153 instance_descriptors =
FACTORY->CopyAppendForeignDescriptor(
154 instance_descriptors,
158 map->set_instance_descriptors(*instance_descriptors);
179 static uint32_t
lo = 2345;
180 lo = 18273 * (lo & 0xFFFF) + (lo >> 16);
189 : base(base_arg), size(size_arg) {}
197 const int code_range_size = 32*
MB;
199 Isolate::Current()->InitializeLoggingAndCounters();
201 code_range->
SetUp(code_range_size);
202 int current_allocated = 0;
203 int total_allocated = 0;
206 while (total_allocated < 5 * code_range_size) {
207 if (current_allocated < code_range_size / 10) {
216 size_t allocated = 0;
219 blocks.
Add(
Block(base, static_cast<int>(allocated)));
220 current_allocated +=
static_cast<int>(allocated);
221 total_allocated +=
static_cast<int>(allocated);
225 code_range->
FreeRawMemory(blocks[index].base, blocks[index].size);
226 current_allocated -= blocks[index].size;
227 if (index < blocks.length() - 1) {
228 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)
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)
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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt 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 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static const int kHeaderSize
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
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()