diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-06-06 10:28:14 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-06-07 10:33:31 +0200 |
commit | 3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09 (patch) | |
tree | 9dee56e142638b34f1eccbd0ad88c3bce5377c29 /deps/v8/src/ic/x87/handler-compiler-x87.cc | |
parent | 91a1bbe3055a660194ca4d403795aa0c03e9d056 (diff) | |
download | node-new-3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09.tar.gz |
deps: update V8 to 5.9.211.32
PR-URL: https://github.com/nodejs/node/pull/13263
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/ic/x87/handler-compiler-x87.cc')
-rw-r--r-- | deps/v8/src/ic/x87/handler-compiler-x87.cc | 199 |
1 files changed, 8 insertions, 191 deletions
diff --git a/deps/v8/src/ic/x87/handler-compiler-x87.cc b/deps/v8/src/ic/x87/handler-compiler-x87.cc index 5a61eee163..dc572a19cc 100644 --- a/deps/v8/src/ic/x87/handler-compiler-x87.cc +++ b/deps/v8/src/ic/x87/handler-compiler-x87.cc @@ -17,38 +17,13 @@ namespace internal { #define __ ACCESS_MASM(masm) - -void NamedLoadHandlerCompiler::GenerateLoadViaGetter( - MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, - int accessor_index, int expected_arguments, Register scratch) { +void NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt( + MacroAssembler* masm) { { FrameScope scope(masm, StackFrame::INTERNAL); - - // Save context register - __ push(esi); - - if (accessor_index >= 0) { - DCHECK(!holder.is(scratch)); - DCHECK(!receiver.is(scratch)); - // Call the JavaScript getter with the receiver on the stack. - if (map->IsJSGlobalObjectMap()) { - // Swap in the global receiver. - __ mov(scratch, - FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); - receiver = scratch; - } - __ push(receiver); - __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER); - __ Set(eax, 0); - __ Call(masm->isolate()->builtins()->CallFunction( - ConvertReceiverMode::kNotNullOrUndefined), - RelocInfo::CODE_TARGET); - } else { - // If we generate a global code snippet for deoptimization only, remember - // the place to continue after deoptimization. - masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); - } - + // If we generate a global code snippet for deoptimization only, remember + // the place to continue after deoptimization. + masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); // Restore context register. __ pop(esi); } @@ -201,12 +176,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); } - if (api_call_info->fast_handler()->IsCode()) { - // Just tail call into the code. - __ Jump(handle(Code::cast(api_call_info->fast_handler())), - RelocInfo::CODE_TARGET); - return; - } // Put api_function_address in place. Address function_address = v8::ToCData<Address>(api_call_info->callback()); __ mov(api_function_address, Immediate(function_address)); @@ -293,23 +262,6 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( } } -static void CompileCallLoadPropertyWithInterceptor( - MacroAssembler* masm, Register receiver, Register holder, Register name, - Handle<JSObject> holder_obj, Runtime::FunctionId id) { - DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == - Runtime::FunctionForId(id)->nargs); - - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); - __ push(name); - __ push(receiver); - __ push(holder); - - __ CallRuntime(id); -} - #undef __ #define __ ACCESS_MASM(masm()) @@ -347,8 +299,7 @@ void PropertyHandlerCompiler::GenerateAccessCheck( Register PropertyHandlerCompiler::CheckPrototypes( Register object_reg, Register holder_reg, Register scratch1, - Register scratch2, Handle<Name> name, Label* miss, - ReturnHolder return_what) { + Register scratch2, Handle<Name> name, Label* miss) { Handle<Map> receiver_map = map(); // Make sure there's no overlap between holder and object registers. @@ -413,15 +364,14 @@ Register PropertyHandlerCompiler::CheckPrototypes( // Log the check depth. LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); - bool return_holder = return_what == RETURN_HOLDER; - if (return_holder && depth != 0) { + if (depth != 0) { Handle<WeakCell> weak_cell = Map::GetOrCreatePrototypeWeakCell(current, isolate()); __ LoadWeakValue(reg, weak_cell, miss); } // Return the register containing the holder. - return return_holder ? reg : no_reg; + return reg; } @@ -451,102 +401,6 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { } } -void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup( - LookupIterator* it, Register holder_reg) { - DCHECK(holder()->HasNamedInterceptor()); - DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); - - // Compile the interceptor call, followed by inline code to load the - // property from further up the prototype chain if the call fails. - // Check that the maps haven't changed. - DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1())); - - // Preserve the receiver register explicitly whenever it is different from the - // holder and it is needed should the interceptor return without any result. - // The ACCESSOR case needs the receiver to be passed into C++ code, the FIELD - // case might cause a miss during the prototype check. - bool must_perform_prototype_check = - !holder().is_identical_to(it->GetHolder<JSObject>()); - bool must_preserve_receiver_reg = - !receiver().is(holder_reg) && - (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); - - // Save necessary data before invoking an interceptor. - // Requires a frame to make GC aware of pushed pointers. - { - FrameScope frame_scope(masm(), StackFrame::INTERNAL); - - if (must_preserve_receiver_reg) { - __ push(receiver()); - } - __ push(holder_reg); - __ push(this->name()); - InterceptorVectorSlotPush(holder_reg); - // Invoke an interceptor. Note: map checks from receiver to - // interceptor's holder has been compiled before (see a caller - // of this method.) - CompileCallLoadPropertyWithInterceptor( - masm(), receiver(), holder_reg, this->name(), holder(), - Runtime::kLoadPropertyWithInterceptorOnly); - - // Check if interceptor provided a value for property. If it's - // the case, return immediately. - Label interceptor_failed; - __ cmp(eax, factory()->no_interceptor_result_sentinel()); - __ j(equal, &interceptor_failed); - frame_scope.GenerateLeaveFrame(); - __ ret(0); - - // Clobber registers when generating debug-code to provoke errors. - __ bind(&interceptor_failed); - if (FLAG_debug_code) { - __ mov(receiver(), Immediate(bit_cast<int32_t>(kZapValue))); - __ mov(holder_reg, Immediate(bit_cast<int32_t>(kZapValue))); - __ mov(this->name(), Immediate(bit_cast<int32_t>(kZapValue))); - } - - InterceptorVectorSlotPop(holder_reg); - __ pop(this->name()); - __ pop(holder_reg); - if (must_preserve_receiver_reg) { - __ pop(receiver()); - } - - // Leave the internal frame. - } - - GenerateLoadPostInterceptor(it, holder_reg); -} - - -void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { - DCHECK(holder()->HasNamedInterceptor()); - DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); - // Call the runtime system to load the interceptor. - - // Stack: - // return address - - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); - STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); - __ push(receiver()); - __ push(holder_reg); - // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. - if (holder_reg.is(receiver())) { - __ push(slot()); - __ push(vector()); - } else { - __ push(scratch3()); // slot - __ push(scratch2()); // vector - } - __ push(Operand(esp, 4 * kPointerSize)); // return address - __ mov(Operand(esp, 5 * kPointerSize), name()); - - __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); -} - void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { // Zap register aliases of the arguments passed on the stack to ensure they // are properly loaded by the handler (debug-only). @@ -595,43 +449,6 @@ Register NamedStoreHandlerCompiler::value() { } -Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( - Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { - Label miss; - if (IC::ShouldPushPopSlotAndVector(kind())) { - PushVectorAndSlot(); - } - FrontendHeader(receiver(), name, &miss, DONT_RETURN_ANYTHING); - // Get the value from the cell. - Register result = StoreDescriptor::ValueRegister(); - Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell); - __ LoadWeakValue(result, weak_cell, &miss); - __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); - - // Check for deleted property if property can actually be deleted. - if (is_configurable) { - __ cmp(result, factory()->the_hole_value()); - __ j(equal, &miss); - } else if (FLAG_debug_code) { - __ cmp(result, factory()->the_hole_value()); - __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); - } - - Counters* counters = isolate()->counters(); - __ IncrementCounter(counters->ic_named_load_global_stub(), 1); - // The code above already loads the result into the return register. - if (IC::ShouldPushPopSlotAndVector(kind())) { - DiscardVectorAndSlot(); - } - __ ret(0); - - FrontendFooter(name, &miss); - - // Return the generated code. - return GetCode(kind(), name); -} - - #undef __ } // namespace internal } // namespace v8 |