v8  3.14.5(node0.10.28)
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 ()
 
void SmiPrint (FILE *out)
 
void SmiPrint (StringStream *accumulator)
 
- Public Member Functions inherited from Object
bool IsObject ()
 
bool IsFixedArrayBase ()
 
bool IsInstanceOf (FunctionTemplateInfo *type)
 
bool IsStruct ()
 
 INLINE (bool IsSpecObject())
 
 INLINE (bool IsSpecFunction())
 
 INLINE (bool IsUndefined())
 
 INLINE (bool IsNull())
 
 INLINE (bool IsTheHole())
 
 INLINE (bool IsTrue())
 
 INLINE (bool IsFalse())
 
bool IsArgumentsMarker ()
 
bool NonFailureIsHeapObject ()
 
bool IsFiller ()
 
double Number ()
 
bool IsNaN ()
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
MUST_USE_RESULT MaybeObject * ToObject ()
 
ObjectToBoolean ()
 
MUST_USE_RESULT MaybeObject * ToObject (Context *native_context)
 
MUST_USE_RESULT MaybeObject * ToSmi ()
 
void Lookup (String *name, LookupResult *result)
 
MUST_USE_RESULT MaybeObject * GetProperty (String *key)
 
MUST_USE_RESULT MaybeObject * GetProperty (String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithReceiver (Object *receiver, String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetProperty (Object *receiver, LookupResult *result, String *key, PropertyAttributes *attributes)
 
MUST_USE_RESULT MaybeObject * GetPropertyWithDefinedGetter (Object *receiver, JSReceiver *getter)
 
MUST_USE_RESULT MaybeObject * GetElement (uint32_t index)
 
ObjectGetElementNoExceptionThrown (uint32_t index)
 
MUST_USE_RESULT MaybeObject * GetElementWithReceiver (Object *receiver, uint32_t index)
 
ObjectGetPrototype ()
 
MUST_USE_RESULT MaybeObject * GetHash (CreationFlag flag)
 
bool SameValue (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint ()
 
void ShortPrint (FILE *out)
 
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 Handle< ObjectGetProperty (Handle< Object > object, Handle< Object > receiver, LookupResult *result, Handle< String > key, PropertyAttributes *attributes)
 
static Handle< ObjectGetElement (Handle< Object > object, uint32_t index)
 
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
 

Detailed Description

Definition at line 1023 of file objects.h.

Member Function Documentation

static Smi* cast ( Object object)
inlinestatic

Referenced by ObjectHashSet::Add(), SharedFunctionInfo::AddToOptimizedCodeMap(), DeoptimizationOutputData::AstId(), TypeFeedbackCells::AstId(), v8::internal::BUILTIN(), SharedFunctionInfo::builtin_function_id(), HashTable< CompilationCacheShape, 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(), Factory::CreateApiFunction(), Runtime::CreateArrayLiteralBoilerplate(), FastElementsAccessor< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS >, kPointerSize >::DeleteCommon(), Dictionary< SeededNumberDictionaryShape, uint32_t >::DetailsAt(), JSFunctionResultCache::finger_index(), JSProxy::Fix(), JSGlobalPropertyCell::FromValueAddress(), ScopeInfo::FunctionContextSlotIndex(), Runtime::FunctionForSymbol(), Dictionary< Shape, Key >::GenerateNewEnumerationIndices(), JavaScriptFrame::GetArgumentsLength(), TypeFeedbackOracle::GetCallCheckType(), RegExpImpl::GetCapture(), StackFrame::GetColumn(), DescriptorArray::GetDetails(), JSRegExp::GetFlags(), StackTrace::GetFrameCount(), JSObject::GetIdentityHash(), NonStrictArgumentsElementsAccessor::GetImpl(), DictionaryElementsAccessor::GetKeyForIndexImpl(), RegExpImpl::GetLastCaptureCount(), StackFrame::GetLineNumber(), JSObject::GetLocalElementKeys(), ArgumentsAdaptorFrame::GetNumberOfIncomingArguments(), Heap::GetNumberStringCache(), v8::internal::GetScriptColumnNumber(), v8::internal::GetScriptLineNumber(), SharedFunctionInfo::GetThisPropertyAssignmentArgument(), CompileTimeValue::GetType(), ObjectHashTableShape< entrysize >::Hash(), ObjectHashTableShape< entrysize >::HashForObject(), StringSharedKey::HashForObject(), RegExpKey::HashForObject(), JSObject::HasLocalElement(), JSObject::HasRealElementProperty(), TypeFeedbackInfo::ic_total_count(), TypeFeedbackInfo::ic_with_type_info_count(), BASE_EMBEDDED< Visitor >::IndexFromValue(), Execution::InstantiateFunction(), Value::Int32Value(), Value::IntegerValue(), ObjectTemplate::InternalFieldCount(), RegExpImpl::IrregexpMaxRegisterCount(), RegExpImpl::IrregexpNumberOfCaptures(), RegExpImpl::IrregexpNumberOfRegisters(), TypeFeedbackOracle::IsForInFastCase(), StringSharedKey::IsMatch(), SharedFunctionInfo::IsThisPropertyAssignmentArgument(), Value::IsUint32(), Oddball::kind(), NeanderArray::length(), Array::Length(), Logger::LogRuntime(), TypeFeedbackInfo::matches_inlined_type_change_checksum(), SeededNumberDictionary::max_number_key(), Factory::NewScript(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Dictionary< SeededNumberDictionaryShape, uint32_t >::NextEnumerationIndex(), JSObject::NormalizeElements(), DescriptorArray::number_of_descriptors(), HashTable< CompilationCacheShape, HashTableKey * >::NumberOfDeletedElements(), HashTable< CompilationCacheShape, HashTableKey * >::NumberOfElements(), JSObject::NumberOfEnumElements(), Map::NumberOfProtoTransitions(), v8::internal::NumberToInt32(), Heap::NumberToString(), v8::internal::NumberToUint32(), TypeFeedbackInfo::own_type_change_checksum(), DeoptimizationOutputData::PcAndState(), JSObject::PrepareSlowElementsForSort(), ObjectHashTable::Put(), ToBooleanStub::Types::Record(), SeededNumberDictionary::requires_slow_elements(), v8::internal::RUNTIME_FUNCTION(), TypeFeedbackInfo::set_ic_total_count(), TypeFeedbackInfo::set_inlined_type_change_checksum(), JSRegExp::SetDataAtUnchecked(), JSObject::SetFastDoubleElement(), ElementsAccessorBase< ElementsAccessorSubclass, ElementsTraitsParam >::SetLengthImpl(), FastElementsAccessor< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS >, kPointerSize >::SetLengthWithoutNormalize(), Heap::SetNumberStringCache(), ExternalPixelArray::SetValue(), ExternalUnsignedIntArray::SetValue(), ExternalFloatArray::SetValue(), ExternalDoubleArray::SetValue(), Object::ShortPrint(), JSFunctionResultCache::size(), BASE_EMBEDDED< Visitor >::smi_at(), FixedArray::SwapPairs(), TEST(), THREADED_TEST(), Value::ToArrayIndex(), Object::ToArrayIndex(), Object::ToBoolean(), JSRegExp::TypeTag(), JSRegExp::TypeTagUnchecked(), Value::Uint32Value(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::ValidateImpl(), Integer::Value(), Int32::Value(), and Uint32::Value().

Smi * FromInt ( int  value)
inlinestatic

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

References ASSERT, Smi::IsValid(), v8::internal::kSmiShiftSize, v8::internal::kSmiTag, v8::internal::kSmiTagSize, and Smi::value().

Referenced by BASE_EMBEDDED< Visitor >::Add(), NeanderArray::add(), ReplacementStringBuilder::AddSubjectSlice(), TransitionArray::Allocate(), DescriptorArray::Allocate(), Heap::AllocateArgumentsObject(), Heap::AllocateFunctionContext(), Heap::AllocateJSArrayAndStorage(), Heap::AllocateJSArrayWithElements(), Heap::AllocateJSFunctionProxy(), Heap::AllocateJSProxy(), Heap::AllocateModuleContext(), LargeObjectSpace::AllocateRaw(), PolymorphicCodeCacheHashTableKey::AsObject(), StringSharedKey::AsObject(), v8::internal::BOOL_ACCESSORS(), v8::internal::BUILTIN(), v8::internal::CalculateLineEnds(), Isolate::CaptureCurrentStackTrace(), TypeFeedbackInfo::change_ic_with_type_info_count(), TypeFeedbackInfo::change_own_type_change_checksum(), RegExpResultsCache::Clear(), TransitionArray::ClearElementsTransition(), DescriptorArray::ClearEnumCache(), SharedFunctionInfo::ClearOptimizedCodeMap(), MarkCompactCollector::CollectGarbage(), Compiler::Compile(), ScopeInfo::Create(), Heap::CreateApiObjects(), Runtime::CreateArrayLiteralBoilerplate(), Heap::CreateCode(), RegExpResultsCache::Enter(), Value::Equals(), JSReceiver::GenerateIdentityHash(), Dictionary< Shape, Key >::GenerateNewEnumerationIndices(), ExternalPixelArray::get(), ExternalByteArray::get(), ExternalUnsignedByteArray::get(), ExternalShortArray::get(), ExternalUnsignedShortArray::get(), v8::internal::GetEnumPropertyKeys(), Object::GetHash(), JSObject::GetIdentityHash(), BASE_EMBEDDED< Visitor >::GetLazyValue(), JSObject::GetLocalElementKeys(), ThisNamedPropertyAssignmentFinder::GetThisPropertyAssignments(), BASE_EMBEDDED< Visitor >::GetValue(), CompileTimeValue::GetValue(), TransitionArray::HasElementsTransition(), TransitionArray::HasPrototypeTransitions(), JSArray::Initialize(), TypeFeedbackInfo::initialize_storage(), Runtime::InitializeIntrinsicFunctionNames(), MacroAssembler::InitializeSmiConstantRegister(), StandardFrame::IsArgumentsAdaptorFrame(), StandardFrame::IsConstructFrame(), SerializerDeserializer::Iterate(), LoadIC::Load(), KeyedLoadIC::Load(), RegExpResultsCache::Lookup(), Accessors::MakeModuleExport(), TryCatch::Message(), NeanderArray::NeanderArray(), Integer::New(), FunctionTemplate::New(), Factory::NewScript(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Heap::NumberFromDouble(), Heap::NumberFromInt32(), Heap::NumberFromUint32(), JSObject::PrepareElementsForSort(), JSObject::PrepareSlowElementsForSort(), Isolate::PrintCurrentStackTrace(), TryCatch::Reset(), DateCache::ResetDateCache(), v8::internal::RUNTIME_FUNCTION(), BooleanBit::set(), JSFunctionResultCache::set_finger_index(), TypeFeedbackInfo::set_ic_total_count(), TypeFeedbackInfo::set_inlined_type_change_checksum(), Oddball::set_kind(), AccessorInfo::set_property_attributes(), SeededNumberDictionary::set_requires_slow_elements(), JSFunctionResultCache::set_size(), Heap::SetArgumentsAdaptorDeoptPCOffset(), DeoptimizationInputData::SetAstId(), DeoptimizationOutputData::SetAstId(), TypeFeedbackCells::SetAstId(), HashTable< CompilationCacheShape, HashTableKey * >::SetCapacity(), RegExpImpl::SetCapture(), Heap::SetConstructStubDeoptPCOffset(), JSArray::SetContent(), Dictionary< Shape, Key >::SetEntry(), JSObject::SetFastDoubleElement(), JSObject::SetFastDoubleElementsCapacityAndLength(), JSObject::SetFastElement(), JSObject::SetFastElementsCapacityAndLength(), Heap::SetGetterStubDeoptPCOffset(), ObjectTemplate::SetInternalFieldCount(), RegExpImpl::SetIrregexpMaxRegisterCount(), RegExpImpl::SetLastCaptureCount(), ElementsAccessorBase< ElementsAccessorSubclass, ElementsTraitsParam >::SetLengthImpl(), Dictionary< SeededNumberDictionaryShape, uint32_t >::SetNextEnumerationIndex(), HashTable< CompilationCacheShape, HashTableKey * >::SetNumberOfDeletedElements(), DescriptorArray::SetNumberOfDescriptors(), HashTable< CompilationCacheShape, HashTableKey * >::SetNumberOfElements(), Map::SetNumberOfProtoTransitions(), Factory::SetRegExpAtomData(), Factory::SetRegExpIrregexpData(), Heap::SetSetterStubDeoptPCOffset(), Heap::SetUp(), ExternalPixelArray::SetValue(), JSDate::SetValue(), IntrusiveMapTransitionIterator::Start(), IntrusivePrototypeTransitionIterator::Start(), TEST(), THREADED_TEST(), Value::ToArrayIndex(), FixedArrayBuilder::ToJSArray(), Object::ToSmi(), SeededNumberDictionary::UpdateMaxNumberKey(), and MarkCompactMarkingVisitor::VisitJSWeakMap().

Smi * FromIntptr ( intptr_t  value)
inlinestatic
void SmiPrint ( )
inline

Definition at line 1040 of file objects.h.

Referenced by Object::ShortPrint().

void SmiPrint ( FILE *  out)

Definition at line 817 of file objects.cc.

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

void SmiPrint ( StringStream accumulator)

Definition at line 822 of file objects.cc.

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

int value ( )
inline

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

References Internals::SmiValue().

Referenced by DeoptimizationInputData::AstId(), DeoptimizationOutputData::AstId(), v8::internal::BUILTIN(), SharedFunctionInfo::builtin_function_id(), HashTable< CompilationCacheShape, 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(), Smi::FromInt(), ScopeInfo::FunctionContextSlotIndex(), Runtime::FunctionForSymbol(), JavaScriptFrame::GetArgumentsLength(), TypeFeedbackOracle::GetCallCheckType(), StackFrame::GetColumn(), JSDate::GetField(), JSRegExp::GetFlags(), StackTrace::GetFrameCount(), JSObject::GetIdentityHash(), NonStrictArgumentsElementsAccessor::GetImpl(), DictionaryElementsAccessor::GetKeyForIndexImpl(), StackFrame::GetLineNumber(), JSObject::GetLocalElementKeys(), ArgumentsAdaptorFrame::GetNumberOfIncomingArguments(), Deoptimizer::GetOutputInfo(), SharedFunctionInfo::GetThisPropertyAssignmentArgument(), CompileTimeValue::GetType(), JSObject::HasLocalElement(), JSObject::HasRealElementProperty(), TypeFeedbackInfo::ic_total_count(), TypeFeedbackInfo::ic_with_type_info_count(), BASE_EMBEDDED< Visitor >::IndexFromValue(), Value::Int32Value(), Value::IntegerValue(), ObjectTemplate::InternalFieldCount(), TypeFeedbackOracle::IsForInFastCase(), SharedFunctionInfo::IsThisPropertyAssignmentArgument(), Value::IsUint32(), Smi::IsValid(), Oddball::kind(), Array::Length(), TypeFeedbackInfo::matches_inlined_type_change_checksum(), SeededNumberDictionary::max_number_key(), IntrusiveMapTransitionIterator::Next(), IntrusivePrototypeTransitionIterator::Next(), Dictionary< SeededNumberDictionaryShape, uint32_t >::NextEnumerationIndex(), JSObject::NormalizeElements(), DescriptorArray::number_of_descriptors(), HashTable< CompilationCacheShape, HashTableKey * >::NumberOfDeletedElements(), HashTable< CompilationCacheShape, HashTableKey * >::NumberOfElements(), JSObject::NumberOfEnumElements(), Map::NumberOfProtoTransitions(), v8::internal::NumberToInt32(), Heap::NumberToString(), v8::internal::NumberToUint32(), TypeFeedbackInfo::own_type_change_checksum(), JSObject::PrepareSlowElementsForSort(), ToBooleanStub::Types::Record(), 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(), JSObject::SetFastDoubleElement(), ElementsAccessorBase< ElementsAccessorSubclass, ElementsTraitsParam >::SetLengthImpl(), FastElementsAccessor< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS >, kPointerSize >::SetLengthWithoutNormalize(), ExternalPixelArray::SetValue(), ExternalUnsignedIntArray::SetValue(), ExternalFloatArray::SetValue(), ExternalDoubleArray::SetValue(), JSFunctionResultCache::size(), BASE_EMBEDDED< Visitor >::smi_at(), Smi::SmiPrint(), TEST(), Value::ToArrayIndex(), Object::ToArrayIndex(), JSRegExp::TypeTag(), JSRegExp::TypeTagUnchecked(), Value::Uint32Value(), ElementsAccessorBase< FastPackedSmiElementsAccessor, ElementsKindTraits< FAST_SMI_ELEMENTS > >::ValidateImpl(), Integer::Value(), Int32::Value(), and Uint32::Value().

Field Documentation

const int kMinValue
static
Initial value:
=
(static_cast<unsigned int>(-1)) << (kSmiValueSize - 1)

Definition at line 1048 of file objects.h.

Referenced by TypeFeedbackInfo::change_own_type_change_checksum(), Range::IsInSmiRange(), Smi::IsValid(), TypeFeedbackInfo::set_inlined_type_change_checksum(), and TEST().


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