OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 register_save_area_size += kPointerSize; | 731 register_save_area_size += kPointerSize; |
732 } | 732 } |
733 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 733 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
734 __ stm(db_w, sp, saves); | 734 __ stm(db_w, sp, saves); |
735 } | 735 } |
736 } else if (descriptor->IsJSFunctionCall()) { | 736 } else if (descriptor->IsJSFunctionCall()) { |
737 CompilationInfo* info = this->info(); | 737 CompilationInfo* info = this->info(); |
738 __ Prologue(info->IsCodePreAgingActive()); | 738 __ Prologue(info->IsCodePreAgingActive()); |
739 frame()->SetRegisterSaveAreaSize( | 739 frame()->SetRegisterSaveAreaSize( |
740 StandardFrameConstants::kFixedFrameSizeFromFp); | 740 StandardFrameConstants::kFixedFrameSizeFromFp); |
741 | |
742 // Sloppy mode functions and builtins need to replace the receiver with the | |
743 // global proxy when called as functions (without an explicit receiver | |
744 // object). | |
745 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
746 if (info->strict_mode() == SLOPPY && !info->is_native()) { | |
747 Label ok; | |
748 // +2 for return address and saved frame pointer. | |
749 int receiver_slot = info->scope()->num_parameters() + 2; | |
750 __ ldr(r2, MemOperand(fp, receiver_slot * kPointerSize)); | |
751 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | |
752 __ b(ne, &ok); | |
753 __ ldr(r2, GlobalObjectOperand()); | |
754 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); | |
755 __ str(r2, MemOperand(fp, receiver_slot * kPointerSize)); | |
756 __ bind(&ok); | |
757 } | |
758 | |
759 } else { | 741 } else { |
760 __ StubPrologue(); | 742 __ StubPrologue(); |
761 frame()->SetRegisterSaveAreaSize( | 743 frame()->SetRegisterSaveAreaSize( |
762 StandardFrameConstants::kFixedFrameSizeFromFp); | 744 StandardFrameConstants::kFixedFrameSizeFromFp); |
763 } | 745 } |
764 int stack_slots = frame()->GetSpillSlotCount(); | 746 int stack_slots = frame()->GetSpillSlotCount(); |
765 if (stack_slots > 0) { | 747 if (stack_slots > 0) { |
766 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); | 748 __ sub(sp, sp, Operand(stack_slots * kPointerSize)); |
767 } | 749 } |
768 } | 750 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 } | 964 } |
983 } | 965 } |
984 MarkLazyDeoptSite(); | 966 MarkLazyDeoptSite(); |
985 } | 967 } |
986 | 968 |
987 #undef __ | 969 #undef __ |
988 | 970 |
989 } // namespace compiler | 971 } // namespace compiler |
990 } // namespace internal | 972 } // namespace internal |
991 } // namespace v8 | 973 } // namespace v8 |
OLD | NEW |