Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/builtins/x64/builtins-x64.cc

Issue 2165633003: Revert of [Interpreter] Collect type feedback for 'new' in the bytecode handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/code-factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 RelocInfo::CODE_TARGET); 833 RelocInfo::CODE_TARGET);
834 } else { 834 } else {
835 DCHECK_EQ(function_type, CallableType::kAny); 835 DCHECK_EQ(function_type, CallableType::kAny);
836 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, 836 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny,
837 tail_call_mode), 837 tail_call_mode),
838 RelocInfo::CODE_TARGET); 838 RelocInfo::CODE_TARGET);
839 } 839 }
840 } 840 }
841 841
842 // static 842 // static
843 void Builtins::Generate_InterpreterPushArgsAndConstructImpl( 843 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
844 MacroAssembler* masm, CallableType construct_type) {
845 // ----------- S t a t e ------------- 844 // ----------- S t a t e -------------
846 // -- rax : the number of arguments (not including the receiver) 845 // -- rax : the number of arguments (not including the receiver)
847 // -- rdx : the new target (either the same as the constructor or 846 // -- rdx : the new target (either the same as the constructor or
848 // the JSFunction on which new was invoked initially) 847 // the JSFunction on which new was invoked initially)
849 // -- rdi : the constructor to call (can be any Object) 848 // -- rdi : the constructor to call (can be any Object)
850 // -- rbx : the address of the first argument to be pushed. Subsequent 849 // -- rbx : the address of the first argument to be pushed. Subsequent
851 // arguments should be consecutive above this, in the same order as 850 // arguments should be consecutive above this, in the same order as
852 // they are to be pushed onto the stack. 851 // they are to be pushed onto the stack.
853 // ----------------------------------- 852 // -----------------------------------
854 853
855 // Pop return address to allow tail-call after pushing arguments. 854 // Pop return address to allow tail-call after pushing arguments.
856 __ PopReturnAddressTo(kScratchRegister); 855 __ PopReturnAddressTo(kScratchRegister);
857 856
858 // Push slot for the receiver to be constructed. 857 // Push slot for the receiver to be constructed.
859 __ Push(Immediate(0)); 858 __ Push(Immediate(0));
860 859
861 Generate_InterpreterPushArgs(masm, false); 860 Generate_InterpreterPushArgs(masm, false);
862 861
863 // Push return address in preparation for the tail-call. 862 // Push return address in preparation for the tail-call.
864 __ PushReturnAddressFrom(kScratchRegister); 863 __ PushReturnAddressFrom(kScratchRegister);
865 864
866 if (construct_type == CallableType::kJSFunction) { 865 // Call the constructor (rax, rdx, rdi passed on).
867 // TODO(mythria): Change this when allocation site feedback is available. 866 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
868 // ConstructFunction initializes allocation site to undefined.
869 __ Jump(masm->isolate()->builtins()->ConstructFunction(),
870 RelocInfo::CODE_TARGET);
871 } else {
872 DCHECK_EQ(construct_type, CallableType::kAny);
873 // Call the constructor (rax, rdx, rdi passed on).
874 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
875 }
876 } 867 }
877 868
878 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { 869 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
879 // Set the return address to the correct point in the interpreter entry 870 // Set the return address to the correct point in the interpreter entry
880 // trampoline. 871 // trampoline.
881 Smi* interpreter_entry_return_pc_offset( 872 Smi* interpreter_entry_return_pc_offset(
882 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); 873 masm->isolate()->heap()->interpreter_entry_return_pc_offset());
883 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); 874 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0));
884 __ Move(rbx, masm->isolate()->builtins()->InterpreterEntryTrampoline()); 875 __ Move(rbx, masm->isolate()->builtins()->InterpreterEntryTrampoline());
885 __ addp(rbx, Immediate(interpreter_entry_return_pc_offset->value() + 876 __ addp(rbx, Immediate(interpreter_entry_return_pc_offset->value() +
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 // And "return" to the OSR entry point of the function. 3047 // And "return" to the OSR entry point of the function.
3057 __ ret(0); 3048 __ ret(0);
3058 } 3049 }
3059 3050
3060 #undef __ 3051 #undef __
3061 3052
3062 } // namespace internal 3053 } // namespace internal
3063 } // namespace v8 3054 } // namespace v8
3064 3055
3065 #endif // V8_TARGET_ARCH_X64 3056 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698