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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 if (saves != 0) { // Save callee-saved registers. | 786 if (saves != 0) { // Save callee-saved registers. |
787 int register_save_area_size = 0; | 787 int register_save_area_size = 0; |
788 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { | 788 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
789 if (!((1 << i) & saves)) continue; | 789 if (!((1 << i) & saves)) continue; |
790 __ push(Register::from_code(i)); | 790 __ push(Register::from_code(i)); |
791 register_save_area_size += kPointerSize; | 791 register_save_area_size += kPointerSize; |
792 } | 792 } |
793 frame->SetRegisterSaveAreaSize(register_save_area_size); | 793 frame->SetRegisterSaveAreaSize(register_save_area_size); |
794 } | 794 } |
795 } else if (descriptor->IsJSFunctionCall()) { | 795 } else if (descriptor->IsJSFunctionCall()) { |
796 CompilationInfo* info = linkage()->info(); | 796 CompilationInfo* info = this->info(); |
797 __ Prologue(info->IsCodePreAgingActive()); | 797 __ Prologue(info->IsCodePreAgingActive()); |
798 frame->SetRegisterSaveAreaSize( | 798 frame->SetRegisterSaveAreaSize( |
799 StandardFrameConstants::kFixedFrameSizeFromFp); | 799 StandardFrameConstants::kFixedFrameSizeFromFp); |
800 | 800 |
801 // Sloppy mode functions and builtins need to replace the receiver with the | 801 // Sloppy mode functions and builtins need to replace the receiver with the |
802 // global proxy when called as functions (without an explicit receiver | 802 // global proxy when called as functions (without an explicit receiver |
803 // object). | 803 // object). |
804 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | 804 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? |
805 if (info->strict_mode() == SLOPPY && !info->is_native()) { | 805 if (info->strict_mode() == SLOPPY && !info->is_native()) { |
806 Label ok; | 806 Label ok; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 UNREACHABLE(); | 1016 UNREACHABLE(); |
1017 } | 1017 } |
1018 } | 1018 } |
1019 | 1019 |
1020 | 1020 |
1021 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 1021 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
1022 | 1022 |
1023 | 1023 |
1024 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1024 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
1025 int space_needed = Deoptimizer::patch_size(); | 1025 int space_needed = Deoptimizer::patch_size(); |
1026 if (!linkage()->info()->IsStub()) { | 1026 if (!info()->IsStub()) { |
1027 // Ensure that we have enough space after the previous lazy-bailout | 1027 // Ensure that we have enough space after the previous lazy-bailout |
1028 // instruction for patching the code here. | 1028 // instruction for patching the code here. |
1029 int current_pc = masm()->pc_offset(); | 1029 int current_pc = masm()->pc_offset(); |
1030 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1030 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1031 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1031 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1032 __ Nop(padding_size); | 1032 __ Nop(padding_size); |
1033 } | 1033 } |
1034 } | 1034 } |
1035 MarkLazyDeoptSite(); | 1035 MarkLazyDeoptSite(); |
1036 } | 1036 } |
1037 | 1037 |
1038 #undef __ | 1038 #undef __ |
1039 | 1039 |
1040 } // namespace compiler | 1040 } // namespace compiler |
1041 } // namespace internal | 1041 } // namespace internal |
1042 } // namespace v8 | 1042 } // namespace v8 |
OLD | NEW |