6 #ifndef V8_HANDLES_INL_H_
7 #define V8_HANDLES_INL_H_
33 (location_ ==
NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) &&
34 (o.
location_ ==
NULL || o.IsDereferenceAllowed(NO_DEFERRED_CHECK)));
35 if (location_ == o.
location_)
return true;
43 SLOW_DCHECK(IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
44 return *bit_cast<T**>(location_);
48 inline T** Handle<T>::location()
const {
50 IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
56 bool Handle<T>::IsDereferenceAllowed(DereferenceCheckMode
mode)
const {
58 Object*
object = *bit_cast<T**>(location_);
59 if (object->IsSmi())
return true;
60 HeapObject* heap_object = HeapObject::cast(
object);
61 Heap* heap = heap_object->GetHeap();
63 Object** roots_array_start = heap->roots_array_start();
64 if (roots_array_start <=
handle &&
66 heap->RootCanBeTreatedAsConstant(
70 if (!AllowHandleDereference::IsAllowed())
return false;
71 if (
mode == INCLUDE_DEFERRED_CHECK &&
72 !AllowDeferredHandleDereference::IsAllowed()) {
74 if (heap_object->IsCell())
return true;
75 if (heap_object->IsMap())
return true;
76 if (heap_object->IsInternalizedString())
return true;
77 return !heap->isolate()->IsDeferredHandle(
handle);
104 std::swap(current->
next, prev_next);
106 if (current->
limit != prev_limit) {
107 current->
limit = prev_limit;
109 #ifdef ENABLE_HANDLE_ZAPPING
110 ZapRange(current->
next, prev_limit);
112 ZapRange(current->
next, prev_next);
118 template <
typename T>
122 T* value = *handle_value;
137 template <
typename T>
139 DCHECK(AllowHandleAllocation::IsAllowed());
146 DCHECK(cur < current->limit);
147 current->
next = cur + 1;
149 T** result =
reinterpret_cast<T**
>(cur);
156 inline SealHandleScope::SealHandleScope(
Isolate* isolate) : isolate_(isolate) {
158 CHECK(AllowHandleAllocation::IsAllowed());
162 limit_ = current->
limit;
164 level_ = current->
level;
169 inline SealHandleScope::~SealHandleScope() {
172 HandleScopeData* current = isolate_->handle_scope_data();
174 current->level = level_;
175 DCHECK_EQ(current->next, current->limit);
176 current->limit = limit_;
#define SLOW_DCHECK(condition)
HandleScope(Isolate *isolate)
Handle< T > CloseAndEscape(Handle< T > handle_value)
static void DeleteExtensions(Isolate *isolate)
static void CloseScope(Isolate *isolate, Object **prev_next, Object **prev_limit)
static T ** CreateHandle(Isolate *isolate, T *value)
static internal::Object ** Extend(Isolate *isolate)
HandleScopeData * handle_scope_data()
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
kSerializedDataOffset Object
Handle< T > handle(T *t, Isolate *isolate)
Debugger support for the V8 JavaScript engine.
internal::Object ** limit
#define T(name, string, precedence)