diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-29 22:35:21 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-29 22:35:21 +0200 |
commit | 2f75785c015fecc33565fe5ee3a483b0d4e5cc6d (patch) | |
tree | ad66b4eaba8cedfeb7cfb40b0871307ae08d25e8 /deps/v8/src/code-stubs.cc | |
parent | 5ddf7f4200894a7304d7c07bbbd8773fac3509d1 (diff) | |
download | android-node-v8-2f75785c015fecc33565fe5ee3a483b0d4e5cc6d.tar.gz android-node-v8-2f75785c015fecc33565fe5ee3a483b0d4e5cc6d.tar.bz2 android-node-v8-2f75785c015fecc33565fe5ee3a483b0d4e5cc6d.zip |
deps: upgrade v8 to 3.18.4
Diffstat (limited to 'deps/v8/src/code-stubs.cc')
-rw-r--r-- | deps/v8/src/code-stubs.cc | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/deps/v8/src/code-stubs.cc b/deps/v8/src/code-stubs.cc index 497dde54e7..df9855d09c 100644 --- a/deps/v8/src/code-stubs.cc +++ b/deps/v8/src/code-stubs.cc @@ -37,6 +37,17 @@ namespace v8 { namespace internal { + +CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() + : register_param_count_(-1), + stack_parameter_count_(NULL), + hint_stack_parameter_count_(-1), + function_mode_(NOT_JS_FUNCTION_STUB_MODE), + register_params_(NULL), + deoptimization_handler_(NULL), + miss_handler_(IC_Utility(IC::kUnreachable), Isolate::Current()) { } + + bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) { UnseededNumberDictionary* stubs = isolate->heap()->code_stubs(); int index = stubs->FindEntry(GetKey()); @@ -397,6 +408,42 @@ void ICCompareStub::Generate(MacroAssembler* masm) { } +CompareNilICStub::Types CompareNilICStub::GetPatchedICFlags( + Code::ExtraICState extra_ic_state, + Handle<Object> object, + bool* already_monomorphic) { + Types types = TypesField::decode(extra_ic_state); + NilValue nil = NilValueField::decode(extra_ic_state); + EqualityKind kind = EqualityKindField::decode(extra_ic_state); + ASSERT(types != CompareNilICStub::kFullCompare); + *already_monomorphic = + (types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0; + if (kind == kStrictEquality) { + if (nil == kNullValue) { + return CompareNilICStub::kCompareAgainstNull; + } else { + return CompareNilICStub::kCompareAgainstUndefined; + } + } else { + if (object->IsNull()) { + types = static_cast<CompareNilICStub::Types>( + types | CompareNilICStub::kCompareAgainstNull); + } else if (object->IsUndefined()) { + types = static_cast<CompareNilICStub::Types>( + types | CompareNilICStub::kCompareAgainstUndefined); + } else if (object->IsUndetectableObject() || !object->IsHeapObject()) { + types = CompareNilICStub::kFullCompare; + } else if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { + types = CompareNilICStub::kFullCompare; + } else { + types = static_cast<CompareNilICStub::Types>( + types | CompareNilICStub::kCompareAgainstMonomorphicMap); + } + } + return types; +} + + void InstanceofStub::PrintName(StringStream* stream) { const char* args = ""; if (HasArgsInRegisters()) { @@ -557,7 +604,7 @@ bool ToBooleanStub::Types::Record(Handle<Object> object) { ASSERT(!object->IsUndetectableObject()); Add(HEAP_NUMBER); double value = HeapNumber::cast(*object)->value(); - return value != 0 && !isnan(value); + return value != 0 && !std::isnan(value); } else { // We should never see an internal object at runtime here! UNREACHABLE(); @@ -647,4 +694,45 @@ bool ProfileEntryHookStub::SetFunctionEntryHook(FunctionEntryHook entry_hook) { } +static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { + int major_key = stub->MajorKey(); + CodeStubInterfaceDescriptor* descriptor = + isolate->code_stub_interface_descriptor(major_key); + if (!descriptor->initialized()) { + stub->InitializeInterfaceDescriptor(isolate, descriptor); + } +} + + +void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) { + ArrayNoArgumentConstructorStub stub1(GetInitialFastElementsKind()); + InstallDescriptor(isolate, &stub1); + ArraySingleArgumentConstructorStub stub2(GetInitialFastElementsKind()); + InstallDescriptor(isolate, &stub2); + ArrayNArgumentsConstructorStub stub3(GetInitialFastElementsKind()); + InstallDescriptor(isolate, &stub3); +} + + +ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) + : argument_count_(ANY) { + ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); +} + + +ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, + int argument_count) { + if (argument_count == 0) { + argument_count_ = NONE; + } else if (argument_count == 1) { + argument_count_ = ONE; + } else if (argument_count >= 2) { + argument_count_ = MORE_THAN_ONE; + } else { + UNREACHABLE(); + } + ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); +} + + } } // namespace v8::internal |