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

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

Issue 1216463003: [strong] Implement strong mode semantics for the count operation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback + eliminate runtime check Created 5 years, 5 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/arm/full-codegen-arm.cc ('k') | src/compiler/ast-graph-builder.cc » ('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 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4690 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 } 4701 }
4702 } 4702 }
4703 4703
4704 __ Adds(x0, x0, Smi::FromInt(count_value)); 4704 __ Adds(x0, x0, Smi::FromInt(count_value));
4705 __ B(vc, &done); 4705 __ B(vc, &done);
4706 // Call stub. Undo operation first. 4706 // Call stub. Undo operation first.
4707 __ Sub(x0, x0, Smi::FromInt(count_value)); 4707 __ Sub(x0, x0, Smi::FromInt(count_value));
4708 __ B(&stub_call); 4708 __ B(&stub_call);
4709 __ Bind(&slow); 4709 __ Bind(&slow);
4710 } 4710 }
4711 ToNumberStub convert_stub(isolate()); 4711 if (!is_strong(language_mode())) {
4712 __ CallStub(&convert_stub); 4712 ToNumberStub convert_stub(isolate());
4713 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 4713 __ CallStub(&convert_stub);
4714 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
4715 }
4714 4716
4715 // Save result for postfix expressions. 4717 // Save result for postfix expressions.
4716 if (expr->is_postfix()) { 4718 if (expr->is_postfix()) {
4717 if (!context()->IsEffect()) { 4719 if (!context()->IsEffect()) {
4718 // Save the result on the stack. If we have a named or keyed property 4720 // Save the result on the stack. If we have a named or keyed property
4719 // we store the result under the receiver that is currently on top 4721 // we store the result under the receiver that is currently on top
4720 // of the stack. 4722 // of the stack.
4721 switch (assign_type) { 4723 switch (assign_type) {
4722 case VARIABLE: 4724 case VARIABLE:
4723 __ Push(x0); 4725 __ Push(x0);
(...skipping 24 matching lines...) Expand all
4748 { 4750 {
4749 Assembler::BlockPoolsScope scope(masm_); 4751 Assembler::BlockPoolsScope scope(masm_);
4750 Handle<Code> code = 4752 Handle<Code> code =
4751 CodeFactory::BinaryOpIC(isolate(), Token::ADD, 4753 CodeFactory::BinaryOpIC(isolate(), Token::ADD,
4752 strength(language_mode())).code(); 4754 strength(language_mode())).code();
4753 CallIC(code, expr->CountBinOpFeedbackId()); 4755 CallIC(code, expr->CountBinOpFeedbackId());
4754 patch_site.EmitPatchInfo(); 4756 patch_site.EmitPatchInfo();
4755 } 4757 }
4756 __ Bind(&done); 4758 __ Bind(&done);
4757 4759
4760 if (is_strong(language_mode())) {
4761 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
4762 }
4758 // Store the value returned in x0. 4763 // Store the value returned in x0.
4759 switch (assign_type) { 4764 switch (assign_type) {
4760 case VARIABLE: 4765 case VARIABLE:
4761 if (expr->is_postfix()) { 4766 if (expr->is_postfix()) {
4762 { EffectContext context(this); 4767 { EffectContext context(this);
4763 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 4768 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
4764 Token::ASSIGN, expr->CountSlot()); 4769 Token::ASSIGN, expr->CountSlot());
4765 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 4770 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
4766 context.Plug(x0); 4771 context.Plug(x0);
4767 } 4772 }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
5597 } 5602 }
5598 5603
5599 return INTERRUPT; 5604 return INTERRUPT;
5600 } 5605 }
5601 5606
5602 5607
5603 } // namespace internal 5608 } // namespace internal
5604 } // namespace v8 5609 } // namespace v8
5605 5610
5606 #endif // V8_TARGET_ARCH_ARM64 5611 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698