OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 void BinaryOpStub::GenerateSmiCode( | 2417 void BinaryOpStub::GenerateSmiCode( |
2418 MacroAssembler* masm, | 2418 MacroAssembler* masm, |
2419 Label* use_runtime, | 2419 Label* use_runtime, |
2420 Label* gc_required, | 2420 Label* gc_required, |
2421 SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { | 2421 SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { |
2422 Label not_smis; | 2422 Label not_smis; |
2423 | 2423 |
2424 Register left = r1; | 2424 Register left = r1; |
2425 Register right = r0; | 2425 Register right = r0; |
2426 Register scratch1 = r7; | 2426 Register scratch1 = r7; |
2427 Register scratch2 = r9; | |
2428 | 2427 |
2429 // Perform combined smi check on both operands. | 2428 // Perform combined smi check on both operands. |
2430 __ orr(scratch1, left, Operand(right)); | 2429 __ orr(scratch1, left, Operand(right)); |
2431 STATIC_ASSERT(kSmiTag == 0); | 2430 STATIC_ASSERT(kSmiTag == 0); |
2432 __ JumpIfNotSmi(scratch1, ¬_smis); | 2431 __ JumpIfNotSmi(scratch1, ¬_smis); |
2433 | 2432 |
2434 // If the smi-smi operation results in a smi return is generated. | 2433 // If the smi-smi operation results in a smi return is generated. |
2435 GenerateSmiSmiOperation(masm); | 2434 GenerateSmiSmiOperation(masm); |
2436 | 2435 |
2437 // If heap number results are possible generate the result in an allocated | 2436 // If heap number results are possible generate the result in an allocated |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3103 __ bind(&invalid_cache); | 3102 __ bind(&invalid_cache); |
3104 ExternalReference runtime_function = | 3103 ExternalReference runtime_function = |
3105 ExternalReference(RuntimeFunction(), masm->isolate()); | 3104 ExternalReference(RuntimeFunction(), masm->isolate()); |
3106 __ TailCallExternalReference(runtime_function, 1, 1); | 3105 __ TailCallExternalReference(runtime_function, 1, 1); |
3107 } else { | 3106 } else { |
3108 if (!CpuFeatures::IsSupported(VFP3)) UNREACHABLE(); | 3107 if (!CpuFeatures::IsSupported(VFP3)) UNREACHABLE(); |
3109 CpuFeatures::Scope scope(VFP3); | 3108 CpuFeatures::Scope scope(VFP3); |
3110 | 3109 |
3111 Label no_update; | 3110 Label no_update; |
3112 Label skip_cache; | 3111 Label skip_cache; |
3113 const Register heap_number_map = r5; | |
3114 | 3112 |
3115 // Call C function to calculate the result and update the cache. | 3113 // Call C function to calculate the result and update the cache. |
3116 // Register r0 holds precalculated cache entry address; preserve | 3114 // Register r0 holds precalculated cache entry address; preserve |
3117 // it on the stack and pop it into register cache_entry after the | 3115 // it on the stack and pop it into register cache_entry after the |
3118 // call. | 3116 // call. |
3119 __ push(cache_entry); | 3117 __ push(cache_entry); |
3120 GenerateCallCFunction(masm, scratch0); | 3118 GenerateCallCFunction(masm, scratch0); |
3121 __ GetCFunctionDoubleResult(d2); | 3119 __ GetCFunctionDoubleResult(d2); |
3122 | 3120 |
3123 // Try to update the cache. If we cannot allocate a | 3121 // Try to update the cache. If we cannot allocate a |
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6567 __ mov(result, Operand(0)); | 6565 __ mov(result, Operand(0)); |
6568 __ Ret(); | 6566 __ Ret(); |
6569 } | 6567 } |
6570 | 6568 |
6571 | 6569 |
6572 #undef __ | 6570 #undef __ |
6573 | 6571 |
6574 } } // namespace v8::internal | 6572 } } // namespace v8::internal |
6575 | 6573 |
6576 #endif // V8_TARGET_ARCH_ARM | 6574 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |