Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| 11 #include "src/compiler/node-properties-inl.h" | 11 #include "src/compiler/node-properties-inl.h" |
| 12 #include "src/compiler/osr.h" | |
| 12 #include "src/scopes.h" | 13 #include "src/scopes.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 namespace compiler { | 17 namespace compiler { |
| 17 | 18 |
| 18 #define __ masm()-> | 19 #define __ masm()-> |
| 19 | 20 |
| 20 | 21 |
| 21 // Adds Arm64-specific methods to convert InstructionOperands. | 22 // Adds Arm64-specific methods to convert InstructionOperands. |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 963 __ Prologue(info->IsCodePreAgingActive()); | 964 __ Prologue(info->IsCodePreAgingActive()); |
| 964 frame()->SetRegisterSaveAreaSize( | 965 frame()->SetRegisterSaveAreaSize( |
| 965 StandardFrameConstants::kFixedFrameSizeFromFp); | 966 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 966 } else { | 967 } else { |
| 967 __ SetStackPointer(jssp); | 968 __ SetStackPointer(jssp); |
| 968 __ StubPrologue(); | 969 __ StubPrologue(); |
| 969 frame()->SetRegisterSaveAreaSize( | 970 frame()->SetRegisterSaveAreaSize( |
| 970 StandardFrameConstants::kFixedFrameSizeFromFp); | 971 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 971 } | 972 } |
| 972 int stack_slots = frame()->GetSpillSlotCount(); | 973 int stack_slots = frame()->GetSpillSlotCount(); |
| 974 | |
| 975 if (info()->is_osr()) { | |
| 976 // TurboFan OSR-compiled functions cannot be entered directly. | |
| 977 // TODO(titzer): put an abort into the header of OSR functions on arm64. | |
|
Benedikt Meurer
2014/12/18 11:21:22
MacroAssembler::Abort()
| |
| 978 | |
| 979 // Unoptimized code jumps directly to this entrypoint while the unoptimized | |
| 980 // frame is still on the stack. Optimized code uses OSR values directly from | |
| 981 // the unoptimized frame. Thus, all that needs to be done is to allocate the | |
| 982 // remaining stack slots. | |
| 983 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | |
| 984 osr_pc_offset_ = __ pc_offset(); | |
| 985 size_t unoptimized_slots = OsrHelper(info()).UnoptimizedFrameSlots(); | |
| 986 DCHECK(stack_slots >= static_cast<int>(unoptimized_slots)); | |
| 987 stack_slots -= unoptimized_slots; | |
| 988 } | |
| 989 | |
| 973 if (stack_slots > 0) { | 990 if (stack_slots > 0) { |
| 974 Register sp = __ StackPointer(); | 991 Register sp = __ StackPointer(); |
| 975 if (!sp.Is(csp)) { | 992 if (!sp.Is(csp)) { |
| 976 __ Sub(sp, sp, stack_slots * kPointerSize); | 993 __ Sub(sp, sp, stack_slots * kPointerSize); |
| 977 } | 994 } |
| 978 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); | 995 __ Sub(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); |
| 979 } | 996 } |
| 980 } | 997 } |
| 981 | 998 |
| 982 | 999 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1174 } | 1191 } |
| 1175 } | 1192 } |
| 1176 MarkLazyDeoptSite(); | 1193 MarkLazyDeoptSite(); |
| 1177 } | 1194 } |
| 1178 | 1195 |
| 1179 #undef __ | 1196 #undef __ |
| 1180 | 1197 |
| 1181 } // namespace compiler | 1198 } // namespace compiler |
| 1182 } // namespace internal | 1199 } // namespace internal |
| 1183 } // namespace v8 | 1200 } // namespace v8 |
| OLD | NEW |