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

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

Issue 2626863004: Revert of [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: Created 3 years, 11 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/compiler.cc » ('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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 // -- rdi : target function (preserved for callee) 987 // -- rdi : target function (preserved for callee)
988 // ----------------------------------- 988 // -----------------------------------
989 // First lookup code, maybe we don't need to compile! 989 // First lookup code, maybe we don't need to compile!
990 Label gotta_call_runtime; 990 Label gotta_call_runtime;
991 Label try_shared; 991 Label try_shared;
992 Label loop_top, loop_bottom; 992 Label loop_top, loop_bottom;
993 993
994 Register closure = rdi; 994 Register closure = rdi;
995 Register map = r8; 995 Register map = r8;
996 Register index = r9; 996 Register index = r9;
997
998 // Do we have a valid feedback vector?
999 __ movp(rbx, FieldOperand(closure, JSFunction::kLiteralsOffset));
1000 __ movp(rbx, FieldOperand(rbx, LiteralsArray::kFeedbackVectorOffset));
1001 __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime);
1002
1003 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 997 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1004 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 998 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
1005 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset)); 999 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset));
1006 __ cmpl(index, Immediate(2)); 1000 __ cmpl(index, Immediate(2));
1007 __ j(less, &gotta_call_runtime); 1001 __ j(less, &gotta_call_runtime);
1008 1002
1003 // Find literals.
1009 // r14 : native context 1004 // r14 : native context
1010 // r9 : length / index 1005 // r9 : length / index
1011 // r8 : optimized code map 1006 // r8 : optimized code map
1012 // rdx : new target 1007 // rdx : new target
1013 // rdi : closure 1008 // rdi : closure
1014 Register native_context = r14; 1009 Register native_context = r14;
1015 __ movp(native_context, NativeContextOperand()); 1010 __ movp(native_context, NativeContextOperand());
1016 1011
1017 __ bind(&loop_top); 1012 __ bind(&loop_top);
1018 // Native context match? 1013 // Native context match?
1019 Register temp = r11; 1014 Register temp = r11;
1020 __ movp(temp, FieldOperand(map, index, times_pointer_size, 1015 __ movp(temp, FieldOperand(map, index, times_pointer_size,
1021 SharedFunctionInfo::kOffsetToPreviousContext)); 1016 SharedFunctionInfo::kOffsetToPreviousContext));
1022 __ movp(temp, FieldOperand(temp, WeakCell::kValueOffset)); 1017 __ movp(temp, FieldOperand(temp, WeakCell::kValueOffset));
1023 __ cmpp(temp, native_context); 1018 __ cmpp(temp, native_context);
1024 __ j(not_equal, &loop_bottom); 1019 __ j(not_equal, &loop_bottom);
1020 // Literals available?
1021 __ movp(temp, FieldOperand(map, index, times_pointer_size,
1022 SharedFunctionInfo::kOffsetToPreviousLiterals));
1023 __ movp(temp, FieldOperand(temp, WeakCell::kValueOffset));
1024 __ JumpIfSmi(temp, &gotta_call_runtime);
1025
1026 // Save the literals in the closure.
1027 __ movp(FieldOperand(closure, JSFunction::kLiteralsOffset), temp);
1028 __ movp(r15, index);
1029 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r15,
1030 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
1025 1031
1026 // Code available? 1032 // Code available?
1027 Register entry = rcx; 1033 Register entry = rcx;
1028 __ movp(entry, FieldOperand(map, index, times_pointer_size, 1034 __ movp(entry, FieldOperand(map, index, times_pointer_size,
1029 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1035 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1030 __ movp(entry, FieldOperand(entry, WeakCell::kValueOffset)); 1036 __ movp(entry, FieldOperand(entry, WeakCell::kValueOffset));
1031 __ JumpIfSmi(entry, &try_shared); 1037 __ JumpIfSmi(entry, &try_shared);
1032 1038
1033 // Found code. Get it into the closure and return. 1039 // Found literals and code. Get them into the closure and return.
1034 __ leap(entry, FieldOperand(entry, Code::kHeaderSize)); 1040 __ leap(entry, FieldOperand(entry, Code::kHeaderSize));
1035 __ movp(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry); 1041 __ movp(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry);
1036 __ RecordWriteCodeEntryField(closure, entry, r15); 1042 __ RecordWriteCodeEntryField(closure, entry, r15);
1037 1043
1038 // Link the closure into the optimized function list. 1044 // Link the closure into the optimized function list.
1039 // rcx : code entry (entry) 1045 // rcx : code entry (entry)
1040 // r14 : native context 1046 // r14 : native context
1041 // rdx : new target 1047 // rdx : new target
1042 // rdi : closure 1048 // rdi : closure
1043 __ movp(rbx, 1049 __ movp(rbx,
(...skipping 10 matching lines...) Expand all
1054 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15, 1060 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15,
1055 kDontSaveFPRegs); 1061 kDontSaveFPRegs);
1056 __ movp(closure, rbx); 1062 __ movp(closure, rbx);
1057 __ jmp(entry); 1063 __ jmp(entry);
1058 1064
1059 __ bind(&loop_bottom); 1065 __ bind(&loop_bottom);
1060 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); 1066 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength));
1061 __ cmpl(index, Immediate(1)); 1067 __ cmpl(index, Immediate(1));
1062 __ j(greater, &loop_top); 1068 __ j(greater, &loop_top);
1063 1069
1064 // We found no code. 1070 // We found neither literals nor code.
1065 __ jmp(&gotta_call_runtime); 1071 __ jmp(&gotta_call_runtime);
1066 1072
1067 __ bind(&try_shared); 1073 __ bind(&try_shared);
1068 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1074 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1069 // Is the shared function marked for tier up? 1075 // Is the shared function marked for tier up?
1070 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), 1076 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset),
1071 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); 1077 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte));
1072 __ j(not_zero, &gotta_call_runtime); 1078 __ j(not_zero, &gotta_call_runtime);
1073 1079
1074 // If SFI points to anything other than CompileLazy, install that. 1080 // If SFI points to anything other than CompileLazy, install that.
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3040 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3046 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3041 Generate_OnStackReplacementHelper(masm, true); 3047 Generate_OnStackReplacementHelper(masm, true);
3042 } 3048 }
3043 3049
3044 #undef __ 3050 #undef __
3045 3051
3046 } // namespace internal 3052 } // namespace internal
3047 } // namespace v8 3053 } // namespace v8
3048 3054
3049 #endif // V8_TARGET_ARCH_X64 3055 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698