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

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

Issue 1693833002: Remove strong mode support from binary operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 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
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 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 959
960 __ Branch(&next_test, ne, a1, Operand(a0)); 960 __ Branch(&next_test, ne, a1, Operand(a0));
961 __ Drop(1); // Switch value is no longer needed. 961 __ Drop(1); // Switch value is no longer needed.
962 __ Branch(clause->body_target()); 962 __ Branch(clause->body_target());
963 963
964 __ bind(&slow_case); 964 __ bind(&slow_case);
965 } 965 }
966 966
967 // Record position before stub call for type feedback. 967 // Record position before stub call for type feedback.
968 SetExpressionPosition(clause); 968 SetExpressionPosition(clause);
969 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, 969 Handle<Code> ic =
970 strength(language_mode())).code(); 970 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
971 CallIC(ic, clause->CompareId()); 971 CallIC(ic, clause->CompareId());
972 patch_site.EmitPatchInfo(); 972 patch_site.EmitPatchInfo();
973 973
974 Label skip; 974 Label skip;
975 __ Branch(&skip); 975 __ Branch(&skip);
976 PrepareForBailout(clause, TOS_REG); 976 PrepareForBailout(clause, TOS_REG);
977 __ LoadRoot(at, Heap::kTrueValueRootIndex); 977 __ LoadRoot(at, Heap::kTrueValueRootIndex);
978 __ Branch(&next_test, ne, v0, Operand(at)); 978 __ Branch(&next_test, ne, v0, Operand(at));
979 __ Drop(1); 979 __ Drop(1);
980 __ Branch(clause->body_target()); 980 __ Branch(clause->body_target());
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 __ pop(left); 2143 __ pop(left);
2144 __ mov(a0, result_register()); 2144 __ mov(a0, result_register());
2145 2145
2146 // Perform combined smi check on both operands. 2146 // Perform combined smi check on both operands.
2147 __ Or(scratch1, left, Operand(right)); 2147 __ Or(scratch1, left, Operand(right));
2148 STATIC_ASSERT(kSmiTag == 0); 2148 STATIC_ASSERT(kSmiTag == 0);
2149 JumpPatchSite patch_site(masm_); 2149 JumpPatchSite patch_site(masm_);
2150 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2150 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2151 2151
2152 __ bind(&stub_call); 2152 __ bind(&stub_call);
2153 Handle<Code> code = 2153 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2154 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2155 CallIC(code, expr->BinaryOperationFeedbackId()); 2154 CallIC(code, expr->BinaryOperationFeedbackId());
2156 patch_site.EmitPatchInfo(); 2155 patch_site.EmitPatchInfo();
2157 __ jmp(&done); 2156 __ jmp(&done);
2158 2157
2159 __ bind(&smi_case); 2158 __ bind(&smi_case);
2160 // Smi case. This code works the same way as the smi-smi case in the type 2159 // Smi case. This code works the same way as the smi-smi case in the type
2161 // recording binary operation stub, see 2160 // recording binary operation stub, see
2162 switch (op) { 2161 switch (op) {
2163 case Token::SAR: 2162 case Token::SAR:
2164 __ GetLeastBitsFromSmi(scratch1, right, 5); 2163 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 default: 2270 default:
2272 UNREACHABLE(); 2271 UNREACHABLE();
2273 } 2272 }
2274 } 2273 }
2275 } 2274 }
2276 2275
2277 2276
2278 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2277 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2279 __ mov(a0, result_register()); 2278 __ mov(a0, result_register());
2280 __ pop(a1); 2279 __ pop(a1);
2281 Handle<Code> code = 2280 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2282 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2283 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2281 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2284 CallIC(code, expr->BinaryOperationFeedbackId()); 2282 CallIC(code, expr->BinaryOperationFeedbackId());
2285 patch_site.EmitPatchInfo(); 2283 patch_site.EmitPatchInfo();
2286 context()->Plug(v0); 2284 context()->Plug(v0);
2287 } 2285 }
2288 2286
2289 2287
2290 void FullCodeGenerator::EmitAssignment(Expression* expr, 2288 void FullCodeGenerator::EmitAssignment(Expression* expr,
2291 FeedbackVectorSlot slot) { 2289 FeedbackVectorSlot slot) {
2292 DCHECK(expr->IsValidReferenceExpressionOrThis()); 2290 DCHECK(expr->IsValidReferenceExpressionOrThis());
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
4106 } 4104 }
4107 } 4105 }
4108 } 4106 }
4109 4107
4110 __ bind(&stub_call); 4108 __ bind(&stub_call);
4111 __ mov(a1, v0); 4109 __ mov(a1, v0);
4112 __ li(a0, Operand(Smi::FromInt(count_value))); 4110 __ li(a0, Operand(Smi::FromInt(count_value)));
4113 4111
4114 SetExpressionPosition(expr); 4112 SetExpressionPosition(expr);
4115 4113
4116 4114 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
4117 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
4118 strength(language_mode())).code();
4119 CallIC(code, expr->CountBinOpFeedbackId()); 4115 CallIC(code, expr->CountBinOpFeedbackId());
4120 patch_site.EmitPatchInfo(); 4116 patch_site.EmitPatchInfo();
4121 __ bind(&done); 4117 __ bind(&done);
4122 4118
4123 if (is_strong(language_mode())) { 4119 if (is_strong(language_mode())) {
4124 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 4120 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
4125 } 4121 }
4126 // Store the value returned in v0. 4122 // Store the value returned in v0.
4127 switch (assign_type) { 4123 switch (assign_type) {
4128 case VARIABLE: 4124 case VARIABLE:
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
4336 bool inline_smi_code = ShouldInlineSmiCase(op); 4332 bool inline_smi_code = ShouldInlineSmiCase(op);
4337 JumpPatchSite patch_site(masm_); 4333 JumpPatchSite patch_site(masm_);
4338 if (inline_smi_code) { 4334 if (inline_smi_code) {
4339 Label slow_case; 4335 Label slow_case;
4340 __ Or(a2, a0, Operand(a1)); 4336 __ Or(a2, a0, Operand(a1));
4341 patch_site.EmitJumpIfNotSmi(a2, &slow_case); 4337 patch_site.EmitJumpIfNotSmi(a2, &slow_case);
4342 Split(cc, a1, Operand(a0), if_true, if_false, NULL); 4338 Split(cc, a1, Operand(a0), if_true, if_false, NULL);
4343 __ bind(&slow_case); 4339 __ bind(&slow_case);
4344 } 4340 }
4345 4341
4346 Handle<Code> ic = CodeFactory::CompareIC( 4342 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
4347 isolate(), op, strength(language_mode())).code();
4348 CallIC(ic, expr->CompareOperationFeedbackId()); 4343 CallIC(ic, expr->CompareOperationFeedbackId());
4349 patch_site.EmitPatchInfo(); 4344 patch_site.EmitPatchInfo();
4350 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4345 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4351 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); 4346 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
4352 } 4347 }
4353 } 4348 }
4354 4349
4355 // Convert the result of the comparison into one expected for this 4350 // Convert the result of the comparison into one expected for this
4356 // expression's context. 4351 // expression's context.
4357 context()->Plug(if_true, if_false); 4352 context()->Plug(if_true, if_false);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
4582 reinterpret_cast<uint32_t>( 4577 reinterpret_cast<uint32_t>(
4583 isolate->builtins()->OsrAfterStackCheck()->entry())); 4578 isolate->builtins()->OsrAfterStackCheck()->entry()));
4584 return OSR_AFTER_STACK_CHECK; 4579 return OSR_AFTER_STACK_CHECK;
4585 } 4580 }
4586 4581
4587 4582
4588 } // namespace internal 4583 } // namespace internal
4589 } // namespace v8 4584 } // namespace v8
4590 4585
4591 #endif // V8_TARGET_ARCH_MIPS 4586 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698