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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 | 997 |
998 // Do we have a valid feedback vector? | 998 // Do we have a valid feedback vector? |
999 __ movp(rbx, FieldOperand(closure, JSFunction::kLiteralsOffset)); | 999 __ movp(rbx, FieldOperand(closure, JSFunction::kLiteralsOffset)); |
1000 __ movp(rbx, FieldOperand(rbx, LiteralsArray::kFeedbackVectorOffset)); | 1000 __ movp(rbx, FieldOperand(rbx, LiteralsArray::kFeedbackVectorOffset)); |
1001 __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); | 1001 __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); |
1002 | 1002 |
1003 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1003 __ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1004 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 1004 __ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
1005 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset)); | 1005 __ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset)); |
1006 __ cmpl(index, Immediate(2)); | 1006 __ cmpl(index, Immediate(2)); |
1007 __ j(less, &gotta_call_runtime); | 1007 __ j(less, &try_shared); |
1008 | 1008 |
1009 // r14 : native context | 1009 // r14 : native context |
1010 // r9 : length / index | 1010 // r9 : length / index |
1011 // r8 : optimized code map | 1011 // r8 : optimized code map |
1012 // rdx : new target | 1012 // rdx : new target |
1013 // rdi : closure | 1013 // rdi : closure |
1014 Register native_context = r14; | 1014 Register native_context = r14; |
1015 __ movp(native_context, NativeContextOperand()); | 1015 __ movp(native_context, NativeContextOperand()); |
1016 | 1016 |
1017 __ bind(&loop_top); | 1017 __ bind(&loop_top); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15, | 1054 __ RecordWriteContextSlot(native_context, function_list_offset, closure, r15, |
1055 kDontSaveFPRegs); | 1055 kDontSaveFPRegs); |
1056 __ movp(closure, rbx); | 1056 __ movp(closure, rbx); |
1057 __ jmp(entry); | 1057 __ jmp(entry); |
1058 | 1058 |
1059 __ bind(&loop_bottom); | 1059 __ bind(&loop_bottom); |
1060 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); | 1060 __ subl(index, Immediate(SharedFunctionInfo::kEntryLength)); |
1061 __ cmpl(index, Immediate(1)); | 1061 __ cmpl(index, Immediate(1)); |
1062 __ j(greater, &loop_top); | 1062 __ j(greater, &loop_top); |
1063 | 1063 |
1064 // We found no code. | 1064 // We found no code. Try the SharedFunctionInfo. |
1065 __ jmp(&gotta_call_runtime); | |
1066 | |
1067 __ bind(&try_shared); | 1065 __ bind(&try_shared); |
1068 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1066 __ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1069 // Is the shared function marked for tier up? | 1067 // Is the shared function marked for tier up? |
1070 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), | 1068 __ testb(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset), |
1071 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); | 1069 Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte)); |
1072 __ j(not_zero, &gotta_call_runtime); | 1070 __ j(not_zero, &gotta_call_runtime); |
1073 | 1071 |
1074 // If SFI points to anything other than CompileLazy, install that. | 1072 // If SFI points to anything other than CompileLazy, install that. |
1075 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1073 __ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1076 __ Move(rbx, masm->CodeObject()); | 1074 __ Move(rbx, masm->CodeObject()); |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3040 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3038 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3041 Generate_OnStackReplacementHelper(masm, true); | 3039 Generate_OnStackReplacementHelper(masm, true); |
3042 } | 3040 } |
3043 | 3041 |
3044 #undef __ | 3042 #undef __ |
3045 | 3043 |
3046 } // namespace internal | 3044 } // namespace internal |
3047 } // namespace v8 | 3045 } // namespace v8 |
3048 | 3046 |
3049 #endif // V8_TARGET_ARCH_X64 | 3047 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |