OLD | NEW |
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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 | 1001 |
1002 // Do we have a valid feedback vector? | 1002 // Do we have a valid feedback vector? |
1003 __ movp(rbx, FieldOperand(closure, JSFunction::kLiteralsOffset)); | 1003 __ movp(rbx, FieldOperand(closure, JSFunction::kLiteralsOffset)); |
1004 __ movp(rbx, FieldOperand(rbx, LiteralsArray::kFeedbackVectorOffset)); | 1004 __ movp(rbx, FieldOperand(rbx, LiteralsArray::kFeedbackVectorOffset)); |
1005 __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); | 1005 __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); |
1006 | 1006 |
1007 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1007 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1008 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 1008 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
1009 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset)); | 1009 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset)); |
1010 __ cmpl(index, Immediate(2)); | 1010 __ cmpl(index, Immediate(2)); |
1011 __ j(less, &try_shared); | 1011 __ j(less, &gotta_call_runtime); |
1012 | 1012 |
1013 // r14 : native context | 1013 // r14 : native context |
1014 // r9 : length / index | 1014 // r9 : length / index |
1015 // r8 : optimized code map | 1015 // r8 : optimized code map |
1016 // rdx : new target | 1016 // rdx : new target |
1017 // rdi : closure | 1017 // rdi : closure |
1018 Register native_context = r14; | 1018 Register native_context = r14; |
1019 __ movp(native_context, NativeContextOperand()); | 1019 __ movp(native_context, NativeContextOperand()); |
1020 | 1020 |
1021 __ bind(&loop_top); | 1021 __ bind(&loop_top); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15, | 1058 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15, |
1059 kDontSaveFPRegs); | 1059 kDontSaveFPRegs); |
1060 __ movp(closure, rbx); | 1060 __ movp(closure, rbx); |
1061 __ jmp(entry); | 1061 __ jmp(entry); |
1062 | 1062 |
1063 __ bind(&loop_bottom); | 1063 __ bind(&loop_bottom); |
1064 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); | 1064 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); |
1065 __ cmpl(index, Immediate(1)); | 1065 __ cmpl(index, Immediate(1)); |
1066 __ j(greater, &loop_top); | 1066 __ j(greater, &loop_top); |
1067 | 1067 |
1068 // We found no code. Try the SharedFunctionInfo. | 1068 // We found no code. |
| 1069 __ jmp(&gotta_call_runtime); |
| 1070 |
1069 __ bind(&try_shared); | 1071 __ bind(&try_shared); |
1070 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1072 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1071 // Is the shared function marked for tier up? | 1073 // Is the shared function marked for tier up? |
1072 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), | 1074 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), |
1073 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); | 1075 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); |
1074 __ j(not_zero, &gotta_call_runtime); | 1076 __ j(not_zero, &gotta_call_runtime); |
1075 | 1077 |
1076 // If SFI points to anything other than CompileLazy, install that. | 1078 // If SFI points to anything other than CompileLazy, install that. |
1077 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1079 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1078 __ Move(rbx, masm->CodeObject()); | 1080 __ Move(rbx, masm->CodeObject()); |
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3174 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3176 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3175 Generate_OnStackReplacementHelper(masm, true); | 3177 Generate_OnStackReplacementHelper(masm, true); |
3176 } | 3178 } |
3177 | 3179 |
3178 #undef __ | 3180 #undef __ |
3179 | 3181 |
3180 } // namespace internal | 3182 } // namespace internal |
3181 } // namespace v8 | 3183 } // namespace v8 |
3182 | 3184 |
3183 #endif // V8_TARGET_ARCH_X64 | 3185 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |