V8 Project
v8::internal::CompileTimeValue Class Reference

#include <parser.h>

+ Inheritance diagram for v8::internal::CompileTimeValue:
+ Collaboration diagram for v8::internal::CompileTimeValue:

Public Types

enum  LiteralType { OBJECT_LITERAL_FAST_ELEMENTS , OBJECT_LITERAL_SLOW_ELEMENTS , ARRAY_LITERAL }
 

Static Public Member Functions

static bool IsCompileTimeValue (Expression *expression)
 
static Handle< FixedArrayGetValue (Isolate *isolate, Expression *expression)
 
static LiteralType GetLiteralType (Handle< FixedArray > value)
 
static Handle< FixedArrayGetElements (Handle< FixedArray > value)
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (CompileTimeValue)
 

Static Private Attributes

static const int kLiteralTypeSlot = 0
 
static const int kElementsSlot = 1
 

Detailed Description

Definition at line 902 of file parser.h.

Member Enumeration Documentation

◆ LiteralType

Enumerator
OBJECT_LITERAL_FAST_ELEMENTS 
OBJECT_LITERAL_SLOW_ELEMENTS 
ARRAY_LITERAL 

Definition at line 904 of file parser.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::CompileTimeValue::DISALLOW_IMPLICIT_CONSTRUCTORS ( CompileTimeValue  )
private

◆ GetElements()

Handle< FixedArray > v8::internal::CompileTimeValue::GetElements ( Handle< FixedArray value)
static

Definition at line 3369 of file parser.cc.

3369  {
3370  return Handle<FixedArray>(FixedArray::cast(value->get(kElementsSlot)));
3371 }
static const int kElementsSlot
Definition: parser.h:923

Referenced by v8::internal::CreateLiteralBoilerplate().

+ Here is the caller graph for this function:

◆ GetLiteralType()

CompileTimeValue::LiteralType v8::internal::CompileTimeValue::GetLiteralType ( Handle< FixedArray value)
static

Definition at line 3362 of file parser.cc.

3363  {
3364  Smi* literal_type = Smi::cast(value->get(kLiteralTypeSlot));
3365  return static_cast<LiteralType>(literal_type->value());
3366 }
static const int kLiteralTypeSlot
Definition: parser.h:922

References v8::internal::Smi::value().

Referenced by v8::internal::CreateLiteralBoilerplate().

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

◆ GetValue()

Handle< FixedArray > v8::internal::CompileTimeValue::GetValue ( Isolate isolate,
Expression expression 
)
static

Definition at line 3338 of file parser.cc.

3339  {
3340  Factory* factory = isolate->factory();
3341  DCHECK(IsCompileTimeValue(expression));
3342  Handle<FixedArray> result = factory->NewFixedArray(2, TENURED);
3343  ObjectLiteral* object_literal = expression->AsObjectLiteral();
3344  if (object_literal != NULL) {
3345  DCHECK(object_literal->is_simple());
3346  if (object_literal->fast_elements()) {
3348  } else {
3350  }
3351  result->set(kElementsSlot, *object_literal->constant_properties());
3352  } else {
3353  ArrayLiteral* array_literal = expression->AsArrayLiteral();
3354  DCHECK(array_literal != NULL && array_literal->is_simple());
3356  result->set(kElementsSlot, *array_literal->constant_elements());
3357  }
3358  return result;
3359 }
static bool IsCompileTimeValue(Expression *expression)
Definition: parser.cc:3331
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
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)
Definition: logging.h:205

References DCHECK, v8::internal::Isolate::factory(), v8::internal::ParserBase< ParserTraits >::factory(), v8::internal::Smi::FromInt(), v8::internal::Parser::isolate(), NULL, and v8::internal::TENURED.

Referenced by v8::internal::MaterializedLiteral::GetBoilerplateValue().

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

◆ IsCompileTimeValue()

bool v8::internal::CompileTimeValue::IsCompileTimeValue ( Expression expression)
static

Definition at line 3331 of file parser.cc.

3331  {
3332  if (expression->IsLiteral()) return true;
3333  MaterializedLiteral* lit = expression->AsMaterializedLiteral();
3334  return lit != NULL && lit->is_simple();
3335 }

References v8::internal::AstNode::AsMaterializedLiteral(), v8::internal::MaterializedLiteral::is_simple(), and NULL.

Referenced by v8::internal::MaterializedLiteral::GetBoilerplateValue().

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

Member Data Documentation

◆ kElementsSlot

const int v8::internal::CompileTimeValue::kElementsSlot = 1
staticprivate

Definition at line 923 of file parser.h.

◆ kLiteralTypeSlot

const int v8::internal::CompileTimeValue::kLiteralTypeSlot = 0
staticprivate

Definition at line 922 of file parser.h.


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