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
Smi Class Reference

#include <objects.h>

Inheritance diagram for Smi:
Collaboration diagram for Smi:

Public Member Functions

int value ()
 
void SmiPrint (FILE *out=stdout)
 
void SmiPrint (StringStream *accumulator)
 
- Public Member Functions inherited from Object
bool IsObject ()
 
bool IsFixedArrayBase ()
 
bool IsExternal ()
 
bool IsAccessorInfo ()
 
bool IsStruct ()
 
 INLINE (bool IsSpecObject())
 
 INLINE (bool IsSpecFunction())
 
bool IsCallable ()
 
 INLINE (bool IsUndefined())
 
 INLINE (bool IsNull())
 
 INLINE (bool IsTheHole())
 
 INLINE (bool IsUninitialized())
 
 INLINE (bool IsTrue())
 
 INLINE (bool IsFalse())
 
bool IsArgumentsMarker ()
 
bool NonFailureIsHeapObject ()
 
bool IsFiller ()
 
double Number ()
 
bool IsNaN ()
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation (ValueType type=OPTIMAL_REPRESENTATION)
 
bool FitsRepresentation (Representation representation)
 
MaybeObject * AllocateNewStorageFor (Heap *heap, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
MUST_USE_RESULT MaybeObject * ToObject (Isolate *isolate)
 
bool BooleanValue ()
 
MUST_USE_RESULT MaybeObject * ToObject (Context *native_context)
 
MUST_USE_RESULT MaybeObject * ToSmi ()
 
void Lookup (Name *name, LookupResult *result)
 
MUST_USE_RESULT MaybeObject * GetProperty (Name *key)
 
MUST_USE_RESULT MaybeObject * GetProperty (Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithReceiver (Object *receiver, Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetProperty (Object *receiver, LookupResult *result, Name *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithDefinedGetter (Object *receiver, JSReceiver *getter)
 
ObjectGetPrototype (Isolate *isolate)
 
MapGetMarkerMap (Isolate *isolate)
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static SmiFromInt (int value)
 
static SmiFromIntptr (intptr_t value)
 
static bool IsValid (intptr_t value)
 
static Smicast (Object *object)
 
- Static Public Member Functions inherited from Object
static MUST_USE_RESULT Handle
< Object
ToSmi (Isolate *isolate, Handle< Object > object)
 
static Handle< ObjectGetPropertyWithReceiver (Handle< Object > object, Handle< Object > receiver, Handle< Name > name, PropertyAttributes *attributes)
 
static Handle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static Handle< ObjectGetProperty (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< Name > key, PropertyAttributes *attributes)
 
static MUST_USE_RESULT
MaybeObject * 
GetPropertyOrFail (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< Name > key, PropertyAttributes *attributes)
 
static Handle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static Handle< ObjectGetElementNoExceptionThrown (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static Handle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< ObjectGetOrCreateHash (Handle< Object > object, Isolate *isolate)
 
static Objectcast (Object *value)
 

Static Public Attributes

static const int kMinValue
 
static const int kMaxValue = -(kMinValue + 1)
 
- Static Public Attributes inherited from Object
static const int kHeaderSize = 0
 

Additional Inherited Members

- Public Types inherited from Object
enum  ValueType { OPTIMAL_REPRESENTATION, FORCE_TAGGED }
 

Detailed Description

Definition at line 1657 of file objects.h.

Member Function Documentation

static Smi* cast ( Object object)
inlinestatic

Referenced by ObjectHashSet::Add(), SharedFunctionInfo::AddToOptimizedCodeMap(), HeapTypeConfig::as_bitset(), HeapRep::AsBitset(), DeoptimizationOutputData::AstId(), Map::bit_field3(), Object::BooleanValue(), v8::internal::BUILTIN(), SharedFunctionInfo::builtin_function_id(), AllocationSite::CanInlineCall(), HashTable< StringTableShape, HashTableKey * >::Capacity(), JSRegExp::CaptureCount(), Isolate::CaptureCurrentStackTrace(), TypeFeedbackInfo::change_ic_with_type_info_count(), TypeFeedbackInfo::change_own_type_change_checksum(), ScopeInfo::ContextLocalInitFlag(), ScopeInfo::ContextLocalMode(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::CopyElements(), NameDictionary::CopyEnumKeysTo(), Factory::CreateApiFunction(), Runtime::CreateArrayLiteralBoilerplate(), Date::DateTimeConfigurationChangeNotification(), FastElementsAccessor< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS >, kPointerSize >::DeleteCommon(), Dictionary< NameDictionaryShape, Name * >::DetailsAt(), SharedFunctionInfo::EvictFromOptimizedCodeMap(), JSFunctionResultCache::finger_index(), TypeFeedbackOracle::ForInType(), JSObject::Freeze(), ScopeInfo::FunctionContextSlotIndex(), Runtime::FunctionForName(), Dictionary< Shape, Key >::GenerateNewEnumerationIndices(), JavaScriptFrame::GetArgumentsLength(), RegExpImpl::GetCapture(), StackFrame::GetColumn(), DescriptorArray::GetDetails(), AllocationSite::GetElementsKind(), JSRegExp::GetFlags(), StackTrace::GetFrameCount(), SloppyArgumentsElementsAccessor::GetImpl(), DictionaryElementsAccessor::GetKeyForIndexImpl(), RegExpImpl::GetLastCaptureCount(), StackFrame::GetLineNumber(), CompileTimeValue::GetLiteralType(), JSObject::GetLocalElementKeys(), ArgumentsAdaptorFrame::GetNumberOfIncomingArguments(), Heap::GetNumberStringCache(), v8::internal::GetScriptColumnNumber(), StackFrame::GetScriptId(), v8::internal::GetScriptLineNumber(), ObjectHashTableShape< entrysize >::Hash(), ObjectHashTableShape< entrysize >::HashForObject(), StringSharedKey::HashForObject(), RegExpKey::HashForObject(), ModuleInfo::host_index(), TypeFeedbackInfo::ic_total_count(), TypeFeedbackInfo::ic_with_type_info_count(), ModuleInfo::index(), Execution::InstantiateFunction(), Value::Int32Value(), Value::IntegerValue(), ObjectTemplate::InternalFieldCount(), RegExpImpl::IrregexpMaxRegisterCount(), RegExpImpl::IrregexpNumberOfCaptures(), RegExpImpl::IrregexpNumberOfRegisters(), StringSharedKey::IsMatch(), v8::internal::IsOutOfBoundsAccess(), Value::IsUint32(), Oddball::kind(), NeanderArray::length(), Array::Length(), Logger::LogRuntime(), ObjectHashTableTest::lookup(), TypeFeedbackInfo::matches_inlined_type_change_checksum(), SeededNumberDictionary::max_number_key(), ModuleInfo::mode(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Dictionary< NameDictionaryShape, Name * >::NextEnumerationIndex(), JSObject::NormalizeElements(), DescriptorArray::number_of_descriptors(), DependentCode::number_of_entries(), HashTable< StringTableShape, HashTableKey * >::NumberOfDeletedElements(), HashTable< StringTableShape, HashTableKey * >::NumberOfElements(), JSObject::NumberOfEnumElements(), Map::NumberOfProtoTransitions(), v8::internal::NumberToInt32(), Heap::NumberToString(), v8::internal::NumberToUint32(), TypeFeedbackInfo::own_type_change_checksum(), DeoptimizationOutputData::PcAndState(), JSObject::PrepareSlowElementsForSort(), SeededNumberDictionary::requires_slow_elements(), v8::internal::RUNTIME_FUNCTION(), TypeFeedbackInfo::set_ic_total_count(), TypeFeedbackInfo::set_inlined_type_change_checksum(), AllocationSite::SetDoNotInlineCall(), AllocationSite::SetElementsKind(), Heap::SetNumberStringCache(), ExternalUint8ClampedArray::SetValue(), ExternalUint32Array::SetValue(), ExternalFloat32Array::SetValue(), ExternalFloat64Array::SetValue(), FixedTypedArray< Traits >::SetValue(), Object::ShortPrint(), JSFunctionResultCache::size(), BASE_EMBEDDED< Visitor >::smi_at(), Code::stub_info(), FixedArray::SwapPairs(), TEST(), THREADED_TEST(), Value::ToArrayIndex(), Object::ToArrayIndex(), Object::ToInt32(), Object::ToUint32(), v8::internal::TryNumberToSize(), JSRegExp::TypeTag(), Value::Uint32Value(), ToBooleanStub::Types::UpdateStatus(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::ValidateImpl(), Integer::Value(), Int32::Value(), and Uint32::Value().

Smi * FromInt ( int  value)
inlinestatic

Definition at line 1209 of file objects-inl.h.

References ASSERT, Internals::IntToSmi(), and Smi::IsValid().

Referenced by BASE_EMBEDDED< Visitor >::Add(), NeanderArray::add(), ReplacementStringBuilder::AddSubjectSlice(), SharedFunctionInfo::AddToOptimizedCodeMap(), TransitionArray::Allocate(), FreeList::Allocate(), DescriptorArray::Allocate(), Heap::AllocateAccessorPair(), Heap::AllocateArgumentsObject(), Heap::AllocateFunctionContext(), Heap::AllocateJSArrayAndStorage(), Heap::AllocateJSArrayStorage(), Heap::AllocateJSArrayWithElements(), Heap::AllocateJSFunctionProxy(), Heap::AllocateJSProxy(), Heap::AllocateModuleContext(), Object::AllocateNewStorageFor(), LargeObjectSpace::AllocateRaw(), Heap::AllocateSharedFunctionInfo(), Heap::AllocateSymbol(), v8::internal::ArrayConstructInitializeElements(), PolymorphicCodeCacheHashTableKey::AsObject(), StringSharedKey::AsObject(), CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub(), v8::internal::BUILTIN(), v8::internal::CalculateLineEnds(), Isolate::CaptureCurrentStackTrace(), Isolate::CaptureSimpleStackTrace(), TypeFeedbackInfo::change_ic_with_type_info_count(), TypeFeedbackInfo::change_own_type_change_checksum(), v8::internal::CheckArrayAbuse(), RegExpResultsCache::Clear(), DescriptorArray::ClearEnumCache(), SharedFunctionInfo::ClearOptimizedCodeMap(), MarkCompactCollector::CollectGarbage(), Compiler::CompileScript(), NameDictionary::CopyEnumKeysTo(), ScopeInfo::Create(), Heap::CreateApiObjects(), Runtime::CreateArrayLiteralBoilerplate(), Heap::CreateCode(), Date::DateTimeConfigurationChangeNotification(), Deserializer::Deserialize(), CompareNilIC::DoCompareNilSlow(), LCodeGen::DoDeferredAllocate(), LCodeGen::DoDeferredStringCharCodeAt(), RegExpResultsCache::Enter(), Value::Equals(), HeapTypeConfig::from_bitset(), JSReceiver::GenerateIdentityHash(), Dictionary< Shape, Key >::GenerateNewEnumerationIndices(), ExternalUint8ClampedArray::get(), ExternalInt8Array::get(), ExternalUint8Array::get(), ExternalInt16Array::get(), ExternalUint16Array::get(), JSTypedArray::GetBuffer(), v8::internal::GetEnumPropertyKeys(), Object::GetHash(), JSObject::GetLocalElementKeys(), CompileTimeValue::GetValue(), TransitionArray::HasPrototypeTransitions(), AllocationSite::Initialize(), TypeFeedbackInfo::initialize_storage(), Runtime::InitializeIntrinsicFunctionNames(), MacroAssembler::InitializeSmiConstantRegister(), ObjectHashTableTest::insert(), StandardFrame::IsArgumentsAdaptorFrame(), StandardFrame::IsConstructFrame(), SerializerDeserializer::Iterate(), ObjectHashTableTest::lookup(), RegExpResultsCache::Lookup(), Accessors::MakeModuleExport(), JSObject::MigrateToMap(), TypeFeedbackInfo::MonomorphicArraySentinel(), NeanderArray::NeanderArray(), JSArrayBuffer::Neuter(), JSTypedArray::Neuter(), JSArrayBufferView::NeuterView(), Integer::New(), Factory::NewScript(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Heap::NumberFromDouble(), Heap::NumberFromInt32(), Heap::NumberFromUint32(), JSObject::PrepareElementsForSort(), JSObject::PrepareSlowElementsForSort(), Isolate::PrintCurrentStackTrace(), DateCache::ResetDateCache(), v8::internal::RUNTIME_FUNCTION(), SharedFunctionInfo::SearchOptimizedCodeMap(), BooleanBit::set(), AccessorPair::set_access_flags(), Map::set_bit_field3(), AllocationSite::set_deopt_dependent_code(), JSFunctionResultCache::set_finger_index(), TypeFeedbackInfo::set_ic_total_count(), TypeFeedbackInfo::set_inlined_type_change_checksum(), Oddball::set_kind(), AllocationSite::set_memento_create_count(), AllocationSite::set_memento_found_count(), DependentCode::set_number_of_entries(), AllocationSite::set_pretenure_decision(), AccessorInfo::set_property_attributes(), SeededNumberDictionary::set_requires_slow_elements(), JSFunctionResultCache::set_size(), Code::set_stub_info(), Heap::SetArgumentsAdaptorDeoptPCOffset(), DeoptimizationInputData::SetAstId(), DeoptimizationOutputData::SetAstId(), HashTable< StringTableShape, HashTableKey * >::SetCapacity(), RegExpImpl::SetCapture(), Heap::SetConstructStubDeoptPCOffset(), JSArray::SetContent(), AllocationSite::SetDoNotInlineCall(), AllocationSite::SetElementsKind(), Dictionary< Shape, Key >::SetEntry(), JSObject::SetFastDoubleElementsCapacityAndLength(), JSObject::SetFastElement(), JSObject::SetFastElementsCapacityAndLength(), Heap::SetGetterStubDeoptPCOffset(), ObjectTemplate::SetInternalFieldCount(), RegExpImpl::SetIrregexpMaxRegisterCount(), RegExpImpl::SetLastCaptureCount(), Dictionary< NameDictionaryShape, Name * >::SetNextEnumerationIndex(), HashTable< StringTableShape, HashTableKey * >::SetNumberOfDeletedElements(), DescriptorArray::SetNumberOfDescriptors(), HashTable< StringTableShape, HashTableKey * >::SetNumberOfElements(), Map::SetNumberOfProtoTransitions(), Factory::SetRegExpAtomData(), Factory::SetRegExpIrregexpData(), Heap::SetSetterStubDeoptPCOffset(), Heap::SetUp(), Runtime::SetupArrayBuffer(), ExternalUint8ClampedArray::SetValue(), JSDate::SetValue(), IntrusiveMapTransitionIterator::Start(), IntrusivePrototypeTransitionIterator::Start(), TEST(), TestI64PlusConstantToSmi(), TestPositiveSmiPowerUp(), TestSelectNonSmi(), TestSmiAnd(), TestSmiCompare(), TestSmiDiv(), TestSmiIndex(), TestSmiMod(), TestSmiMul(), TestSmiNeg(), TestSmiNot(), TestSmiOr(), TestSmiShiftArithmeticRight(), TestSmiShiftLeft(), TestSmiShiftLogicalRight(), TestSmiXor(), THREADED_TEST(), Value::ToArrayIndex(), ToBooleanIC::ToBoolean(), FixedArrayBuilder::ToJSArray(), LCodeGen::ToOperand(), LCodeGen::ToRepresentation(), LCodeGen::ToSmi(), Object::ToSmi(), Types< Type, TypeHandle, Region >::Types(), SeededNumberDictionary::UpdateMaxNumberKey(), V8_FINAL< kOperandKind, kNumCachedOperands >::value(), and MarkCompactMarkingVisitor::VisitWeakCollection().

Smi * FromIntptr ( intptr_t  value)
inlinestatic
void SmiPrint ( FILE *  out = stdout)

Definition at line 1142 of file objects.cc.

References v8::internal::PrintF(), and Smi::value().

Referenced by Object::ShortPrint().

void SmiPrint ( StringStream accumulator)

Definition at line 1147 of file objects.cc.

References StringStream::Add(), and Smi::value().

int value ( )
inline

Definition at line 1204 of file objects-inl.h.

References Internals::SmiValue().

Referenced by ObjectHashSet::Add(), HeapTypeConfig::as_bitset(), HeapRep::AsBitset(), DeoptimizationInputData::AstId(), DeoptimizationOutputData::AstId(), Map::bit_field3(), Object::BooleanValue(), v8::internal::BUILTIN(), SharedFunctionInfo::builtin_function_id(), AllocationSite::CanInlineCall(), HashTable< StringTableShape, HashTableKey * >::Capacity(), JSRegExp::CaptureCount(), TypeFeedbackInfo::change_ic_with_type_info_count(), TypeFeedbackInfo::change_own_type_change_checksum(), ScopeInfo::ContextLocalInitFlag(), ScopeInfo::ContextLocalMode(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::CopyElements(), FastElementsAccessor< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS >, kPointerSize >::DeleteCommon(), JSFunctionResultCache::finger_index(), TypeFeedbackOracle::ForInType(), JSObject::Freeze(), ScopeInfo::FunctionContextSlotIndex(), Runtime::FunctionForName(), JavaScriptFrame::GetArgumentsLength(), StackFrame::GetColumn(), AllocationSite::GetElementsKind(), JSDate::GetField(), JSRegExp::GetFlags(), StackTrace::GetFrameCount(), SloppyArgumentsElementsAccessor::GetImpl(), DictionaryElementsAccessor::GetKeyForIndexImpl(), StackFrame::GetLineNumber(), CompileTimeValue::GetLiteralType(), JSObject::GetLocalElementKeys(), ArgumentsAdaptorFrame::GetNumberOfIncomingArguments(), Deoptimizer::GetOutputInfo(), StackFrame::GetScriptId(), ModuleInfo::host_index(), TypeFeedbackInfo::ic_total_count(), TypeFeedbackInfo::ic_with_type_info_count(), ModuleInfo::index(), Value::Int32Value(), Value::IntegerValue(), ObjectTemplate::InternalFieldCount(), Value::IsUint32(), Oddball::kind(), Array::Length(), Logger::LogRuntime(), ObjectHashTableTest::lookup(), TypeFeedbackInfo::matches_inlined_type_change_checksum(), SeededNumberDictionary::max_number_key(), ModuleInfo::mode(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Dictionary< NameDictionaryShape, Name * >::NextEnumerationIndex(), JSObject::NormalizeElements(), DescriptorArray::number_of_descriptors(), DependentCode::number_of_entries(), HashTable< StringTableShape, HashTableKey * >::NumberOfDeletedElements(), HashTable< StringTableShape, HashTableKey * >::NumberOfElements(), JSObject::NumberOfEnumElements(), Map::NumberOfProtoTransitions(), v8::internal::NumberToInt32(), Heap::NumberToString(), v8::internal::NumberToUint32(), EnumIndexComparator::operator()(), TypeFeedbackInfo::own_type_change_checksum(), JSObject::PrepareSlowElementsForSort(), RegExpKey::RegExpHash(), SeededNumberDictionary::requires_slow_elements(), DateCache::ResetDateCache(), v8::internal::RUNTIME_FUNCTION(), BooleanBit::set(), TypeFeedbackInfo::set_ic_total_count(), TypeFeedbackInfo::set_inlined_type_change_checksum(), AllocationSite::SetDoNotInlineCall(), AllocationSite::SetElementsKind(), ExternalUint8ClampedArray::SetValue(), ExternalUint32Array::SetValue(), ExternalFloat32Array::SetValue(), ExternalFloat64Array::SetValue(), FixedTypedArray< Traits >::SetValue(), JSFunctionResultCache::size(), BASE_EMBEDDED< Visitor >::smi_at(), Smi::SmiPrint(), Code::stub_info(), TEST(), THREADED_TEST(), Value::ToArrayIndex(), Object::ToArrayIndex(), Object::ToInt32(), Object::ToUint32(), v8::internal::TryNumberToSize(), JSRegExp::TypeTag(), Value::Uint32Value(), ToBooleanStub::Types::UpdateStatus(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::ValidateImpl(), Integer::Value(), Int32::Value(), and Uint32::Value().

Field Documentation


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