| 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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 | 1842 |
| 1843 | 1843 |
| 1844 namespace { | 1844 namespace { |
| 1845 | 1845 |
| 1846 static const int kQuadWordSize = 16; | 1846 static const int kQuadWordSize = 16; |
| 1847 | 1847 |
| 1848 } // namespace | 1848 } // namespace |
| 1849 | 1849 |
| 1850 | 1850 |
| 1851 void CodeGenerator::AssemblePrologue() { | 1851 void CodeGenerator::AssemblePrologue() { |
| 1852 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1852 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1853 if (descriptor->IsCFunctionCall()) { | 1853 if (descriptor->IsCFunctionCall()) { |
| 1854 __ pushq(rbp); | 1854 __ pushq(rbp); |
| 1855 __ movq(rbp, rsp); | 1855 __ movq(rbp, rsp); |
| 1856 } else if (descriptor->IsJSFunctionCall()) { | 1856 } else if (descriptor->IsJSFunctionCall()) { |
| 1857 __ Prologue(this->info()->GeneratePreagedPrologue()); | 1857 __ Prologue(this->info()->GeneratePreagedPrologue()); |
| 1858 } else if (frame()->needs_frame()) { | 1858 } else if (frame()->needs_frame()) { |
| 1859 __ StubPrologue(); | 1859 __ StubPrologue(); |
| 1860 } else { | 1860 } else { |
| 1861 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); | 1861 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); |
| 1862 } | 1862 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { | 1907 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
| 1908 if (!((1 << i) & saves)) continue; | 1908 if (!((1 << i) & saves)) continue; |
| 1909 __ pushq(Register::from_code(i)); | 1909 __ pushq(Register::from_code(i)); |
| 1910 frame()->AllocateSavedCalleeRegisterSlots(1); | 1910 frame()->AllocateSavedCalleeRegisterSlots(1); |
| 1911 } | 1911 } |
| 1912 } | 1912 } |
| 1913 } | 1913 } |
| 1914 | 1914 |
| 1915 | 1915 |
| 1916 void CodeGenerator::AssembleReturn() { | 1916 void CodeGenerator::AssembleReturn() { |
| 1917 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1917 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1918 | 1918 |
| 1919 // Restore registers. | 1919 // Restore registers. |
| 1920 const RegList saves = descriptor->CalleeSavedRegisters(); | 1920 const RegList saves = descriptor->CalleeSavedRegisters(); |
| 1921 if (saves != 0) { | 1921 if (saves != 0) { |
| 1922 for (int i = 0; i < Register::kNumRegisters; i++) { | 1922 for (int i = 0; i < Register::kNumRegisters; i++) { |
| 1923 if (!((1 << i) & saves)) continue; | 1923 if (!((1 << i) & saves)) continue; |
| 1924 __ popq(Register::from_code(i)); | 1924 __ popq(Register::from_code(i)); |
| 1925 } | 1925 } |
| 1926 } | 1926 } |
| 1927 const RegList saves_fp = descriptor->CalleeSavedFPRegisters(); | 1927 const RegList saves_fp = descriptor->CalleeSavedFPRegisters(); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2164 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2164 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2165 __ Nop(padding_size); | 2165 __ Nop(padding_size); |
| 2166 } | 2166 } |
| 2167 } | 2167 } |
| 2168 | 2168 |
| 2169 #undef __ | 2169 #undef __ |
| 2170 | 2170 |
| 2171 } // namespace compiler | 2171 } // namespace compiler |
| 2172 } // namespace internal | 2172 } // namespace internal |
| 2173 } // namespace v8 | 2173 } // namespace v8 |
| OLD | NEW |