Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: src/compiler/mips64/code-generator-mips64.cc

Issue 904663003: MIPS64: Perform receiver patching for sloppy mode in high-level IR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 register_save_area_size += kPointerSize; 1043 register_save_area_size += kPointerSize;
1044 } 1044 }
1045 frame()->SetRegisterSaveAreaSize(register_save_area_size); 1045 frame()->SetRegisterSaveAreaSize(register_save_area_size);
1046 __ MultiPush(saves); 1046 __ MultiPush(saves);
1047 } 1047 }
1048 } else if (descriptor->IsJSFunctionCall()) { 1048 } else if (descriptor->IsJSFunctionCall()) {
1049 CompilationInfo* info = this->info(); 1049 CompilationInfo* info = this->info();
1050 __ Prologue(info->IsCodePreAgingActive()); 1050 __ Prologue(info->IsCodePreAgingActive());
1051 frame()->SetRegisterSaveAreaSize( 1051 frame()->SetRegisterSaveAreaSize(
1052 StandardFrameConstants::kFixedFrameSizeFromFp); 1052 StandardFrameConstants::kFixedFrameSizeFromFp);
1053
1054 // Sloppy mode functions and builtins need to replace the receiver with the
1055 // global proxy when called as functions (without an explicit receiver
1056 // object).
1057 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC?
1058 if (is_sloppy(info->language_mode()) && !info->is_native()) {
1059 Label ok;
1060 // +2 for return address and saved frame pointer.
1061 int receiver_slot = info->scope()->num_parameters() + 2;
1062 __ ld(a2, MemOperand(fp, receiver_slot * kPointerSize));
1063 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
1064 __ Branch(&ok, ne, a2, Operand(at));
1065
1066 __ ld(a2, GlobalObjectOperand());
1067 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset));
1068 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize));
1069 __ bind(&ok);
1070 }
1071 } else { 1053 } else {
1072 __ StubPrologue(); 1054 __ StubPrologue();
1073 frame()->SetRegisterSaveAreaSize( 1055 frame()->SetRegisterSaveAreaSize(
1074 StandardFrameConstants::kFixedFrameSizeFromFp); 1056 StandardFrameConstants::kFixedFrameSizeFromFp);
1075 } 1057 }
1076 int stack_slots = frame()->GetSpillSlotCount(); 1058 int stack_slots = frame()->GetSpillSlotCount();
1077 1059
1078 if (info()->is_osr()) { 1060 if (info()->is_osr()) {
1079 // TurboFan OSR-compiled functions cannot be entered directly. 1061 // TurboFan OSR-compiled functions cannot be entered directly.
1080 __ Abort(kShouldNotDirectlyEnterOsrFunction); 1062 __ Abort(kShouldNotDirectlyEnterOsrFunction);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 } 1295 }
1314 } 1296 }
1315 MarkLazyDeoptSite(); 1297 MarkLazyDeoptSite();
1316 } 1298 }
1317 1299
1318 #undef __ 1300 #undef __
1319 1301
1320 } // namespace compiler 1302 } // namespace compiler
1321 } // namespace internal 1303 } // namespace internal
1322 } // namespace v8 1304 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698