| 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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/mips/macro-assembler-mips.h" | 10 #include "src/mips/macro-assembler-mips.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 register_save_area_size += kPointerSize; | 708 register_save_area_size += kPointerSize; |
| 709 } | 709 } |
| 710 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 710 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
| 711 __ MultiPush(saves); | 711 __ MultiPush(saves); |
| 712 } | 712 } |
| 713 } else if (descriptor->IsJSFunctionCall()) { | 713 } else if (descriptor->IsJSFunctionCall()) { |
| 714 CompilationInfo* info = this->info(); | 714 CompilationInfo* info = this->info(); |
| 715 __ Prologue(info->IsCodePreAgingActive()); | 715 __ Prologue(info->IsCodePreAgingActive()); |
| 716 frame()->SetRegisterSaveAreaSize( | 716 frame()->SetRegisterSaveAreaSize( |
| 717 StandardFrameConstants::kFixedFrameSizeFromFp); | 717 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 718 | |
| 719 // Sloppy mode functions and builtins need to replace the receiver with the | |
| 720 // global proxy when called as functions (without an explicit receiver | |
| 721 // object). | |
| 722 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
| 723 if (info->strict_mode() == SLOPPY && !info->is_native()) { | |
| 724 Label ok; | |
| 725 // +2 for return address and saved frame pointer. | |
| 726 int receiver_slot = info->scope()->num_parameters() + 2; | |
| 727 __ lw(a2, MemOperand(fp, receiver_slot * kPointerSize)); | |
| 728 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | |
| 729 __ Branch(&ok, ne, a2, Operand(at)); | |
| 730 | |
| 731 __ lw(a2, GlobalObjectOperand()); | |
| 732 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | |
| 733 __ sw(a2, MemOperand(fp, receiver_slot * kPointerSize)); | |
| 734 __ bind(&ok); | |
| 735 } | |
| 736 } else { | 718 } else { |
| 737 __ StubPrologue(); | 719 __ StubPrologue(); |
| 738 frame()->SetRegisterSaveAreaSize( | 720 frame()->SetRegisterSaveAreaSize( |
| 739 StandardFrameConstants::kFixedFrameSizeFromFp); | 721 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 740 } | 722 } |
| 741 int stack_slots = frame()->GetSpillSlotCount(); | 723 int stack_slots = frame()->GetSpillSlotCount(); |
| 742 if (stack_slots > 0) { | 724 if (stack_slots > 0) { |
| 743 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); | 725 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); |
| 744 } | 726 } |
| 745 } | 727 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 } | 943 } |
| 962 } | 944 } |
| 963 MarkLazyDeoptSite(); | 945 MarkLazyDeoptSite(); |
| 964 } | 946 } |
| 965 | 947 |
| 966 #undef __ | 948 #undef __ |
| 967 | 949 |
| 968 } // namespace compiler | 950 } // namespace compiler |
| 969 } // namespace internal | 951 } // namespace internal |
| 970 } // namespace v8 | 952 } // namespace v8 |
| OLD | NEW |