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/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 register_save_area_size += kPointerSize; | 1055 register_save_area_size += kPointerSize; |
1056 } | 1056 } |
1057 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 1057 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
1058 __ MultiPush(saves); | 1058 __ MultiPush(saves); |
1059 } | 1059 } |
1060 } else if (descriptor->IsJSFunctionCall()) { | 1060 } else if (descriptor->IsJSFunctionCall()) { |
1061 CompilationInfo* info = this->info(); | 1061 CompilationInfo* info = this->info(); |
1062 __ Prologue(info->IsCodePreAgingActive()); | 1062 __ Prologue(info->IsCodePreAgingActive()); |
1063 frame()->SetRegisterSaveAreaSize( | 1063 frame()->SetRegisterSaveAreaSize( |
1064 StandardFrameConstants::kFixedFrameSizeFromFp); | 1064 StandardFrameConstants::kFixedFrameSizeFromFp); |
1065 | |
1066 // Sloppy mode functions and builtins need to replace the receiver with the | |
1067 // global proxy when called as functions (without an explicit receiver | |
1068 // object). | |
1069 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
1070 if (is_sloppy(info->language_mode()) && !info->is_native()) { | |
1071 Label ok; | |
1072 // +2 for return address and saved frame pointer. | |
1073 int receiver_slot = info->scope()->num_parameters() + 2; | |
1074 __ ld(a2, MemOperand(fp, receiver_slot * kPointerSize)); | |
1075 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | |
1076 __ Branch(&ok, ne, a2, Operand(at)); | |
1077 | |
1078 __ ld(a2, GlobalObjectOperand()); | |
1079 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | |
1080 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize)); | |
1081 __ bind(&ok); | |
1082 } | |
1083 } else { | 1065 } else { |
1084 __ StubPrologue(); | 1066 __ StubPrologue(); |
1085 frame()->SetRegisterSaveAreaSize( | 1067 frame()->SetRegisterSaveAreaSize( |
1086 StandardFrameConstants::kFixedFrameSizeFromFp); | 1068 StandardFrameConstants::kFixedFrameSizeFromFp); |
1087 } | 1069 } |
1088 int stack_slots = frame()->GetSpillSlotCount(); | 1070 int stack_slots = frame()->GetSpillSlotCount(); |
1089 | 1071 |
1090 if (info()->is_osr()) { | 1072 if (info()->is_osr()) { |
1091 // TurboFan OSR-compiled functions cannot be entered directly. | 1073 // TurboFan OSR-compiled functions cannot be entered directly. |
1092 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1074 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 } | 1307 } |
1326 } | 1308 } |
1327 MarkLazyDeoptSite(); | 1309 MarkLazyDeoptSite(); |
1328 } | 1310 } |
1329 | 1311 |
1330 #undef __ | 1312 #undef __ |
1331 | 1313 |
1332 } // namespace compiler | 1314 } // namespace compiler |
1333 } // namespace internal | 1315 } // namespace internal |
1334 } // namespace v8 | 1316 } // namespace v8 |
OLD | NEW |