v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heap.cc File Reference
#include "v8.h"
#include "accessors.h"
#include "api.h"
#include "bootstrapper.h"
#include "codegen.h"
#include "compilation-cache.h"
#include "cpu-profiler.h"
#include "debug.h"
#include "deoptimizer.h"
#include "global-handles.h"
#include "heap-profiler.h"
#include "incremental-marking.h"
#include "isolate-inl.h"
#include "mark-compact.h"
#include "natives.h"
#include "objects-visiting.h"
#include "objects-visiting-inl.h"
#include "once.h"
#include "runtime-profiler.h"
#include "scopeinfo.h"
#include "snapshot.h"
#include "store-buffer.h"
#include "utils/random-number-generator.h"
#include "v8conversions.h"
#include "v8threads.h"
#include "v8utils.h"
#include "vm-state-inl.h"
Include dependency graph for heap.cc:

Go to the source code of this file.

Data Structures

class  ScavengeVisitor
 
class  ScavengeWeakObjectRetainer
 
struct  WeakListVisitor< T >
 
struct  WeakListVisitor< JSFunction >
 
struct  WeakListVisitor< Code >
 
struct  WeakListVisitor< Context >
 
struct  WeakListVisitor< JSArrayBufferView >
 
struct  WeakListVisitor< JSArrayBuffer >
 
struct  WeakListVisitor< AllocationSite >
 
class  NewSpaceScavenger
 
class  ScavengingVisitor< marks_handling, logging_and_profiling_mode >
 
class  HeapObjectsFilter
 
class  UnreachableObjectsFilter
 

Namespaces

 v8
 
 v8::internal
 

Macros

#define UPDATE_COUNTERS_FOR_SPACE(space)
 
#define UPDATE_FRAGMENTATION_FOR_SPACE(space)
 
#define UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(space)
 
#define STRING_TYPE_ELEMENT(type, size, name, camel_name)   {type, size, k##camel_name##MapRootIndex},
 
#define CONSTANT_STRING_ELEMENT(name, contents)   {contents, k##name##RootIndex},
 
#define STRUCT_TABLE_ELEMENT(NAME, Name, name)   { NAME##_TYPE, Name::kSize, k##Name##MapRootIndex },
 
#define ALLOCATE_MAP(instance_type, size, field_name)
 
#define ALLOCATE_VARSIZE_MAP(instance_type, field_name)   ALLOCATE_MAP(instance_type, kVariableSizeSentinel, field_name)
 
#define ALLOCATE_EXTERNAL_ARRAY_MAP(Type, type, TYPE, ctype, size)
 
#define ALLOCATE_FIXED_TYPED_ARRAY_MAP(Type, type, TYPE, ctype, size)
 
#define ALLOCATE_EMPTY_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size)
 
#define ALLOCATE_EMPTY_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size)
 
#define ARRAY_TYPE_TO_ROOT_INDEX(Type, type, TYPE, ctype, size)
 
#define ARRAY_TYPE_TO_ROOT_INDEX(Type, type, TYPE, ctype, size)
 
#define ELEMENT_KIND_TO_ROOT_INDEX(Type, type, TYPE, ctype, size)
 
#define ELEMENT_KIND_TO_ROOT_INDEX(Type, type, TYPE, ctype, size)
 
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size)
 
#define MAKE_CASE(NAME, Name, name)   case NAME##_TYPE: map = name##_map(); break;
 
#define ADJUST_LAST_TIME_OBJECT_COUNT(name)
 
#define ADJUST_LAST_TIME_OBJECT_COUNT(name)
 
#define ADJUST_LAST_TIME_OBJECT_COUNT(name)
 
#define ADJUST_LAST_TIME_OBJECT_COUNT(name)
 

Enumerations

enum  LoggingAndProfiling { LOGGING_AND_PROFILING_ENABLED, LOGGING_AND_PROFILING_DISABLED }
 
enum  MarksHandling { TRANSFER_MARKS, IGNORE_MARKS }
 

Functions

 STATIC_ASSERT ((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
 
 STATIC_ASSERT ((ConstantPoolArray::kHeaderSize &kDoubleAlignmentMask)==0)
 
 INLINE (static HeapObject *EnsureDoubleAligned(Heap *heap, HeapObject *object, int size))
 
 V8_DECLARE_ONCE (initialize_gc_once)
 

Macro Definition Documentation

#define ADJUST_LAST_TIME_OBJECT_COUNT (   name)
Value:
counters->count_of_##name()->Increment( \
static_cast<int>(object_counts_[name])); \
counters->count_of_##name()->Decrement( \
static_cast<int>(object_counts_last_time_[name])); \
counters->size_of_##name()->Increment( \
static_cast<int>(object_sizes_[name])); \
counters->size_of_##name()->Decrement( \
static_cast<int>(object_sizes_last_time_[name]));
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name

Referenced by Heap::CheckpointObjectStats().

#define ADJUST_LAST_TIME_OBJECT_COUNT (   name)
Value:
index = FIRST_CODE_KIND_SUB_TYPE + Code::name; \
counters->count_of_CODE_TYPE_##name()->Increment( \
static_cast<int>(object_counts_[index])); \
counters->count_of_CODE_TYPE_##name()->Decrement( \
static_cast<int>(object_counts_last_time_[index])); \
counters->size_of_CODE_TYPE_##name()->Increment( \
static_cast<int>(object_sizes_[index])); \
counters->size_of_CODE_TYPE_##name()->Decrement( \
static_cast<int>(object_sizes_last_time_[index]));
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
#define ADJUST_LAST_TIME_OBJECT_COUNT (   name)
Value:
index = FIRST_FIXED_ARRAY_SUB_TYPE + name; \
counters->count_of_FIXED_ARRAY_##name()->Increment( \
static_cast<int>(object_counts_[index])); \
counters->count_of_FIXED_ARRAY_##name()->Decrement( \
static_cast<int>(object_counts_last_time_[index])); \
counters->size_of_FIXED_ARRAY_##name()->Increment( \
static_cast<int>(object_sizes_[index])); \
counters->size_of_FIXED_ARRAY_##name()->Decrement( \
static_cast<int>(object_sizes_last_time_[index]));
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
#define ADJUST_LAST_TIME_OBJECT_COUNT (   name)
Value:
index = \
FIRST_CODE_AGE_SUB_TYPE + Code::k##name##CodeAge - Code::kFirstCodeAge; \
counters->count_of_CODE_AGE_##name()->Increment( \
static_cast<int>(object_counts_[index])); \
counters->count_of_CODE_AGE_##name()->Decrement( \
static_cast<int>(object_counts_last_time_[index])); \
counters->size_of_CODE_AGE_##name()->Increment( \
static_cast<int>(object_sizes_[index])); \
counters->size_of_CODE_AGE_##name()->Decrement( \
static_cast<int>(object_sizes_last_time_[index]));
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
#define ALLOCATE_EMPTY_EXTERNAL_ARRAY (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
{ ExternalArray* obj; \
if (!AllocateEmptyExternalArray(kExternal##Type##Array)->To(&obj)) \
return false; \
set_empty_external_##type##_array(obj); \
}
TypeImpl< ZoneTypeConfig > Type
HeapObject * obj
#define ALLOCATE_EMPTY_FIXED_TYPED_ARRAY (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
{ FixedTypedArrayBase* obj; \
if (!AllocateEmptyFixedTypedArray(kExternal##Type##Array)->To(&obj)) \
return false; \
set_empty_fixed_##type##_array(obj); \
}
TypeImpl< ZoneTypeConfig > Type
HeapObject * obj
#define ALLOCATE_EXTERNAL_ARRAY_MAP (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
ALLOCATE_MAP(EXTERNAL_##TYPE##_ARRAY_TYPE, ExternalArray::kAlignedSize, \
external_##type##_array)
#define ALLOCATE_MAP(instance_type, size, field_name)
#define ALLOCATE_FIXED_TYPED_ARRAY_MAP (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
ALLOCATE_VARSIZE_MAP(FIXED_##TYPE##_ARRAY_TYPE, \
fixed_##type##_array)
#define ALLOCATE_VARSIZE_MAP(instance_type, field_name)
#define ALLOCATE_MAP (   instance_type,
  size,
  field_name 
)
Value:
{ Map* map; \
if (!AllocateMap((instance_type), size)->To(&map)) return false; \
set_##field_name##_map(map); \
}
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
#define ALLOCATE_VARSIZE_MAP (   instance_type,
  field_name 
)    ALLOCATE_MAP(instance_type, kVariableSizeSentinel, field_name)
#define ARRAY_TYPE_TO_ROOT_INDEX (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case kExternal##Type##Array: \
return kExternal##Type##ArrayMapRootIndex;
TypeImpl< ZoneTypeConfig > Type

Referenced by Heap::RootIndexForExternalArrayType(), and Heap::RootIndexForFixedTypedArray().

#define ARRAY_TYPE_TO_ROOT_INDEX (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case kExternal##Type##Array: \
return kFixed##Type##ArrayMapRootIndex;
TypeImpl< ZoneTypeConfig > Type
#define CONSTANT_STRING_ELEMENT (   name,
  contents 
)    {contents, k##name##RootIndex},
#define ELEMENT_KIND_TO_ROOT_INDEX (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case EXTERNAL_##TYPE##_ELEMENTS: \
return kEmptyExternal##Type##ArrayRootIndex;
TypeImpl< ZoneTypeConfig > Type

Referenced by Heap::RootIndexForEmptyExternalArray(), and Heap::RootIndexForEmptyFixedTypedArray().

#define ELEMENT_KIND_TO_ROOT_INDEX (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case TYPE##_ELEMENTS: \
return kEmptyFixed##Type##ArrayRootIndex;
TypeImpl< ZoneTypeConfig > Type
#define MAKE_CASE (   NAME,
  Name,
  name 
)    case NAME##_TYPE: map = name##_map(); break;

Referenced by Heap::AllocateStruct().

#define STRING_TYPE_ELEMENT (   type,
  size,
  name,
  camel_name 
)    {type, size, k##camel_name##MapRootIndex},
#define STRUCT_TABLE_ELEMENT (   NAME,
  Name,
  name 
)    { NAME##_TYPE, Name::kSize, k##Name##MapRootIndex },
#define TYPED_ARRAY_CASE (   Type,
  type,
  TYPE,
  ctype,
  size 
)
Value:
case kExternal##Type##Array: \
*element_size = size; \
*element_kind = TYPE##_ELEMENTS; \
return;
TypeImpl< ZoneTypeConfig > Type
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
#define UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE (   space)
Value:
#define UPDATE_FRAGMENTATION_FOR_SPACE(space)
#define UPDATE_COUNTERS_FOR_SPACE(space)
#define UPDATE_COUNTERS_FOR_SPACE (   space)
Value:
isolate_->counters()->space##_bytes_available()->Set( \
static_cast<int>(space()->Available())); \
isolate_->counters()->space##_bytes_committed()->Set( \
static_cast<int>(space()->CommittedMemory())); \
isolate_->counters()->space##_bytes_used()->Set( \
static_cast<int>(space()->SizeOfObjects()));
#define UPDATE_FRAGMENTATION_FOR_SPACE (   space)
Value:
if (space()->CommittedMemory() > 0) { \
isolate_->counters()->external_fragmentation_##space()->AddSample( \
static_cast<int>(100 - \
(space()->SizeOfObjects() * 100.0) / space()->CommittedMemory())); \
}