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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.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 #define kScratchReg r9 | 22 #define kScratchReg r9 |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
876 CompilationInfo* info = this->info(); | 877 CompilationInfo* info = this->info(); |
877 __ Prologue(info->IsCodePreAgingActive()); | 878 __ Prologue(info->IsCodePreAgingActive()); |
878 frame()->SetRegisterSaveAreaSize( | 879 frame()->SetRegisterSaveAreaSize( |
879 StandardFrameConstants::kFixedFrameSizeFromFp); | 880 StandardFrameConstants::kFixedFrameSizeFromFp); |
880 } else { | 881 } else { |
881 __ StubPrologue(); | 882 __ StubPrologue(); |
882 frame()->SetRegisterSaveAreaSize( | 883 frame()->SetRegisterSaveAreaSize( |
883 StandardFrameConstants::kFixedFrameSizeFromFp); | 884 StandardFrameConstants::kFixedFrameSizeFromFp); |
884 } | 885 } |
885 int stack_slots = frame()->GetSpillSlotCount(); | 886 int stack_slots = frame()->GetSpillSlotCount(); |
887 | |
888 if (info()->is_osr()) { | |
889 // TurboFan OSR-compiled functions cannot be entered directly. | |
890 // TODO(titzer): put an abort into the header of OSR functions on arm. | |
Benedikt Meurer
2014/12/18 11:21:22
MacroAssembler::Abort()
titzer
2015/01/09 14:17:47
Done.
| |
891 | |
892 // Unoptimized code jumps directly to this entrypoint while the unoptimized | |
893 // frame is still on the stack. Optimized code uses OSR values directly from | |
894 // the unoptimized frame. Thus, all that needs to be done is to allocate the | |
895 // remaining stack slots. | |
896 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | |
897 osr_pc_offset_ = __ pc_offset(); | |
898 size_t unoptimized_slots = OsrHelper(info()).UnoptimizedFrameSlots(); | |
899 DCHECK(stack_slots >= static_cast<int>(unoptimized_slots)); | |
900 stack_slots -= unoptimized_slots; | |
901 } | |
902 | |
886 if (stack_slots > 0) { | 903 if (stack_slots > 0) { |
887 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); | 904 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); |
888 } | 905 } |
889 } | 906 } |
890 | 907 |
891 | 908 |
892 void CodeGenerator::AssembleReturn() { | 909 void CodeGenerator::AssembleReturn() { |
893 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 910 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
894 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 911 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
895 if (frame()->GetRegisterSaveAreaSize() > 0) { | 912 if (frame()->GetRegisterSaveAreaSize() > 0) { |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1105 } | 1122 } |
1106 } | 1123 } |
1107 MarkLazyDeoptSite(); | 1124 MarkLazyDeoptSite(); |
1108 } | 1125 } |
1109 | 1126 |
1110 #undef __ | 1127 #undef __ |
1111 | 1128 |
1112 } // namespace compiler | 1129 } // namespace compiler |
1113 } // namespace internal | 1130 } // namespace internal |
1114 } // namespace v8 | 1131 } // namespace v8 |
OLD | NEW |