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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 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 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 922
923 __ cmp(r4, r3); 923 __ cmp(r4, r3);
924 __ bne(&next_test); 924 __ bne(&next_test);
925 __ Drop(1); // Switch value is no longer needed. 925 __ Drop(1); // Switch value is no longer needed.
926 __ b(clause->body_target()); 926 __ b(clause->body_target());
927 __ bind(&slow_case); 927 __ bind(&slow_case);
928 } 928 }
929 929
930 // Record position before stub call for type feedback. 930 // Record position before stub call for type feedback.
931 SetExpressionPosition(clause); 931 SetExpressionPosition(clause);
932 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, 932 Handle<Code> ic =
933 strength(language_mode())).code(); 933 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
934 CallIC(ic, clause->CompareId()); 934 CallIC(ic, clause->CompareId());
935 patch_site.EmitPatchInfo(); 935 patch_site.EmitPatchInfo();
936 936
937 Label skip; 937 Label skip;
938 __ b(&skip); 938 __ b(&skip);
939 PrepareForBailout(clause, TOS_REG); 939 PrepareForBailout(clause, TOS_REG);
940 __ LoadRoot(ip, Heap::kTrueValueRootIndex); 940 __ LoadRoot(ip, Heap::kTrueValueRootIndex);
941 __ cmp(r3, ip); 941 __ cmp(r3, ip);
942 __ bne(&next_test); 942 __ bne(&next_test);
943 __ Drop(1); 943 __ Drop(1);
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 Register right = r3; 2120 Register right = r3;
2121 __ pop(left); 2121 __ pop(left);
2122 2122
2123 // Perform combined smi check on both operands. 2123 // Perform combined smi check on both operands.
2124 __ orx(scratch1, left, right); 2124 __ orx(scratch1, left, right);
2125 STATIC_ASSERT(kSmiTag == 0); 2125 STATIC_ASSERT(kSmiTag == 0);
2126 JumpPatchSite patch_site(masm_); 2126 JumpPatchSite patch_site(masm_);
2127 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2127 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2128 2128
2129 __ bind(&stub_call); 2129 __ bind(&stub_call);
2130 Handle<Code> code = 2130 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2131 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2132 CallIC(code, expr->BinaryOperationFeedbackId()); 2131 CallIC(code, expr->BinaryOperationFeedbackId());
2133 patch_site.EmitPatchInfo(); 2132 patch_site.EmitPatchInfo();
2134 __ b(&done); 2133 __ b(&done);
2135 2134
2136 __ bind(&smi_case); 2135 __ bind(&smi_case);
2137 // Smi case. This code works the same way as the smi-smi case in the type 2136 // Smi case. This code works the same way as the smi-smi case in the type
2138 // recording binary operation stub. 2137 // recording binary operation stub.
2139 switch (op) { 2138 switch (op) {
2140 case Token::SAR: 2139 case Token::SAR:
2141 __ GetLeastBitsFromSmi(scratch1, right, 5); 2140 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 2282
2284 default: 2283 default:
2285 UNREACHABLE(); 2284 UNREACHABLE();
2286 } 2285 }
2287 } 2286 }
2288 } 2287 }
2289 2288
2290 2289
2291 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2290 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2292 __ pop(r4); 2291 __ pop(r4);
2293 Handle<Code> code = 2292 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2294 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2295 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2293 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2296 CallIC(code, expr->BinaryOperationFeedbackId()); 2294 CallIC(code, expr->BinaryOperationFeedbackId());
2297 patch_site.EmitPatchInfo(); 2295 patch_site.EmitPatchInfo();
2298 context()->Plug(r3); 2296 context()->Plug(r3);
2299 } 2297 }
2300 2298
2301 2299
2302 void FullCodeGenerator::EmitAssignment(Expression* expr, 2300 void FullCodeGenerator::EmitAssignment(Expression* expr,
2303 FeedbackVectorSlot slot) { 2301 FeedbackVectorSlot slot) {
2304 DCHECK(expr->IsValidReferenceExpressionOrThis()); 2302 DCHECK(expr->IsValidReferenceExpressionOrThis());
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
4104 } 4102 }
4105 } 4103 }
4106 } 4104 }
4107 4105
4108 __ bind(&stub_call); 4106 __ bind(&stub_call);
4109 __ mr(r4, r3); 4107 __ mr(r4, r3);
4110 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); 4108 __ LoadSmiLiteral(r3, Smi::FromInt(count_value));
4111 4109
4112 SetExpressionPosition(expr); 4110 SetExpressionPosition(expr);
4113 4111
4114 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, 4112 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
4115 strength(language_mode())).code();
4116 CallIC(code, expr->CountBinOpFeedbackId()); 4113 CallIC(code, expr->CountBinOpFeedbackId());
4117 patch_site.EmitPatchInfo(); 4114 patch_site.EmitPatchInfo();
4118 __ bind(&done); 4115 __ bind(&done);
4119 4116
4120 if (is_strong(language_mode())) { 4117 if (is_strong(language_mode())) {
4121 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); 4118 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG);
4122 } 4119 }
4123 // Store the value returned in r3. 4120 // Store the value returned in r3.
4124 switch (assign_type) { 4121 switch (assign_type) {
4125 case VARIABLE: 4122 case VARIABLE:
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 JumpPatchSite patch_site(masm_); 4330 JumpPatchSite patch_site(masm_);
4334 if (inline_smi_code) { 4331 if (inline_smi_code) {
4335 Label slow_case; 4332 Label slow_case;
4336 __ orx(r5, r3, r4); 4333 __ orx(r5, r3, r4);
4337 patch_site.EmitJumpIfNotSmi(r5, &slow_case); 4334 patch_site.EmitJumpIfNotSmi(r5, &slow_case);
4338 __ cmp(r4, r3); 4335 __ cmp(r4, r3);
4339 Split(cond, if_true, if_false, NULL); 4336 Split(cond, if_true, if_false, NULL);
4340 __ bind(&slow_case); 4337 __ bind(&slow_case);
4341 } 4338 }
4342 4339
4343 Handle<Code> ic = CodeFactory::CompareIC( 4340 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
4344 isolate(), op, strength(language_mode())).code();
4345 CallIC(ic, expr->CompareOperationFeedbackId()); 4341 CallIC(ic, expr->CompareOperationFeedbackId());
4346 patch_site.EmitPatchInfo(); 4342 patch_site.EmitPatchInfo();
4347 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4343 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4348 __ cmpi(r3, Operand::Zero()); 4344 __ cmpi(r3, Operand::Zero());
4349 Split(cond, if_true, if_false, fall_through); 4345 Split(cond, if_true, if_false, fall_through);
4350 } 4346 }
4351 } 4347 }
4352 4348
4353 // Convert the result of the comparison into one expected for this 4349 // Convert the result of the comparison into one expected for this
4354 // expression's context. 4350 // expression's context.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
4567 return ON_STACK_REPLACEMENT; 4563 return ON_STACK_REPLACEMENT;
4568 } 4564 }
4569 4565
4570 DCHECK(interrupt_address == 4566 DCHECK(interrupt_address ==
4571 isolate->builtins()->OsrAfterStackCheck()->entry()); 4567 isolate->builtins()->OsrAfterStackCheck()->entry());
4572 return OSR_AFTER_STACK_CHECK; 4568 return OSR_AFTER_STACK_CHECK;
4573 } 4569 }
4574 } // namespace internal 4570 } // namespace internal
4575 } // namespace v8 4571 } // namespace v8
4576 #endif // V8_TARGET_ARCH_PPC 4572 #endif // V8_TARGET_ARCH_PPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698