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

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

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) 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 | « src/arm64/lithium-arm64.h ('k') | src/ast.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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 DCHECK(is_generating()); 655 DCHECK(is_generating());
656 656
657 if (info()->IsOptimizing()) { 657 if (info()->IsOptimizing()) {
658 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 658 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
659 659
660 // TODO(all): Add support for stop_t FLAG in DEBUG mode. 660 // TODO(all): Add support for stop_t FLAG in DEBUG mode.
661 661
662 // Sloppy mode functions and builtins need to replace the receiver with the 662 // Sloppy mode functions and builtins need to replace the receiver with the
663 // global proxy when called as functions (without an explicit receiver 663 // global proxy when called as functions (without an explicit receiver
664 // object). 664 // object).
665 if (info_->this_has_uses() && 665 if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
666 info_->strict_mode() == SLOPPY &&
667 !info_->is_native()) { 666 !info_->is_native()) {
668 Label ok; 667 Label ok;
669 int receiver_offset = info_->scope()->num_parameters() * kXRegSize; 668 int receiver_offset = info_->scope()->num_parameters() * kXRegSize;
670 __ Peek(x10, receiver_offset); 669 __ Peek(x10, receiver_offset);
671 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); 670 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok);
672 671
673 __ Ldr(x10, GlobalObjectMemOperand()); 672 __ Ldr(x10, GlobalObjectMemOperand());
674 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset)); 673 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset));
675 __ Poke(x10, receiver_offset); 674 __ Poke(x10, receiver_offset);
676 675
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 2893
2895 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { 2894 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
2896 DCHECK(ToRegister(instr->context()).is(cp)); 2895 DCHECK(ToRegister(instr->context()).is(cp));
2897 // FunctionLiteral instruction is marked as call, we can trash any register. 2896 // FunctionLiteral instruction is marked as call, we can trash any register.
2898 DCHECK(instr->IsMarkedAsCall()); 2897 DCHECK(instr->IsMarkedAsCall());
2899 2898
2900 // Use the fast case closure allocation code that allocates in new 2899 // Use the fast case closure allocation code that allocates in new
2901 // space for nested functions that don't need literals cloning. 2900 // space for nested functions that don't need literals cloning.
2902 bool pretenure = instr->hydrogen()->pretenure(); 2901 bool pretenure = instr->hydrogen()->pretenure();
2903 if (!pretenure && instr->hydrogen()->has_no_literals()) { 2902 if (!pretenure && instr->hydrogen()->has_no_literals()) {
2904 FastNewClosureStub stub(isolate(), instr->hydrogen()->strict_mode(), 2903 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(),
2905 instr->hydrogen()->kind()); 2904 instr->hydrogen()->kind());
2906 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); 2905 __ Mov(x2, Operand(instr->hydrogen()->shared_info()));
2907 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2906 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2908 } else { 2907 } else {
2909 __ Mov(x2, Operand(instr->hydrogen()->shared_info())); 2908 __ Mov(x2, Operand(instr->hydrogen()->shared_info()));
2910 __ Mov(x1, Operand(pretenure ? factory()->true_value() 2909 __ Mov(x1, Operand(pretenure ? factory()->true_value()
2911 : factory()->false_value())); 2910 : factory()->false_value()));
2912 __ Push(cp, x2, x1); 2911 __ Push(cp, x2, x1);
2913 CallRuntime(Runtime::kNewClosure, 3, instr); 2912 CallRuntime(Runtime::kNewClosure, 3, instr);
2914 } 2913 }
(...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after
5363 } 5362 }
5364 5363
5365 5364
5366 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 5365 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
5367 DCHECK(ToRegister(instr->context()).is(cp)); 5366 DCHECK(ToRegister(instr->context()).is(cp));
5368 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 5367 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
5369 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); 5368 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
5370 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 5369 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
5371 5370
5372 Handle<Code> ic = 5371 Handle<Code> ic =
5373 CodeFactory::KeyedStoreIC(isolate(), instr->strict_mode()).code(); 5372 CodeFactory::KeyedStoreIC(isolate(), instr->language_mode()).code();
5374 CallCode(ic, RelocInfo::CODE_TARGET, instr); 5373 CallCode(ic, RelocInfo::CODE_TARGET, instr);
5375 } 5374 }
5376 5375
5377 5376
5378 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { 5377 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
5379 Representation representation = instr->representation(); 5378 Representation representation = instr->representation();
5380 5379
5381 Register object = ToRegister(instr->object()); 5380 Register object = ToRegister(instr->object());
5382 HObjectAccess access = instr->hydrogen()->access(); 5381 HObjectAccess access = instr->hydrogen()->access();
5383 int offset = access.offset(); 5382 int offset = access.offset();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
5473 } 5472 }
5474 } 5473 }
5475 5474
5476 5475
5477 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 5476 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
5478 DCHECK(ToRegister(instr->context()).is(cp)); 5477 DCHECK(ToRegister(instr->context()).is(cp));
5479 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 5478 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
5480 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 5479 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
5481 5480
5482 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); 5481 __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name()));
5483 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); 5482 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode());
5484 CallCode(ic, RelocInfo::CODE_TARGET, instr); 5483 CallCode(ic, RelocInfo::CODE_TARGET, instr);
5485 } 5484 }
5486 5485
5487 5486
5488 void LCodeGen::DoStringAdd(LStringAdd* instr) { 5487 void LCodeGen::DoStringAdd(LStringAdd* instr) {
5489 DCHECK(ToRegister(instr->context()).is(cp)); 5488 DCHECK(ToRegister(instr->context()).is(cp));
5490 DCHECK(ToRegister(instr->left()).Is(x1)); 5489 DCHECK(ToRegister(instr->left()).Is(x1));
5491 DCHECK(ToRegister(instr->right()).Is(x0)); 5490 DCHECK(ToRegister(instr->right()).Is(x0));
5492 StringAddStub stub(isolate(), 5491 StringAddStub stub(isolate(),
5493 instr->hydrogen()->flags(), 5492 instr->hydrogen()->flags(),
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
6085 Handle<ScopeInfo> scope_info = instr->scope_info(); 6084 Handle<ScopeInfo> scope_info = instr->scope_info();
6086 __ Push(scope_info); 6085 __ Push(scope_info);
6087 __ Push(ToRegister(instr->function())); 6086 __ Push(ToRegister(instr->function()));
6088 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6087 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6089 RecordSafepoint(Safepoint::kNoLazyDeopt); 6088 RecordSafepoint(Safepoint::kNoLazyDeopt);
6090 } 6089 }
6091 6090
6092 6091
6093 6092
6094 } } // namespace v8::internal 6093 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.h ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698