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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 | 962 |
963 __ cmp(r1, r0); | 963 __ cmp(r1, r0); |
964 __ b(ne, &next_test); | 964 __ b(ne, &next_test); |
965 __ Drop(1); // Switch value is no longer needed. | 965 __ Drop(1); // Switch value is no longer needed. |
966 __ b(clause->body_target()); | 966 __ b(clause->body_target()); |
967 __ bind(&slow_case); | 967 __ bind(&slow_case); |
968 } | 968 } |
969 | 969 |
970 // Record position before stub call for type feedback. | 970 // Record position before stub call for type feedback. |
971 SetExpressionPosition(clause); | 971 SetExpressionPosition(clause); |
972 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT, | 972 Handle<Code> ic = |
973 strength(language_mode())).code(); | 973 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); |
974 CallIC(ic, clause->CompareId()); | 974 CallIC(ic, clause->CompareId()); |
975 patch_site.EmitPatchInfo(); | 975 patch_site.EmitPatchInfo(); |
976 | 976 |
977 Label skip; | 977 Label skip; |
978 __ b(&skip); | 978 __ b(&skip); |
979 PrepareForBailout(clause, TOS_REG); | 979 PrepareForBailout(clause, TOS_REG); |
980 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 980 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
981 __ cmp(r0, ip); | 981 __ cmp(r0, ip); |
982 __ b(ne, &next_test); | 982 __ b(ne, &next_test); |
983 __ Drop(1); | 983 __ Drop(1); |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 Register right = r0; | 2154 Register right = r0; |
2155 __ pop(left); | 2155 __ pop(left); |
2156 | 2156 |
2157 // Perform combined smi check on both operands. | 2157 // Perform combined smi check on both operands. |
2158 __ orr(scratch1, left, Operand(right)); | 2158 __ orr(scratch1, left, Operand(right)); |
2159 STATIC_ASSERT(kSmiTag == 0); | 2159 STATIC_ASSERT(kSmiTag == 0); |
2160 JumpPatchSite patch_site(masm_); | 2160 JumpPatchSite patch_site(masm_); |
2161 patch_site.EmitJumpIfSmi(scratch1, &smi_case); | 2161 patch_site.EmitJumpIfSmi(scratch1, &smi_case); |
2162 | 2162 |
2163 __ bind(&stub_call); | 2163 __ bind(&stub_call); |
2164 Handle<Code> code = | 2164 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2165 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
2166 CallIC(code, expr->BinaryOperationFeedbackId()); | 2165 CallIC(code, expr->BinaryOperationFeedbackId()); |
2167 patch_site.EmitPatchInfo(); | 2166 patch_site.EmitPatchInfo(); |
2168 __ jmp(&done); | 2167 __ jmp(&done); |
2169 | 2168 |
2170 __ bind(&smi_case); | 2169 __ bind(&smi_case); |
2171 // Smi case. This code works the same way as the smi-smi case in the type | 2170 // Smi case. This code works the same way as the smi-smi case in the type |
2172 // recording binary operation stub, see | 2171 // recording binary operation stub, see |
2173 switch (op) { | 2172 switch (op) { |
2174 case Token::SAR: | 2173 case Token::SAR: |
2175 __ GetLeastBitsFromSmi(scratch1, right, 5); | 2174 __ GetLeastBitsFromSmi(scratch1, right, 5); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 | 2284 |
2286 default: | 2285 default: |
2287 UNREACHABLE(); | 2286 UNREACHABLE(); |
2288 } | 2287 } |
2289 } | 2288 } |
2290 } | 2289 } |
2291 | 2290 |
2292 | 2291 |
2293 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2292 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2294 __ pop(r1); | 2293 __ pop(r1); |
2295 Handle<Code> code = | 2294 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2296 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | |
2297 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2295 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2298 CallIC(code, expr->BinaryOperationFeedbackId()); | 2296 CallIC(code, expr->BinaryOperationFeedbackId()); |
2299 patch_site.EmitPatchInfo(); | 2297 patch_site.EmitPatchInfo(); |
2300 context()->Plug(r0); | 2298 context()->Plug(r0); |
2301 } | 2299 } |
2302 | 2300 |
2303 | 2301 |
2304 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2302 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2305 FeedbackVectorSlot slot) { | 2303 FeedbackVectorSlot slot) { |
2306 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2304 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4110 } | 4108 } |
4111 } | 4109 } |
4112 | 4110 |
4113 | 4111 |
4114 __ bind(&stub_call); | 4112 __ bind(&stub_call); |
4115 __ mov(r1, r0); | 4113 __ mov(r1, r0); |
4116 __ mov(r0, Operand(Smi::FromInt(count_value))); | 4114 __ mov(r0, Operand(Smi::FromInt(count_value))); |
4117 | 4115 |
4118 SetExpressionPosition(expr); | 4116 SetExpressionPosition(expr); |
4119 | 4117 |
4120 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD, | 4118 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); |
4121 strength(language_mode())).code(); | |
4122 CallIC(code, expr->CountBinOpFeedbackId()); | 4119 CallIC(code, expr->CountBinOpFeedbackId()); |
4123 patch_site.EmitPatchInfo(); | 4120 patch_site.EmitPatchInfo(); |
4124 __ bind(&done); | 4121 __ bind(&done); |
4125 | 4122 |
4126 if (is_strong(language_mode())) { | 4123 if (is_strong(language_mode())) { |
4127 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 4124 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
4128 } | 4125 } |
4129 // Store the value returned in r0. | 4126 // Store the value returned in r0. |
4130 switch (assign_type) { | 4127 switch (assign_type) { |
4131 case VARIABLE: | 4128 case VARIABLE: |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4336 JumpPatchSite patch_site(masm_); | 4333 JumpPatchSite patch_site(masm_); |
4337 if (inline_smi_code) { | 4334 if (inline_smi_code) { |
4338 Label slow_case; | 4335 Label slow_case; |
4339 __ orr(r2, r0, Operand(r1)); | 4336 __ orr(r2, r0, Operand(r1)); |
4340 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 4337 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
4341 __ cmp(r1, r0); | 4338 __ cmp(r1, r0); |
4342 Split(cond, if_true, if_false, NULL); | 4339 Split(cond, if_true, if_false, NULL); |
4343 __ bind(&slow_case); | 4340 __ bind(&slow_case); |
4344 } | 4341 } |
4345 | 4342 |
4346 Handle<Code> ic = CodeFactory::CompareIC( | 4343 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
4347 isolate(), op, strength(language_mode())).code(); | |
4348 CallIC(ic, expr->CompareOperationFeedbackId()); | 4344 CallIC(ic, expr->CompareOperationFeedbackId()); |
4349 patch_site.EmitPatchInfo(); | 4345 patch_site.EmitPatchInfo(); |
4350 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4346 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4351 __ cmp(r0, Operand::Zero()); | 4347 __ cmp(r0, Operand::Zero()); |
4352 Split(cond, if_true, if_false, fall_through); | 4348 Split(cond, if_true, if_false, fall_through); |
4353 } | 4349 } |
4354 } | 4350 } |
4355 | 4351 |
4356 // Convert the result of the comparison into one expected for this | 4352 // Convert the result of the comparison into one expected for this |
4357 // expression's context. | 4353 // expression's context. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4646 DCHECK(interrupt_address == | 4642 DCHECK(interrupt_address == |
4647 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4643 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4648 return OSR_AFTER_STACK_CHECK; | 4644 return OSR_AFTER_STACK_CHECK; |
4649 } | 4645 } |
4650 | 4646 |
4651 | 4647 |
4652 } // namespace internal | 4648 } // namespace internal |
4653 } // namespace v8 | 4649 } // namespace v8 |
4654 | 4650 |
4655 #endif // V8_TARGET_ARCH_ARM | 4651 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |