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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1113133006: Revert of Resolve references to "this" the same way as normal variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 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 | « src/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 662
663 if (info()->IsOptimizing()) { 663 if (info()->IsOptimizing()) {
664 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 664 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
665 665
666 // TODO(all): Add support for stop_t FLAG in DEBUG mode. 666 // TODO(all): Add support for stop_t FLAG in DEBUG mode.
667 667
668 // Sloppy mode functions and builtins need to replace the receiver with the 668 // Sloppy mode functions and builtins need to replace the receiver with the
669 // global proxy when called as functions (without an explicit receiver 669 // global proxy when called as functions (without an explicit receiver
670 // object). 670 // object).
671 if (is_sloppy(info_->language_mode()) && info()->MayUseThis() && 671 if (is_sloppy(info_->language_mode()) && info()->MayUseThis() &&
672 !info()->is_native() && info()->scope()->has_this_declaration()) { 672 !info_->is_native()) {
673 Label ok; 673 Label ok;
674 int receiver_offset = info_->scope()->num_parameters() * kXRegSize; 674 int receiver_offset = info_->scope()->num_parameters() * kXRegSize;
675 __ Peek(x10, receiver_offset); 675 __ Peek(x10, receiver_offset);
676 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); 676 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok);
677 677
678 __ Ldr(x10, GlobalObjectMemOperand()); 678 __ Ldr(x10, GlobalObjectMemOperand());
679 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset)); 679 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset));
680 __ Poke(x10, receiver_offset); 680 __ Poke(x10, receiver_offset);
681 681
682 __ Bind(&ok); 682 __ Bind(&ok);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 __ Push(x1); 721 __ Push(x1);
722 __ CallRuntime(Runtime::kNewFunctionContext, 1); 722 __ CallRuntime(Runtime::kNewFunctionContext, 1);
723 } 723 }
724 RecordSafepoint(Safepoint::kNoLazyDeopt); 724 RecordSafepoint(Safepoint::kNoLazyDeopt);
725 // Context is returned in x0. It replaces the context passed to us. It's 725 // Context is returned in x0. It replaces the context passed to us. It's
726 // saved in the stack and kept live in cp. 726 // saved in the stack and kept live in cp.
727 __ Mov(cp, x0); 727 __ Mov(cp, x0);
728 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 728 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset));
729 // Copy any necessary parameters into the context. 729 // Copy any necessary parameters into the context.
730 int num_parameters = scope()->num_parameters(); 730 int num_parameters = scope()->num_parameters();
731 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 731 for (int i = 0; i < num_parameters; i++) {
732 for (int i = first_parameter; i < num_parameters; i++) { 732 Variable* var = scope()->parameter(i);
733 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i);
734 if (var->IsContextSlot()) { 733 if (var->IsContextSlot()) {
735 Register value = x0; 734 Register value = x0;
736 Register scratch = x3; 735 Register scratch = x3;
737 736
738 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 737 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
739 (num_parameters - 1 - i) * kPointerSize; 738 (num_parameters - 1 - i) * kPointerSize;
740 // Load parameter from stack. 739 // Load parameter from stack.
741 __ Ldr(value, MemOperand(fp, parameter_offset)); 740 __ Ldr(value, MemOperand(fp, parameter_offset));
742 // Store it in the context. 741 // Store it in the context.
743 MemOperand target = ContextMemOperand(cp, var->index()); 742 MemOperand target = ContextMemOperand(cp, var->index());
(...skipping 5298 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 Handle<ScopeInfo> scope_info = instr->scope_info(); 6041 Handle<ScopeInfo> scope_info = instr->scope_info();
6043 __ Push(scope_info); 6042 __ Push(scope_info);
6044 __ Push(ToRegister(instr->function())); 6043 __ Push(ToRegister(instr->function()));
6045 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6044 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6046 RecordSafepoint(Safepoint::kNoLazyDeopt); 6045 RecordSafepoint(Safepoint::kNoLazyDeopt);
6047 } 6046 }
6048 6047
6049 6048
6050 6049
6051 } } // namespace v8::internal 6050 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698