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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 __ push(Register::from_code(i)); | 811 __ push(Register::from_code(i)); |
812 register_save_area_size += kPointerSize; | 812 register_save_area_size += kPointerSize; |
813 } | 813 } |
814 frame->SetRegisterSaveAreaSize(register_save_area_size); | 814 frame->SetRegisterSaveAreaSize(register_save_area_size); |
815 } | 815 } |
816 } else if (descriptor->IsJSFunctionCall()) { | 816 } else if (descriptor->IsJSFunctionCall()) { |
817 CompilationInfo* info = this->info(); | 817 CompilationInfo* info = this->info(); |
818 __ Prologue(info->IsCodePreAgingActive()); | 818 __ Prologue(info->IsCodePreAgingActive()); |
819 frame->SetRegisterSaveAreaSize( | 819 frame->SetRegisterSaveAreaSize( |
820 StandardFrameConstants::kFixedFrameSizeFromFp); | 820 StandardFrameConstants::kFixedFrameSizeFromFp); |
821 | |
822 // Sloppy mode functions and builtins need to replace the receiver with the | |
823 // global proxy when called as functions (without an explicit receiver | |
824 // object). | |
825 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
826 if (info->strict_mode() == SLOPPY && !info->is_native()) { | |
827 Label ok; | |
828 // +2 for return address and saved frame pointer. | |
829 int receiver_slot = info->scope()->num_parameters() + 2; | |
830 __ mov(ecx, Operand(ebp, receiver_slot * kPointerSize)); | |
831 __ cmp(ecx, isolate()->factory()->undefined_value()); | |
832 __ j(not_equal, &ok, Label::kNear); | |
833 __ mov(ecx, GlobalObjectOperand()); | |
834 __ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalProxyOffset)); | |
835 __ mov(Operand(ebp, receiver_slot * kPointerSize), ecx); | |
836 __ bind(&ok); | |
837 } | |
838 | |
839 } else { | 821 } else { |
840 __ StubPrologue(); | 822 __ StubPrologue(); |
841 frame->SetRegisterSaveAreaSize( | 823 frame->SetRegisterSaveAreaSize( |
842 StandardFrameConstants::kFixedFrameSizeFromFp); | 824 StandardFrameConstants::kFixedFrameSizeFromFp); |
843 } | 825 } |
844 if (stack_slots > 0) { | 826 if (stack_slots > 0) { |
845 __ sub(esp, Immediate(stack_slots * kPointerSize)); | 827 __ sub(esp, Immediate(stack_slots * kPointerSize)); |
846 } | 828 } |
847 } | 829 } |
848 | 830 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 } | 1036 } |
1055 } | 1037 } |
1056 MarkLazyDeoptSite(); | 1038 MarkLazyDeoptSite(); |
1057 } | 1039 } |
1058 | 1040 |
1059 #undef __ | 1041 #undef __ |
1060 | 1042 |
1061 } // namespace compiler | 1043 } // namespace compiler |
1062 } // namespace internal | 1044 } // namespace internal |
1063 } // namespace v8 | 1045 } // namespace v8 |
OLD | NEW |