OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/ast/scopes.h" | 7 #include "src/ast/scopes.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" |
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 if (info()->is_osr()) { | 1864 if (info()->is_osr()) { |
1865 // TurboFan OSR-compiled functions cannot be entered directly. | 1865 // TurboFan OSR-compiled functions cannot be entered directly. |
1866 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1866 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1867 | 1867 |
1868 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1868 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
1869 // frame is still on the stack. Optimized code uses OSR values directly from | 1869 // frame is still on the stack. Optimized code uses OSR values directly from |
1870 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1870 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
1871 // remaining stack slots. | 1871 // remaining stack slots. |
1872 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1872 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
1873 osr_pc_offset_ = __ pc_offset(); | 1873 osr_pc_offset_ = __ pc_offset(); |
1874 // TODO(titzer): cannot address target function == local #-1 | |
1875 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | |
1876 stack_shrink_slots -= | 1874 stack_shrink_slots -= |
1877 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); | 1875 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); |
1878 } | 1876 } |
1879 | 1877 |
1880 const RegList saves_fp = descriptor->CalleeSavedFPRegisters(); | 1878 const RegList saves_fp = descriptor->CalleeSavedFPRegisters(); |
1881 if (saves_fp != 0) { | 1879 if (saves_fp != 0) { |
1882 stack_shrink_slots += frame()->AlignSavedCalleeRegisterSlots(); | 1880 stack_shrink_slots += frame()->AlignSavedCalleeRegisterSlots(); |
1883 } | 1881 } |
1884 if (stack_shrink_slots > 0) { | 1882 if (stack_shrink_slots > 0) { |
1885 __ subq(rsp, Immediate(stack_shrink_slots * kPointerSize)); | 1883 __ subq(rsp, Immediate(stack_shrink_slots * kPointerSize)); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2162 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2165 __ Nop(padding_size); | 2163 __ Nop(padding_size); |
2166 } | 2164 } |
2167 } | 2165 } |
2168 | 2166 |
2169 #undef __ | 2167 #undef __ |
2170 | 2168 |
2171 } // namespace compiler | 2169 } // namespace compiler |
2172 } // namespace internal | 2170 } // namespace internal |
2173 } // namespace v8 | 2171 } // namespace v8 |
OLD | NEW |