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

Side by Side Diff: src/mips/full-codegen-mips.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/messages.h ('k') | src/mips64/full-codegen-mips64.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after
5032 Register scratch1 = a1; 5032 Register scratch1 = a1;
5033 Register scratch2 = t0; 5033 Register scratch2 = t0;
5034 __ li(scratch1, Operand(Smi::FromInt(count_value))); 5034 __ li(scratch1, Operand(Smi::FromInt(count_value)));
5035 __ AdduAndCheckForOverflow(v0, v0, scratch1, scratch2); 5035 __ AdduAndCheckForOverflow(v0, v0, scratch1, scratch2);
5036 __ BranchOnNoOverflow(&done, scratch2); 5036 __ BranchOnNoOverflow(&done, scratch2);
5037 // Call stub. Undo operation first. 5037 // Call stub. Undo operation first.
5038 __ Move(v0, a0); 5038 __ Move(v0, a0);
5039 __ jmp(&stub_call); 5039 __ jmp(&stub_call);
5040 __ bind(&slow); 5040 __ bind(&slow);
5041 } 5041 }
5042 ToNumberStub convert_stub(isolate()); 5042 if (!is_strong(language_mode())) {
5043 __ CallStub(&convert_stub); 5043 ToNumberStub convert_stub(isolate());
5044 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 5044 __ CallStub(&convert_stub);
5045 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5046 }
5045 5047
5046 // Save result for postfix expressions. 5048 // Save result for postfix expressions.
5047 if (expr->is_postfix()) { 5049 if (expr->is_postfix()) {
5048 if (!context()->IsEffect()) { 5050 if (!context()->IsEffect()) {
5049 // Save the result on the stack. If we have a named or keyed property 5051 // Save the result on the stack. If we have a named or keyed property
5050 // we store the result under the receiver that is currently on top 5052 // we store the result under the receiver that is currently on top
5051 // of the stack. 5053 // of the stack.
5052 switch (assign_type) { 5054 switch (assign_type) {
5053 case VARIABLE: 5055 case VARIABLE:
5054 __ push(v0); 5056 __ push(v0);
(...skipping 20 matching lines...) Expand all
5075 5077
5076 // Record position before stub call. 5078 // Record position before stub call.
5077 SetSourcePosition(expr->position()); 5079 SetSourcePosition(expr->position());
5078 5080
5079 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, 5081 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
5080 strength(language_mode())).code(); 5082 strength(language_mode())).code();
5081 CallIC(code, expr->CountBinOpFeedbackId()); 5083 CallIC(code, expr->CountBinOpFeedbackId());
5082 patch_site.EmitPatchInfo(); 5084 patch_site.EmitPatchInfo();
5083 __ bind(&done); 5085 __ bind(&done);
5084 5086
5087 if (is_strong(language_mode())) {
5088 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
5089 }
5085 // Store the value returned in v0. 5090 // Store the value returned in v0.
5086 switch (assign_type) { 5091 switch (assign_type) {
5087 case VARIABLE: 5092 case VARIABLE:
5088 if (expr->is_postfix()) { 5093 if (expr->is_postfix()) {
5089 { EffectContext context(this); 5094 { EffectContext context(this);
5090 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5095 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
5091 Token::ASSIGN, expr->CountSlot()); 5096 Token::ASSIGN, expr->CountSlot());
5092 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); 5097 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
5093 context.Plug(v0); 5098 context.Plug(v0);
5094 } 5099 }
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
5573 reinterpret_cast<uint32_t>( 5578 reinterpret_cast<uint32_t>(
5574 isolate->builtins()->OsrAfterStackCheck()->entry())); 5579 isolate->builtins()->OsrAfterStackCheck()->entry()));
5575 return OSR_AFTER_STACK_CHECK; 5580 return OSR_AFTER_STACK_CHECK;
5576 } 5581 }
5577 5582
5578 5583
5579 } // namespace internal 5584 } // namespace internal
5580 } // namespace v8 5585 } // namespace v8
5581 5586
5582 #endif // V8_TARGET_ARCH_MIPS 5587 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698