| OLD | NEW |
| 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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 959 |
| 960 __ Branch(&next_test, ne, a1, Operand(a0)); | 960 __ Branch(&next_test, ne, a1, Operand(a0)); |
| 961 __ Drop(1); // Switch value is no longer needed. | 961 __ Drop(1); // Switch value is no longer needed. |
| 962 __ Branch(clause->body_target()); | 962 __ Branch(clause->body_target()); |
| 963 | 963 |
| 964 __ bind(&slow_case); | 964 __ bind(&slow_case); |
| 965 } | 965 } |
| 966 | 966 |
| 967 // Record position before stub call for type feedback. | 967 // Record position before stub call for type feedback. |
| 968 SetExpressionPosition(clause); | 968 SetExpressionPosition(clause); |
| 969 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 969 Handle<Code> ic = |
| 970 strength(language_mode())).code(); | 970 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); |
| 971 CallIC(ic, clause->CompareId()); | 971 CallIC(ic, clause->CompareId()); |
| 972 patch_site.EmitPatchInfo(); | 972 patch_site.EmitPatchInfo(); |
| 973 | 973 |
| 974 Label skip; | 974 Label skip; |
| 975 __ Branch(&skip); | 975 __ Branch(&skip); |
| 976 PrepareForBailout(clause, TOS_REG); | 976 PrepareForBailout(clause, TOS_REG); |
| 977 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 977 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
| 978 __ Branch(&next_test, ne, v0, Operand(at)); | 978 __ Branch(&next_test, ne, v0, Operand(at)); |
| 979 __ Drop(1); | 979 __ Drop(1); |
| 980 __ Branch(clause->body_target()); | 980 __ Branch(clause->body_target()); |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 __ pop(left); | 2149 __ pop(left); |
| 2150 __ mov(a0, result_register()); | 2150 __ mov(a0, result_register()); |
| 2151 | 2151 |
| 2152 // Perform combined smi check on both operands. | 2152 // Perform combined smi check on both operands. |
| 2153 __ Or(scratch1, left, Operand(right)); | 2153 __ Or(scratch1, left, Operand(right)); |
| 2154 STATIC_ASSERT(kSmiTag == 0); | 2154 STATIC_ASSERT(kSmiTag == 0); |
| 2155 JumpPatchSite patch_site(masm_); | 2155 JumpPatchSite patch_site(masm_); |
| 2156 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2156 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
| 2157 | 2157 |
| 2158 __ bind(&stub_call); | 2158 __ bind(&stub_call); |
| 2159 Handle<Code> code = | 2159 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 2160 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
| 2161 CallIC(code, expr->BinaryOperationFeedbackId()); | 2160 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2162 patch_site.EmitPatchInfo(); | 2161 patch_site.EmitPatchInfo(); |
| 2163 __ jmp(&done); | 2162 __ jmp(&done); |
| 2164 | 2163 |
| 2165 __ bind(&smi_case); | 2164 __ bind(&smi_case); |
| 2166 // Smi case. This code works the same way as the smi-smi case in the type | 2165 // Smi case. This code works the same way as the smi-smi case in the type |
| 2167 // recording binary operation stub, see | 2166 // recording binary operation stub, see |
| 2168 switch (op) { | 2167 switch (op) { |
| 2169 case Token::SAR: | 2168 case Token::SAR: |
| 2170 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2169 __ GetLeastBitsFromSmi(scratch1, right, 5); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 default: | 2277 default: |
| 2279 UNREACHABLE(); | 2278 UNREACHABLE(); |
| 2280 } | 2279 } |
| 2281 } | 2280 } |
| 2282 } | 2281 } |
| 2283 | 2282 |
| 2284 | 2283 |
| 2285 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2284 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2286 __ mov(a0, result_register()); | 2285 __ mov(a0, result_register()); |
| 2287 __ pop(a1); | 2286 __ pop(a1); |
| 2288 Handle<Code> code = | 2287 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 2289 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
| 2290 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2288 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2291 CallIC(code, expr->BinaryOperationFeedbackId()); | 2289 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 2292 patch_site.EmitPatchInfo(); | 2290 patch_site.EmitPatchInfo(); |
| 2293 context()->Plug(v0); | 2291 context()->Plug(v0); |
| 2294 } | 2292 } |
| 2295 | 2293 |
| 2296 | 2294 |
| 2297 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2295 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2298 FeedbackVectorSlot slot) { | 2296 FeedbackVectorSlot slot) { |
| 2299 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2297 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
| (...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4116 } | 4114 } |
| 4117 } | 4115 } |
| 4118 } | 4116 } |
| 4119 | 4117 |
| 4120 __ bind(&stub_call); | 4118 __ bind(&stub_call); |
| 4121 __ mov(a1, v0); | 4119 __ mov(a1, v0); |
| 4122 __ li(a0, Operand(Smi::FromInt(count_value))); | 4120 __ li(a0, Operand(Smi::FromInt(count_value))); |
| 4123 | 4121 |
| 4124 SetExpressionPosition(expr); | 4122 SetExpressionPosition(expr); |
| 4125 | 4123 |
| 4126 | 4124 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); |
| 4127 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, | |
| 4128 strength(language_mode())).code(); | |
| 4129 CallIC(code, expr->CountBinOpFeedbackId()); | 4125 CallIC(code, expr->CountBinOpFeedbackId()); |
| 4130 patch_site.EmitPatchInfo(); | 4126 patch_site.EmitPatchInfo(); |
| 4131 __ bind(&done); | 4127 __ bind(&done); |
| 4132 | 4128 |
| 4133 if (is_strong(language_mode())) { | 4129 if (is_strong(language_mode())) { |
| 4134 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 4130 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 4135 } | 4131 } |
| 4136 // Store the value returned in v0. | 4132 // Store the value returned in v0. |
| 4137 switch (assign_type) { | 4133 switch (assign_type) { |
| 4138 case VARIABLE: | 4134 case VARIABLE: |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4346 bool inline_smi_code = ShouldInlineSmiCase(op); | 4342 bool inline_smi_code = ShouldInlineSmiCase(op); |
| 4347 JumpPatchSite patch_site(masm_); | 4343 JumpPatchSite patch_site(masm_); |
| 4348 if (inline_smi_code) { | 4344 if (inline_smi_code) { |
| 4349 Label slow_case; | 4345 Label slow_case; |
| 4350 __ Or(a2, a0, Operand(a1)); | 4346 __ Or(a2, a0, Operand(a1)); |
| 4351 patch_site.EmitJumpIfNotSmi(a2, &slow_case); | 4347 patch_site.EmitJumpIfNotSmi(a2, &slow_case); |
| 4352 Split(cc, a1, Operand(a0), if_true, if_false, NULL); | 4348 Split(cc, a1, Operand(a0), if_true, if_false, NULL); |
| 4353 __ bind(&slow_case); | 4349 __ bind(&slow_case); |
| 4354 } | 4350 } |
| 4355 | 4351 |
| 4356 Handle<Code> ic = CodeFactory::CompareIC( | 4352 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
| 4357 isolate(), op, strength(language_mode())).code(); | |
| 4358 CallIC(ic, expr->CompareOperationFeedbackId()); | 4353 CallIC(ic, expr->CompareOperationFeedbackId()); |
| 4359 patch_site.EmitPatchInfo(); | 4354 patch_site.EmitPatchInfo(); |
| 4360 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4355 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4361 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); | 4356 Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); |
| 4362 } | 4357 } |
| 4363 } | 4358 } |
| 4364 | 4359 |
| 4365 // Convert the result of the comparison into one expected for this | 4360 // Convert the result of the comparison into one expected for this |
| 4366 // expression's context. | 4361 // expression's context. |
| 4367 context()->Plug(if_true, if_false); | 4362 context()->Plug(if_true, if_false); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4597 reinterpret_cast<uint64_t>( | 4592 reinterpret_cast<uint64_t>( |
| 4598 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4593 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4599 return OSR_AFTER_STACK_CHECK; | 4594 return OSR_AFTER_STACK_CHECK; |
| 4600 } | 4595 } |
| 4601 | 4596 |
| 4602 | 4597 |
| 4603 } // namespace internal | 4598 } // namespace internal |
| 4604 } // namespace v8 | 4599 } // namespace v8 |
| 4605 | 4600 |
| 4606 #endif // V8_TARGET_ARCH_MIPS64 | 4601 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |