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

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: everything should work now 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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 __ Branch(&next_test, ne, a1, Operand(a0)); 1084 __ Branch(&next_test, ne, a1, Operand(a0));
1085 __ Drop(1); // Switch value is no longer needed. 1085 __ Drop(1); // Switch value is no longer needed.
1086 __ Branch(clause->body_target()); 1086 __ Branch(clause->body_target());
1087 1087
1088 __ bind(&slow_case); 1088 __ bind(&slow_case);
1089 } 1089 }
1090 1090
1091 // Record position before stub call for type feedback. 1091 // Record position before stub call for type feedback.
1092 SetSourcePosition(clause->position()); 1092 SetSourcePosition(clause->position());
1093 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, 1093 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT,
1094 language_mode()).code(); 1094 strength(language_mode())).code();
1095 CallIC(ic, clause->CompareId()); 1095 CallIC(ic, clause->CompareId());
1096 patch_site.EmitPatchInfo(); 1096 patch_site.EmitPatchInfo();
1097 1097
1098 Label skip; 1098 Label skip;
1099 __ Branch(&skip); 1099 __ Branch(&skip);
1100 PrepareForBailout(clause, TOS_REG); 1100 PrepareForBailout(clause, TOS_REG);
1101 __ LoadRoot(at, Heap::kTrueValueRootIndex); 1101 __ LoadRoot(at, Heap::kTrueValueRootIndex);
1102 __ Branch(&next_test, ne, v0, Operand(at)); 1102 __ Branch(&next_test, ne, v0, Operand(at));
1103 __ Drop(1); 1103 __ Drop(1);
1104 __ Branch(clause->body_target()); 1104 __ Branch(clause->body_target());
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 __ pop(left); 2469 __ pop(left);
2470 __ mov(a0, result_register()); 2470 __ mov(a0, result_register());
2471 2471
2472 // Perform combined smi check on both operands. 2472 // Perform combined smi check on both operands.
2473 __ Or(scratch1, left, Operand(right)); 2473 __ Or(scratch1, left, Operand(right));
2474 STATIC_ASSERT(kSmiTag == 0); 2474 STATIC_ASSERT(kSmiTag == 0);
2475 JumpPatchSite patch_site(masm_); 2475 JumpPatchSite patch_site(masm_);
2476 patch_site.EmitJumpIfSmi(scratch1, &smi_case); 2476 patch_site.EmitJumpIfSmi(scratch1, &smi_case);
2477 2477
2478 __ bind(&stub_call); 2478 __ bind(&stub_call);
2479 Handle<Code> code = CodeFactory::BinaryOpIC( 2479 Handle<Code> code =
2480 isolate(), op, language_mode()).code(); 2480 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2481 CallIC(code, expr->BinaryOperationFeedbackId()); 2481 CallIC(code, expr->BinaryOperationFeedbackId());
2482 patch_site.EmitPatchInfo(); 2482 patch_site.EmitPatchInfo();
2483 __ jmp(&done); 2483 __ jmp(&done);
2484 2484
2485 __ bind(&smi_case); 2485 __ bind(&smi_case);
2486 // Smi case. This code works the same way as the smi-smi case in the type 2486 // Smi case. This code works the same way as the smi-smi case in the type
2487 // recording binary operation stub, see 2487 // recording binary operation stub, see
2488 switch (op) { 2488 switch (op) {
2489 case Token::SAR: 2489 case Token::SAR:
2490 __ GetLeastBitsFromSmi(scratch1, right, 5); 2490 __ GetLeastBitsFromSmi(scratch1, right, 5);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 __ CallRuntime(Runtime::kToFastProperties, 1); 2613 __ CallRuntime(Runtime::kToFastProperties, 1);
2614 2614
2615 // constructor 2615 // constructor
2616 __ CallRuntime(Runtime::kToFastProperties, 1); 2616 __ CallRuntime(Runtime::kToFastProperties, 1);
2617 } 2617 }
2618 2618
2619 2619
2620 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2620 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2621 __ mov(a0, result_register()); 2621 __ mov(a0, result_register());
2622 __ pop(a1); 2622 __ pop(a1);
2623 Handle<Code> code = CodeFactory::BinaryOpIC( 2623 Handle<Code> code =
2624 isolate(), op, language_mode()).code(); 2624 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2625 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2625 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2626 CallIC(code, expr->BinaryOperationFeedbackId()); 2626 CallIC(code, expr->BinaryOperationFeedbackId());
2627 patch_site.EmitPatchInfo(); 2627 patch_site.EmitPatchInfo();
2628 context()->Plug(v0); 2628 context()->Plug(v0);
2629 } 2629 }
2630 2630
2631 2631
2632 void FullCodeGenerator::EmitAssignment(Expression* expr, 2632 void FullCodeGenerator::EmitAssignment(Expression* expr,
2633 FeedbackVectorICSlot slot) { 2633 FeedbackVectorICSlot slot) {
2634 DCHECK(expr->IsValidReferenceExpression()); 2634 DCHECK(expr->IsValidReferenceExpression());
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after
5054 } 5054 }
5055 } 5055 }
5056 5056
5057 __ bind(&stub_call); 5057 __ bind(&stub_call);
5058 __ mov(a1, v0); 5058 __ mov(a1, v0);
5059 __ li(a0, Operand(Smi::FromInt(count_value))); 5059 __ li(a0, Operand(Smi::FromInt(count_value)));
5060 5060
5061 // Record position before stub call. 5061 // Record position before stub call.
5062 SetSourcePosition(expr->position()); 5062 SetSourcePosition(expr->position());
5063 5063
5064 Handle<Code> code = CodeFactory::BinaryOpIC( 5064 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
5065 isolate(), Token::ADD, language_mode()).code(); 5065 strength(language_mode())).code();
5066 CallIC(code, expr->CountBinOpFeedbackId()); 5066 CallIC(code, expr->CountBinOpFeedbackId());
5067 patch_site.EmitPatchInfo(); 5067 patch_site.EmitPatchInfo();
5068 __ bind(&done); 5068 __ bind(&done);
5069 5069
5070 // Store the value returned in v0. 5070 // Store the value returned in v0.
5071 switch (assign_type) { 5071 switch (assign_type) {
5072 case VARIABLE: 5072 case VARIABLE:
5073 if (expr->is_postfix()) { 5073 if (expr->is_postfix()) {
5074 { EffectContext context(this); 5074 { EffectContext context(this);
5075 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), 5075 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
5318 JumpPatchSite patch_site(masm_); 5318 JumpPatchSite patch_site(masm_);
5319 if (inline_smi_code) { 5319 if (inline_smi_code) {
5320 Label slow_case; 5320 Label slow_case;
5321 __ Or(a2, a0, Operand(a1)); 5321 __ Or(a2, a0, Operand(a1));
5322 patch_site.EmitJumpIfNotSmi(a2, &slow_case); 5322 patch_site.EmitJumpIfNotSmi(a2, &slow_case);
5323 Split(cc, a1, Operand(a0), if_true, if_false, NULL); 5323 Split(cc, a1, Operand(a0), if_true, if_false, NULL);
5324 __ bind(&slow_case); 5324 __ bind(&slow_case);
5325 } 5325 }
5326 // Record position and call the compare IC. 5326 // Record position and call the compare IC.
5327 SetSourcePosition(expr->position()); 5327 SetSourcePosition(expr->position());
5328 Handle<Code> ic = 5328 Handle<Code> ic = CodeFactory::CompareIC(
5329 CodeFactory::CompareIC(isolate(), op, language_mode()).code(); 5329 isolate(), op, strength(language_mode())).code();
5330 CallIC(ic, expr->CompareOperationFeedbackId()); 5330 CallIC(ic, expr->CompareOperationFeedbackId());
5331 patch_site.EmitPatchInfo(); 5331 patch_site.EmitPatchInfo();
5332 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5332 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
5333 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); 5333 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
5334 } 5334 }
5335 } 5335 }
5336 5336
5337 // Convert the result of the comparison into one expected for this 5337 // Convert the result of the comparison into one expected for this
5338 // expression's context. 5338 // expression's context.
5339 context()->Plug(if_true, if_false); 5339 context()->Plug(if_true, if_false);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
5558 reinterpret_cast<uint32_t>( 5558 reinterpret_cast<uint32_t>(
5559 isolate->builtins()->OsrAfterStackCheck()->entry())); 5559 isolate->builtins()->OsrAfterStackCheck()->entry()));
5560 return OSR_AFTER_STACK_CHECK; 5560 return OSR_AFTER_STACK_CHECK;
5561 } 5561 }
5562 5562
5563 5563
5564 } // namespace internal 5564 } // namespace internal
5565 } // namespace v8 5565 } // namespace v8
5566 5566
5567 #endif // V8_TARGET_ARCH_MIPS 5567 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698