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

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

Issue 1092353002: [strong] Disallow implicit conversions for binary arithmetic operations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback 5 Created 5 years, 8 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 #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 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 Register right = r3; 2428 Register right = r3;
2429 __ pop(left); 2429 __ pop(left);
2430 2430
2431 // Perform combined smi check on both operands. 2431 // Perform combined smi check on both operands.
2432 __ orx(scratch1, left, right); 2432 __ orx(scratch1, left, right);
2433 STATIC_ASSERT(kSmiTag == 0); 2433 STATIC_ASSERT(kSmiTag == 0);
2434 JumpPatchSite patch_site(masm_); 2434 JumpPatchSite patch_site(masm_);
2435 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2435 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2436 2436
2437 __ bind(&stub_call); 2437 __ bind(&stub_call);
2438 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2438 Handle<Code> code = CodeFactory::BinaryOpIC(
2439 isolate(), op, language_mode()).code();
2439 CallIC(code, expr->BinaryOperationFeedbackId()); 2440 CallIC(code, expr->BinaryOperationFeedbackId());
2440 patch_site.EmitPatchInfo(); 2441 patch_site.EmitPatchInfo();
2441 __ b(&done); 2442 __ b(&done);
2442 2443
2443 __ bind(&smi_case); 2444 __ bind(&smi_case);
2444 // Smi case. This code works the same way as the smi-smi case in the type 2445 // Smi case. This code works the same way as the smi-smi case in the type
2445 // recording binary operation stub. 2446 // recording binary operation stub.
2446 switch (op) { 2447 switch (op) {
2447 case Token::SAR: 2448 case Token::SAR:
2448 __ GetLeastBitsFromSmi(scratch1, right, 5); 2449 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 // prototype 2605 // prototype
2605 __ CallRuntime(Runtime::kToFastProperties, 1); 2606 __ CallRuntime(Runtime::kToFastProperties, 1);
2606 2607
2607 // constructor 2608 // constructor
2608 __ CallRuntime(Runtime::kToFastProperties, 1); 2609 __ CallRuntime(Runtime::kToFastProperties, 1);
2609 } 2610 }
2610 2611
2611 2612
2612 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2613 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2613 __ pop(r4); 2614 __ pop(r4);
2614 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2615 Handle<Code> code = CodeFactory::BinaryOpIC(
2616 isolate(), op, language_mode()).code();
2615 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2617 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2616 CallIC(code, expr->BinaryOperationFeedbackId()); 2618 CallIC(code, expr->BinaryOperationFeedbackId());
2617 patch_site.EmitPatchInfo(); 2619 patch_site.EmitPatchInfo();
2618 context()->Plug(r3); 2620 context()->Plug(r3);
2619 } 2621 }
2620 2622
2621 2623
2622 void FullCodeGenerator::EmitAssignment(Expression* expr) { 2624 void FullCodeGenerator::EmitAssignment(Expression* expr) {
2623 DCHECK(expr->IsValidReferenceExpression()); 2625 DCHECK(expr->IsValidReferenceExpression());
2624 2626
(...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after
5001 } 5003 }
5002 } 5004 }
5003 5005
5004 __ bind(&stub_call); 5006 __ bind(&stub_call);
5005 __ mr(r4, r3); 5007 __ mr(r4, r3);
5006 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); 5008 __ LoadSmiLiteral(r3, Smi::FromInt(count_value));
5007 5009
5008 // Record position before stub call. 5010 // Record position before stub call.
5009 SetSourcePosition(expr->position()); 5011 SetSourcePosition(expr->position());
5010 5012
5011 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); 5013 Handle<Code> code = CodeFactory::BinaryOpIC(
5014 isolate(), Token::ADD, language_mode()).code();
5012 CallIC(code, expr->CountBinOpFeedbackId()); 5015 CallIC(code, expr->CountBinOpFeedbackId());
5013 patch_site.EmitPatchInfo(); 5016 patch_site.EmitPatchInfo();
5014 __ bind(&done); 5017 __ bind(&done);
5015 5018
5016 // Store the value returned in r3. 5019 // Store the value returned in r3.
5017 switch (assign_type) { 5020 switch (assign_type) {
5018 case VARIABLE: 5021 case VARIABLE:
5019 if (expr->is_postfix()) { 5022 if (expr->is_postfix()) {
5020 { 5023 {
5021 EffectContext context(this); 5024 EffectContext context(this);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
5472 return ON_STACK_REPLACEMENT; 5475 return ON_STACK_REPLACEMENT;
5473 } 5476 }
5474 5477
5475 DCHECK(interrupt_address == 5478 DCHECK(interrupt_address ==
5476 isolate->builtins()->OsrAfterStackCheck()->entry()); 5479 isolate->builtins()->OsrAfterStackCheck()->entry());
5477 return OSR_AFTER_STACK_CHECK; 5480 return OSR_AFTER_STACK_CHECK;
5478 } 5481 }
5479 } 5482 }
5480 } // namespace v8::internal 5483 } // namespace v8::internal
5481 #endif // V8_TARGET_ARCH_PPC 5484 #endif // V8_TARGET_ARCH_PPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698