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

Side by Side Diff: src/arm/full-codegen-arm.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
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/ic/ic.cc » ('J')
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_ARM 7 #if V8_TARGET_ARCH_ARM
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 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 Register right = r0; 2475 Register right = r0;
2476 __ pop(left); 2476 __ pop(left);
2477 2477
2478 // Perform combined smi check on both operands. 2478 // Perform combined smi check on both operands.
2479 __ orr(scratch1, left, Operand(right)); 2479 __ orr(scratch1, left, Operand(right));
2480 STATIC_ASSERT(kSmiTag == 0); 2480 STATIC_ASSERT(kSmiTag == 0);
2481 JumpPatchSite patch_site(masm_); 2481 JumpPatchSite patch_site(masm_);
2482 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2482 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2483 2483
2484 __ bind(&stub_call); 2484 __ bind(&stub_call);
2485 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2485 Handle<Code> code = CodeFactory::BinaryOpIC(
2486 isolate(), op, language_mode()).code();
2486 CallIC(code, expr->BinaryOperationFeedbackId()); 2487 CallIC(code, expr->BinaryOperationFeedbackId());
2487 patch_site.EmitPatchInfo(); 2488 patch_site.EmitPatchInfo();
2488 __ jmp(&done); 2489 __ jmp(&done);
2489 2490
2490 __ bind(&smi_case); 2491 __ bind(&smi_case);
2491 // Smi case. This code works the same way as the smi-smi case in the type 2492 // Smi case. This code works the same way as the smi-smi case in the type
2492 // recording binary operation stub, see 2493 // recording binary operation stub, see
2493 switch (op) { 2494 switch (op) {
2494 case Token::SAR: 2495 case Token::SAR:
2495 __ GetLeastBitsFromSmi(scratch1, right, 5); 2496 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2619 // prototype 2620 // prototype
2620 __ CallRuntime(Runtime::kToFastProperties, 1); 2621 __ CallRuntime(Runtime::kToFastProperties, 1);
2621 2622
2622 // constructor 2623 // constructor
2623 __ CallRuntime(Runtime::kToFastProperties, 1); 2624 __ CallRuntime(Runtime::kToFastProperties, 1);
2624 } 2625 }
2625 2626
2626 2627
2627 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2628 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2628 __ pop(r1); 2629 __ pop(r1);
2629 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2630 Handle<Code> code = CodeFactory::BinaryOpIC(
2631 isolate(), op, language_mode()).code();
2630 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2632 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2631 CallIC(code, expr->BinaryOperationFeedbackId()); 2633 CallIC(code, expr->BinaryOperationFeedbackId());
2632 patch_site.EmitPatchInfo(); 2634 patch_site.EmitPatchInfo();
2633 context()->Plug(r0); 2635 context()->Plug(r0);
2634 } 2636 }
2635 2637
2636 2638
2637 void FullCodeGenerator::EmitAssignment(Expression* expr) { 2639 void FullCodeGenerator::EmitAssignment(Expression* expr) {
2638 DCHECK(expr->IsValidReferenceExpression()); 2640 DCHECK(expr->IsValidReferenceExpression());
2639 2641
(...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after
4995 } 4997 }
4996 4998
4997 4999
4998 __ bind(&stub_call); 5000 __ bind(&stub_call);
4999 __ mov(r1, r0); 5001 __ mov(r1, r0);
5000 __ mov(r0, Operand(Smi::FromInt(count_value))); 5002 __ mov(r0, Operand(Smi::FromInt(count_value)));
5001 5003
5002 // Record position before stub call. 5004 // Record position before stub call.
5003 SetSourcePosition(expr->position()); 5005 SetSourcePosition(expr->position());
5004 5006
5005 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); 5007 Handle<Code> code = CodeFactory::BinaryOpIC(
5008 isolate(), Token::ADD, language_mode()).code();
5006 CallIC(code, expr->CountBinOpFeedbackId()); 5009 CallIC(code, expr->CountBinOpFeedbackId());
5007 patch_site.EmitPatchInfo(); 5010 patch_site.EmitPatchInfo();
5008 __ bind(&done); 5011 __ bind(&done);
5009 5012
5010 // Store the value returned in r0. 5013 // Store the value returned in r0.
5011 switch (assign_type) { 5014 switch (assign_type) {
5012 case VARIABLE: 5015 case VARIABLE:
5013 if (expr->is_postfix()) { 5016 if (expr->is_postfix()) {
5014 { EffectContext context(this); 5017 { EffectContext context(this);
5015 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5018 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
5533 5536
5534 DCHECK(interrupt_address == 5537 DCHECK(interrupt_address ==
5535 isolate->builtins()->OsrAfterStackCheck()->entry()); 5538 isolate->builtins()->OsrAfterStackCheck()->entry());
5536 return OSR_AFTER_STACK_CHECK; 5539 return OSR_AFTER_STACK_CHECK;
5537 } 5540 }
5538 5541
5539 5542
5540 } } // namespace v8::internal 5543 } } // namespace v8::internal
5541 5544
5542 #endif // V8_TARGET_ARCH_ARM 5545 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698