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

Side by Side Diff: src/ppc/full-codegen-ppc.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/mips64/full-codegen-mips64.cc ('k') | src/runtime.js » ('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 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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
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 5028 matching lines...) Expand 10 before | Expand all | Expand 10 after
5039 Register scratch1 = r4; 5039 Register scratch1 = r4;
5040 Register scratch2 = r5; 5040 Register scratch2 = r5;
5041 __ LoadSmiLiteral(scratch1, Smi::FromInt(count_value)); 5041 __ LoadSmiLiteral(scratch1, Smi::FromInt(count_value));
5042 __ AddAndCheckForOverflow(r3, r3, scratch1, scratch2, r0); 5042 __ AddAndCheckForOverflow(r3, r3, scratch1, scratch2, r0);
5043 __ BranchOnNoOverflow(&done); 5043 __ BranchOnNoOverflow(&done);
5044 // Call stub. Undo operation first. 5044 // Call stub. Undo operation first.
5045 __ sub(r3, r3, scratch1); 5045 __ sub(r3, r3, scratch1);
5046 __ b(&stub_call); 5046 __ b(&stub_call);
5047 __ bind(&slow); 5047 __ bind(&slow);
5048 } 5048 }
5049 ToNumberStub convert_stub(isolate()); 5049 if (!is_strong(language_mode())) {
5050 __ CallStub(&convert_stub); 5050 ToNumberStub convert_stub(isolate());
5051 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 5051 __ CallStub(&convert_stub);
5052 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5053 }
5052 5054
5053 // Save result for postfix expressions. 5055 // Save result for postfix expressions.
5054 if (expr->is_postfix()) { 5056 if (expr->is_postfix()) {
5055 if (!context()->IsEffect()) { 5057 if (!context()->IsEffect()) {
5056 // Save the result on the stack. If we have a named or keyed property 5058 // Save the result on the stack. If we have a named or keyed property
5057 // we store the result under the receiver that is currently on top 5059 // we store the result under the receiver that is currently on top
5058 // of the stack. 5060 // of the stack.
5059 switch (assign_type) { 5061 switch (assign_type) {
5060 case VARIABLE: 5062 case VARIABLE:
5061 __ push(r3); 5063 __ push(r3);
(...skipping 20 matching lines...) Expand all
5082 5084
5083 // Record position before stub call. 5085 // Record position before stub call.
5084 SetSourcePosition(expr->position()); 5086 SetSourcePosition(expr->position());
5085 5087
5086 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, 5088 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
5087 strength(language_mode())).code(); 5089 strength(language_mode())).code();
5088 CallIC(code, expr->CountBinOpFeedbackId()); 5090 CallIC(code, expr->CountBinOpFeedbackId());
5089 patch_site.EmitPatchInfo(); 5091 patch_site.EmitPatchInfo();
5090 __ bind(&done); 5092 __ bind(&done);
5091 5093
5094 if (is_strong(language_mode())) {
5095 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5096 }
5092 // Store the value returned in r3. 5097 // Store the value returned in r3.
5093 switch (assign_type) { 5098 switch (assign_type) {
5094 case VARIABLE: 5099 case VARIABLE:
5095 if (expr->is_postfix()) { 5100 if (expr->is_postfix()) {
5096 { 5101 {
5097 EffectContext context(this); 5102 EffectContext context(this);
5098 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5103 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
5099 Token::ASSIGN, expr->CountSlot()); 5104 Token::ASSIGN, expr->CountSlot());
5100 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 5105 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
5101 context.Plug(r3); 5106 context.Plug(r3);
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
5576 return ON_STACK_REPLACEMENT; 5581 return ON_STACK_REPLACEMENT;
5577 } 5582 }
5578 5583
5579 DCHECK(interrupt_address == 5584 DCHECK(interrupt_address ==
5580 isolate->builtins()->OsrAfterStackCheck()->entry()); 5585 isolate->builtins()->OsrAfterStackCheck()->entry());
5581 return OSR_AFTER_STACK_CHECK; 5586 return OSR_AFTER_STACK_CHECK;
5582 } 5587 }
5583 } // namespace internal 5588 } // namespace internal
5584 } // namespace v8 5589 } // namespace v8
5585 #endif // V8_TARGET_ARCH_PPC 5590 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698