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

Side by Side Diff: src/arm/full-codegen-arm.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 | « no previous file | src/arm64/full-codegen-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 7 #if V8_TARGET_ARCH_ARM
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 5002 matching lines...) Expand 10 before | Expand all | Expand 10 after
5013 } 5013 }
5014 } 5014 }
5015 5015
5016 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC); 5016 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC);
5017 __ b(vc, &done); 5017 __ b(vc, &done);
5018 // Call stub. Undo operation first. 5018 // Call stub. Undo operation first.
5019 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); 5019 __ sub(r0, r0, Operand(Smi::FromInt(count_value)));
5020 __ jmp(&stub_call); 5020 __ jmp(&stub_call);
5021 __ bind(&slow); 5021 __ bind(&slow);
5022 } 5022 }
5023 ToNumberStub convert_stub(isolate()); 5023 if (!is_strong(language_mode())) {
5024 __ CallStub(&convert_stub); 5024 ToNumberStub convert_stub(isolate());
5025 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 5025 __ CallStub(&convert_stub);
5026 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5027 }
5026 5028
5027 // Save result for postfix expressions. 5029 // Save result for postfix expressions.
5028 if (expr->is_postfix()) { 5030 if (expr->is_postfix()) {
5029 if (!context()->IsEffect()) { 5031 if (!context()->IsEffect()) {
5030 // Save the result on the stack. If we have a named or keyed property 5032 // Save the result on the stack. If we have a named or keyed property
5031 // we store the result under the receiver that is currently on top 5033 // we store the result under the receiver that is currently on top
5032 // of the stack. 5034 // of the stack.
5033 switch (assign_type) { 5035 switch (assign_type) {
5034 case VARIABLE: 5036 case VARIABLE:
5035 __ push(r0); 5037 __ push(r0);
(...skipping 21 matching lines...) Expand all
5057 5059
5058 // Record position before stub call. 5060 // Record position before stub call.
5059 SetSourcePosition(expr->position()); 5061 SetSourcePosition(expr->position());
5060 5062
5061 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, 5063 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
5062 strength(language_mode())).code(); 5064 strength(language_mode())).code();
5063 CallIC(code, expr->CountBinOpFeedbackId()); 5065 CallIC(code, expr->CountBinOpFeedbackId());
5064 patch_site.EmitPatchInfo(); 5066 patch_site.EmitPatchInfo();
5065 __ bind(&done); 5067 __ bind(&done);
5066 5068
5069 if (is_strong(language_mode())) {
5070 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5071 }
5067 // Store the value returned in r0. 5072 // Store the value returned in r0.
5068 switch (assign_type) { 5073 switch (assign_type) {
5069 case VARIABLE: 5074 case VARIABLE:
5070 if (expr->is_postfix()) { 5075 if (expr->is_postfix()) {
5071 { EffectContext context(this); 5076 { EffectContext context(this);
5072 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5077 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
5073 Token::ASSIGN, expr->CountSlot()); 5078 Token::ASSIGN, expr->CountSlot());
5074 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 5079 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
5075 context.Plug(r0); 5080 context.Plug(r0);
5076 } 5081 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
5619 DCHECK(interrupt_address == 5624 DCHECK(interrupt_address ==
5620 isolate->builtins()->OsrAfterStackCheck()->entry()); 5625 isolate->builtins()->OsrAfterStackCheck()->entry());
5621 return OSR_AFTER_STACK_CHECK; 5626 return OSR_AFTER_STACK_CHECK;
5622 } 5627 }
5623 5628
5624 5629
5625 } // namespace internal 5630 } // namespace internal
5626 } // namespace v8 5631 } // namespace v8
5627 5632
5628 #endif // V8_TARGET_ARCH_ARM 5633 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698