33 #include "../include/v8-testing.h"
95 : value_(v8::internal::
Handle<v8::internal::JSObject>::cast(obj)) { }
99 : value_(v8::internal::
Handle<v8::internal::JSObject>(
100 v8::internal::JSObject::cast(obj))) { }
114 ASSERT(value_->HasFastObjectElements());
121 return reinterpret_cast<T>(
122 reinterpret_cast<intptr_t
>(
127 template <
typename T>
131 reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj)));
249 return reinterpret_cast<T*
>(obj.
location());
266 #define MAKE_TO_LOCAL(Name, From, To) \
267 Local<v8::To> Utils::Name(v8::internal::Handle<v8::internal::From> obj) { \
268 ASSERT(obj.is_null() || !obj->IsTheHole()); \
269 return Local<To>(reinterpret_cast<To*>(obj.location())); \
280 MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate)
283 MAKE_TO_LOCAL(AccessorSignatureToLocal, FunctionTemplateInfo, AccessorSignature)
297 #define MAKE_OPEN_HANDLE(From, To) \
298 v8::internal::Handle<v8::internal::To> Utils::OpenHandle(\
299 const v8::From* that) { \
300 return v8::internal::Handle<v8::internal::To>( \
301 reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \
323 #undef MAKE_OPEN_HANDLE
341 if (IsFreshString(address, top)) {
342 IncrementUseCount(top);
352 return IsFreshString(address, top) && IsUseCountLow(top);
359 return top - kFreshnessLimit <=
string &&
string <= top;
362 inline bool IsUseCountLow(
Address top) {
363 if (last_top_ != top)
return true;
364 return use_count_ < kUseLimit;
367 inline void IncrementUseCount(
Address top) {
368 if (last_top_ != top) {
384 static const int kFreshnessLimit = 1024;
387 static const int kUseLimit = 32;
409 entered_contexts_(0),
425 void Iterate(v8::internal::ObjectVisitor* v);
426 static char*
Iterate(v8::internal::ObjectVisitor* v,
char* data);
450 void ResetAfterArchive() {
451 blocks_.Initialize(0);
452 entered_contexts_.Initialize(0);
453 saved_contexts_.Initialize(0);
459 ASSERT(blocks_.length() == 0);
460 ASSERT(entered_contexts_.length() == 0);
461 ASSERT(saved_contexts_.length() == 0);
463 entered_contexts_.Free();
464 saved_contexts_.Free();
465 if (spare_ !=
NULL) {
473 List<internal::Object**> blocks_;
475 List<Handle<Object> > entered_contexts_;
477 List<Context*> saved_contexts_;
483 void IterateThis(ObjectVisitor* v);
484 char* RestoreThreadHelper(
char* from);
485 char* ArchiveThreadHelper(
char* to);
495 saved_contexts_.Add(context);
500 return saved_contexts_.RemoveLast();
505 return !saved_contexts_.is_empty();
510 entered_contexts_.Add(context);
515 if (entered_contexts_.is_empty())
return false;
516 entered_contexts_.RemoveLast();
523 return entered_contexts_.last();
538 while (!blocks_.is_empty()) {
543 if (block_start <= prev_limit && prev_limit <= block_limit)
break;
545 if (prev_limit == block_limit)
break;
548 blocks_.RemoveLast();
550 v8::ImplementationUtilities::ZapHandleRange(block_start, block_limit);
552 if (spare_ !=
NULL) {
555 spare_ = block_start;
557 ASSERT((blocks_.is_empty() && prev_limit ==
NULL) ||
558 (!blocks_.is_empty() && prev_limit !=
NULL));
void SaveContext(Context *context)
static void set_stress_type(v8::Testing::StressType stress_type)
RegisteredExtension * next()
internal::Object ** GetSpareOrNewBlock()
HandleScopeImplementer(Isolate *isolate)
void RecordWrite(Handle< String > string)
v8::internal::Handle< v8::internal::JSObject > value()
void set(int index, v8::internal::Object *value)
static Local< Number > NumberToLocal(v8::internal::Handle< v8::internal::Object > obj)
char * ArchiveThread(char *to)
static Local< AccessorSignature > AccessorSignatureToLocal(v8::internal::Handle< v8::internal::FunctionTemplateInfo > obj)
char * RestoreThread(char *from)
v8::HandleScope::Data HandleScopeData
static Foreign * cast(Object *obj)
void DeleteExtensions(internal::Object **prev_limit)
T ToCData(v8::internal::Object *obj)
#define ASSERT(condition)
void EnterContext(Handle< Object > context)
Handle< Object > LastEnteredContext()
v8::internal::Address address()
v8::internal::Handle< v8::internal::JSObject > value()
#define MAKE_OPEN_HANDLE(From, To)
static Local< StackFrame > StackFrameToLocal(v8::internal::Handle< v8::internal::JSObject > obj)
HANDLE HANDLE LPSTACKFRAME64 StackFrame
static Local< StackTrace > StackTraceToLocal(v8::internal::Handle< v8::internal::JSArray > obj)
static Local< Message > MessageToLocal(v8::internal::Handle< v8::internal::Object > obj)
ApiFunction(v8::internal::Address addr)
static Local< Uint32 > Uint32ToLocal(v8::internal::Handle< v8::internal::Object > obj)
static int ArchiveSpacePerThread()
void IncrementCallDepth()
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
static Local< Integer > IntegerToLocal(v8::internal::Handle< v8::internal::Object > obj)
static void UnregisterAll()
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
#define T(name, string, precedence)
RegisteredExtension(Extension *extension)
List< internal::Object ** > * blocks()
bool IsFreshUnusedString(Handle< String > string)
~HandleScopeImplementer()
void add(v8::internal::Handle< v8::internal::Object > value)
static RegisteredExtension * first_extension()
void FreeThreadResources()
v8::internal::Handle< v8::internal::Object > FromCData(T obj)
void Iterate(v8::internal::ObjectVisitor *v)
Handle< T > EscapeFrom(v8::HandleScope *scope)
RegisteredExtension * next_auto()
const int kHandleBlockSize
void set(int index, v8::internal::Object *value)
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 void Register(RegisteredExtension *that)
Context * RestoreContext()
Local< T > Close(Handle< T > value)
static FixedArray * cast(Object *obj)
static bool ReportApiFailure(const char *location, const char *message)
static Local< FunctionTemplate > ToFunctionTemplate(NeanderObject obj)
Address foreign_address()
#define STATIC_ASSERT(test)
void DeleteArray(T *array)
void DecrementCallDepth()
static Local< ObjectTemplate > ToObjectTemplate(NeanderObject obj)
v8::internal::Object * get(int index)
static v8::internal::Handle< v8::internal::TemplateInfo > OpenHandle(const Template *that)
#define MAKE_TO_LOCAL(Name, From, To)
T * ToApi(v8::internal::Handle< v8::internal::Object > obj)
static v8::Testing::StressType stress_type()