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

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

Issue 1144183004: [strong] Refactor ObjectStrength into a replacement for strong boolean args (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 6 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 #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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 __ Branch(&next_test, ne, a1, Operand(a0)); 1066 __ Branch(&next_test, ne, a1, Operand(a0));
1067 __ Drop(1); // Switch value is no longer needed. 1067 __ Drop(1); // Switch value is no longer needed.
1068 __ Branch(clause->body_target()); 1068 __ Branch(clause->body_target());
1069 1069
1070 __ bind(&slow_case); 1070 __ bind(&slow_case);
1071 } 1071 }
1072 1072
1073 // Record position before stub call for type feedback. 1073 // Record position before stub call for type feedback.
1074 SetSourcePosition(clause->position()); 1074 SetSourcePosition(clause->position());
1075 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, 1075 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT,
1076 language_mode()).code(); 1076 strength(language_mode())).code();
1077 CallIC(ic, clause->CompareId()); 1077 CallIC(ic, clause->CompareId());
1078 patch_site.EmitPatchInfo(); 1078 patch_site.EmitPatchInfo();
1079 1079
1080 Label skip; 1080 Label skip;
1081 __ Branch(&skip); 1081 __ Branch(&skip);
1082 PrepareForBailout(clause, TOS_REG); 1082 PrepareForBailout(clause, TOS_REG);
1083 __ LoadRoot(at, Heap::kTrueValueRootIndex); 1083 __ LoadRoot(at, Heap::kTrueValueRootIndex);
1084 __ Branch(&next_test, ne, v0, Operand(at)); 1084 __ Branch(&next_test, ne, v0, Operand(at));
1085 __ Drop(1); 1085 __ Drop(1);
1086 __ Branch(clause->body_target()); 1086 __ Branch(clause->body_target());
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 __ pop(left); 2451 __ pop(left);
2452 __ mov(a0, result_register()); 2452 __ mov(a0, result_register());
2453 2453
2454 // Perform combined smi check on both operands. 2454 // Perform combined smi check on both operands.
2455 __ Or(scratch1, left, Operand(right)); 2455 __ Or(scratch1, left, Operand(right));
2456 STATIC_ASSERT(kSmiTag == 0); 2456 STATIC_ASSERT(kSmiTag == 0);
2457 JumpPatchSite patch_site(masm_); 2457 JumpPatchSite patch_site(masm_);
2458 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2458 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2459 2459
2460 __ bind(&stub_call); 2460 __ bind(&stub_call);
2461 Handle<Code> code = CodeFactory::BinaryOpIC( 2461 Handle<Code> code =
2462 isolate(), op, language_mode()).code(); 2462 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2463 CallIC(code, expr->BinaryOperationFeedbackId()); 2463 CallIC(code, expr->BinaryOperationFeedbackId());
2464 patch_site.EmitPatchInfo(); 2464 patch_site.EmitPatchInfo();
2465 __ jmp(&done); 2465 __ jmp(&done);
2466 2466
2467 __ bind(&smi_case); 2467 __ bind(&smi_case);
2468 // Smi case. This code works the same way as the smi-smi case in the type 2468 // Smi case. This code works the same way as the smi-smi case in the type
2469 // recording binary operation stub, see 2469 // recording binary operation stub, see
2470 switch (op) { 2470 switch (op) {
2471 case Token::SAR: 2471 case Token::SAR:
2472 __ GetLeastBitsFromSmi(scratch1, right, 5); 2472 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 __ CallRuntime(Runtime::kToFastProperties, 1); 2595 __ CallRuntime(Runtime::kToFastProperties, 1);
2596 2596
2597 // constructor 2597 // constructor
2598 __ CallRuntime(Runtime::kToFastProperties, 1); 2598 __ CallRuntime(Runtime::kToFastProperties, 1);
2599 } 2599 }
2600 2600
2601 2601
2602 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2602 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2603 __ mov(a0, result_register()); 2603 __ mov(a0, result_register());
2604 __ pop(a1); 2604 __ pop(a1);
2605 Handle<Code> code = CodeFactory::BinaryOpIC( 2605 Handle<Code> code =
2606 isolate(), op, language_mode()).code(); 2606 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2607 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2607 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2608 CallIC(code, expr->BinaryOperationFeedbackId()); 2608 CallIC(code, expr->BinaryOperationFeedbackId());
2609 patch_site.EmitPatchInfo(); 2609 patch_site.EmitPatchInfo();
2610 context()->Plug(v0); 2610 context()->Plug(v0);
2611 } 2611 }
2612 2612
2613 2613
2614 void FullCodeGenerator::EmitAssignment(Expression* expr, 2614 void FullCodeGenerator::EmitAssignment(Expression* expr,
2615 FeedbackVectorICSlot slot) { 2615 FeedbackVectorICSlot slot) {
2616 DCHECK(expr->IsValidReferenceExpression()); 2616 DCHECK(expr->IsValidReferenceExpression());
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after
5036 } 5036 }
5037 } 5037 }
5038 5038
5039 __ bind(&stub_call); 5039 __ bind(&stub_call);
5040 __ mov(a1, v0); 5040 __ mov(a1, v0);
5041 __ li(a0, Operand(Smi::FromInt(count_value))); 5041 __ li(a0, Operand(Smi::FromInt(count_value)));
5042 5042
5043 // Record position before stub call. 5043 // Record position before stub call.
5044 SetSourcePosition(expr->position()); 5044 SetSourcePosition(expr->position());
5045 5045
5046 Handle<Code> code = CodeFactory::BinaryOpIC( 5046 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
5047 isolate(), Token::ADD, language_mode()).code(); 5047 strength(language_mode())).code();
5048 CallIC(code, expr->CountBinOpFeedbackId()); 5048 CallIC(code, expr->CountBinOpFeedbackId());
5049 patch_site.EmitPatchInfo(); 5049 patch_site.EmitPatchInfo();
5050 __ bind(&done); 5050 __ bind(&done);
5051 5051
5052 // Store the value returned in v0. 5052 // Store the value returned in v0.
5053 switch (assign_type) { 5053 switch (assign_type) {
5054 case VARIABLE: 5054 case VARIABLE:
5055 if (expr->is_postfix()) { 5055 if (expr->is_postfix()) {
5056 { EffectContext context(this); 5056 { EffectContext context(this);
5057 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5057 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
5300 JumpPatchSite patch_site(masm_); 5300 JumpPatchSite patch_site(masm_);
5301 if (inline_smi_code) { 5301 if (inline_smi_code) {
5302 Label slow_case; 5302 Label slow_case;
5303 __ Or(a2, a0, Operand(a1)); 5303 __ Or(a2, a0, Operand(a1));
5304 patch_site.EmitJumpIfNotSmi(a2, &slow_case); 5304 patch_site.EmitJumpIfNotSmi(a2, &slow_case);
5305 Split(cc, a1, Operand(a0), if_true, if_false, NULL); 5305 Split(cc, a1, Operand(a0), if_true, if_false, NULL);
5306 __ bind(&slow_case); 5306 __ bind(&slow_case);
5307 } 5307 }
5308 // Record position and call the compare IC. 5308 // Record position and call the compare IC.
5309 SetSourcePosition(expr->position()); 5309 SetSourcePosition(expr->position());
5310 Handle<Code> ic = 5310 Handle<Code> ic = CodeFactory::CompareIC(
5311 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); 5311 isolate(), op, strength(language_mode())).code();
5312 CallIC(ic, expr->CompareOperationFeedbackId()); 5312 CallIC(ic, expr->CompareOperationFeedbackId());
5313 patch_site.EmitPatchInfo(); 5313 patch_site.EmitPatchInfo();
5314 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5314 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
5315 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); 5315 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
5316 } 5316 }
5317 } 5317 }
5318 5318
5319 // Convert the result of the comparison into one expected for this 5319 // Convert the result of the comparison into one expected for this
5320 // expression's context. 5320 // expression's context.
5321 context()->Plug(if_true, if_false); 5321 context()->Plug(if_true, if_false);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
5540 reinterpret_cast<uint32_t>( 5540 reinterpret_cast<uint32_t>(
5541 isolate->builtins()->OsrAfterStackCheck()->entry())); 5541 isolate->builtins()->OsrAfterStackCheck()->entry()));
5542 return OSR_AFTER_STACK_CHECK; 5542 return OSR_AFTER_STACK_CHECK;
5543 } 5543 }
5544 5544
5545 5545
5546 } // namespace internal 5546 } // namespace internal
5547 } // namespace v8 5547 } // namespace v8
5548 5548
5549 #endif // V8_TARGET_ARCH_MIPS 5549 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698