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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 __ pushq(Register::from_code(i)); | 792 __ pushq(Register::from_code(i)); |
793 register_save_area_size += kPointerSize; | 793 register_save_area_size += kPointerSize; |
794 } | 794 } |
795 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 795 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
796 } | 796 } |
797 } else if (descriptor->IsJSFunctionCall()) { | 797 } else if (descriptor->IsJSFunctionCall()) { |
798 CompilationInfo* info = this->info(); | 798 CompilationInfo* info = this->info(); |
799 __ Prologue(info->IsCodePreAgingActive()); | 799 __ Prologue(info->IsCodePreAgingActive()); |
800 frame()->SetRegisterSaveAreaSize( | 800 frame()->SetRegisterSaveAreaSize( |
801 StandardFrameConstants::kFixedFrameSizeFromFp); | 801 StandardFrameConstants::kFixedFrameSizeFromFp); |
802 | |
803 // Sloppy mode functions and builtins need to replace the receiver with the | |
804 // global proxy when called as functions (without an explicit receiver | |
805 // object). | |
806 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
807 if (info->strict_mode() == SLOPPY && !info->is_native()) { | |
808 Label ok; | |
809 StackArgumentsAccessor args(rbp, info->scope()->num_parameters()); | |
810 __ movp(rcx, args.GetReceiverOperand()); | |
811 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); | |
812 __ j(not_equal, &ok, Label::kNear); | |
813 __ movp(rcx, GlobalObjectOperand()); | |
814 __ movp(rcx, FieldOperand(rcx, GlobalObject::kGlobalProxyOffset)); | |
815 __ movp(args.GetReceiverOperand(), rcx); | |
816 __ bind(&ok); | |
817 } | |
818 | |
819 } else { | 802 } else { |
820 __ StubPrologue(); | 803 __ StubPrologue(); |
821 frame()->SetRegisterSaveAreaSize( | 804 frame()->SetRegisterSaveAreaSize( |
822 StandardFrameConstants::kFixedFrameSizeFromFp); | 805 StandardFrameConstants::kFixedFrameSizeFromFp); |
823 } | 806 } |
824 if (stack_slots > 0) { | 807 if (stack_slots > 0) { |
825 __ subq(rsp, Immediate(stack_slots * kPointerSize)); | 808 __ subq(rsp, Immediate(stack_slots * kPointerSize)); |
826 } | 809 } |
827 } | 810 } |
828 | 811 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 } | 1014 } |
1032 } | 1015 } |
1033 MarkLazyDeoptSite(); | 1016 MarkLazyDeoptSite(); |
1034 } | 1017 } |
1035 | 1018 |
1036 #undef __ | 1019 #undef __ |
1037 | 1020 |
1038 } // namespace internal | 1021 } // namespace internal |
1039 } // namespace compiler | 1022 } // namespace compiler |
1040 } // namespace v8 | 1023 } // namespace v8 |
OLD | NEW |