V8 Project
v8::internal::MaterializedObjectStore Class Reference

#include <deoptimizer.h>

+ Collaboration diagram for v8::internal::MaterializedObjectStore:

Public Member Functions

 MaterializedObjectStore (Isolate *isolate)
 
Handle< FixedArrayGet (Address fp)
 
void Set (Address fp, Handle< FixedArray > materialized_objects)
 
void Remove (Address fp)
 

Private Member Functions

Isolateisolate ()
 
Handle< FixedArrayGetStackEntries ()
 
Handle< FixedArrayEnsureStackEntries (int size)
 
int StackIdToIndex (Address fp)
 

Private Attributes

Isolateisolate_
 
List< Addressframe_fps_
 

Detailed Description

Definition at line 889 of file deoptimizer.h.

Constructor & Destructor Documentation

◆ MaterializedObjectStore()

v8::internal::MaterializedObjectStore::MaterializedObjectStore ( Isolate isolate)
inlineexplicit

Definition at line 891 of file deoptimizer.h.

Member Function Documentation

◆ EnsureStackEntries()

Handle< FixedArray > v8::internal::MaterializedObjectStore::EnsureStackEntries ( int  size)
private

Definition at line 3568 of file deoptimizer.cc.

3568  {
3569  Handle<FixedArray> array = GetStackEntries();
3570  if (array->length() >= length) {
3571  return array;
3572  }
3573 
3574  int new_length = length > 10 ? length : 10;
3575  if (new_length < 2 * array->length()) {
3576  new_length = 2 * array->length();
3577  }
3578 
3579  Handle<FixedArray> new_array =
3580  isolate()->factory()->NewFixedArray(new_length, TENURED);
3581  for (int i = 0; i < array->length(); i++) {
3582  new_array->set(i, array->get(i));
3583  }
3584  for (int i = array->length(); i < length; i++) {
3585  new_array->set(i, isolate()->heap()->undefined_value());
3586  }
3587  isolate()->heap()->public_set_materialized_objects(*new_array);
3588  return new_array;
3589 }
void public_set_materialized_objects(FixedArray *objects)
Definition: heap.h:891
Factory * factory()
Definition: isolate.h:982
Handle< FixedArray > GetStackEntries()

References v8::internal::Isolate::factory(), GetStackEntries(), v8::internal::Isolate::heap(), isolate(), v8::internal::Heap::public_set_materialized_objects(), and v8::internal::TENURED.

Referenced by Set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Get()

Handle< FixedArray > v8::internal::MaterializedObjectStore::Get ( Address  fp)

Definition at line 3514 of file deoptimizer.cc.

3514  {
3515  int index = StackIdToIndex(fp);
3516  if (index == -1) {
3517  return Handle<FixedArray>::null();
3518  }
3519  Handle<FixedArray> array = GetStackEntries();
3520  CHECK_GT(array->length(), index);
3521  return Handle<FixedArray>::cast(Handle<Object>(array->get(index),
3522  isolate()));
3523 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Handle< T > null()
Definition: handles.h:123
#define CHECK_GT(a, b)
Definition: logging.h:177
const Register fp

References v8::internal::Handle< T >::cast(), CHECK_GT, v8::internal::fp, GetStackEntries(), isolate(), v8::internal::Handle< T >::null(), and StackIdToIndex().

Referenced by v8::internal::Deoptimizer::MaterializeHeapObjects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetStackEntries()

Handle< FixedArray > v8::internal::MaterializedObjectStore::GetStackEntries ( )
private

Definition at line 3563 of file deoptimizer.cc.

3563  {
3564  return Handle<FixedArray>(isolate()->heap()->materialized_objects());
3565 }

References isolate().

Referenced by EnsureStackEntries(), Get(), and Remove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isolate()

Isolate* v8::internal::MaterializedObjectStore::isolate ( )
inlineprivate

Definition at line 899 of file deoptimizer.h.

899 { return isolate_; }

References isolate_.

Referenced by EnsureStackEntries(), Get(), GetStackEntries(), and Remove().

+ Here is the caller graph for this function:

◆ Remove()

void v8::internal::MaterializedObjectStore::Remove ( Address  fp)

Definition at line 3539 of file deoptimizer.cc.

3539  {
3540  int index = StackIdToIndex(fp);
3541  CHECK_GE(index, 0);
3542 
3543  frame_fps_.Remove(index);
3544  Handle<FixedArray> array = GetStackEntries();
3545  CHECK_LT(index, array->length());
3546  for (int i = index; i < frame_fps_.length(); i++) {
3547  array->set(i, array->get(i + 1));
3548  }
3549  array->set(frame_fps_.length(), isolate()->heap()->undefined_value());
3550 }
T Remove(int i)
Definition: list-inl.h:103
#define CHECK_LT(a, b)
Definition: logging.h:179
#define CHECK_GE(a, b)
Definition: logging.h:178

References CHECK_GE, CHECK_LT, v8::internal::fp, frame_fps_, GetStackEntries(), isolate(), v8::internal::List< T, AllocationPolicy >::Remove(), and StackIdToIndex().

Referenced by v8::internal::Deoptimizer::MaterializeHeapObjects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Set()

void v8::internal::MaterializedObjectStore::Set ( Address  fp,
Handle< FixedArray materialized_objects 
)

Definition at line 3526 of file deoptimizer.cc.

3527  {
3528  int index = StackIdToIndex(fp);
3529  if (index == -1) {
3530  index = frame_fps_.length();
3531  frame_fps_.Add(fp);
3532  }
3533 
3534  Handle<FixedArray> array = EnsureStackEntries(index + 1);
3535  array->set(index, *materialized_objects);
3536 }
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17
Handle< FixedArray > EnsureStackEntries(int size)

References v8::internal::List< T, AllocationPolicy >::Add(), EnsureStackEntries(), v8::internal::fp, frame_fps_, and StackIdToIndex().

+ Here is the call graph for this function:

◆ StackIdToIndex()

int v8::internal::MaterializedObjectStore::StackIdToIndex ( Address  fp)
private

Definition at line 3553 of file deoptimizer.cc.

3553  {
3554  for (int i = 0; i < frame_fps_.length(); i++) {
3555  if (frame_fps_[i] == fp) {
3556  return i;
3557  }
3558  }
3559  return -1;
3560 }

References v8::internal::fp, and frame_fps_.

Referenced by Get(), Remove(), and Set().

+ Here is the caller graph for this function:

Member Data Documentation

◆ frame_fps_

List<Address> v8::internal::MaterializedObjectStore::frame_fps_
private

Definition at line 906 of file deoptimizer.h.

Referenced by Remove(), Set(), and StackIdToIndex().

◆ isolate_

Isolate* v8::internal::MaterializedObjectStore::isolate_
private

Definition at line 905 of file deoptimizer.h.

Referenced by isolate().


The documentation for this class was generated from the following files: