| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 21 matching lines...) Expand all Loading... |
| 32 #include "codegen.h" | 32 #include "codegen.h" |
| 33 #include "macro-assembler.h" | 33 #include "macro-assembler.h" |
| 34 #include "simulator-arm.h" | 34 #include "simulator-arm.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 | 39 |
| 40 UnaryMathFunction CreateTranscendentalFunction(TranscendentalCache::Type type) { | 40 UnaryMathFunction CreateTranscendentalFunction(TranscendentalCache::Type type) { |
| 41 switch (type) { | 41 switch (type) { |
| 42 case TranscendentalCache::SIN: return &sin; | |
| 43 case TranscendentalCache::COS: return &cos; | |
| 44 case TranscendentalCache::TAN: return &tan; | |
| 45 case TranscendentalCache::LOG: return &log; | 42 case TranscendentalCache::LOG: return &log; |
| 46 default: UNIMPLEMENTED(); | 43 default: UNIMPLEMENTED(); |
| 47 } | 44 } |
| 48 return NULL; | 45 return NULL; |
| 49 } | 46 } |
| 50 | 47 |
| 51 | 48 |
| 52 #define __ masm. | 49 #define __ masm. |
| 53 | 50 |
| 54 | 51 |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 __ b(&done); | 826 __ b(&done); |
| 830 | 827 |
| 831 __ bind(&infinity); | 828 __ bind(&infinity); |
| 832 __ vldr(result, ExpConstant(2, temp3)); | 829 __ vldr(result, ExpConstant(2, temp3)); |
| 833 | 830 |
| 834 __ bind(&done); | 831 __ bind(&done); |
| 835 } | 832 } |
| 836 | 833 |
| 837 #undef __ | 834 #undef __ |
| 838 | 835 |
| 836 #ifdef DEBUG |
| 839 // add(r0, pc, Operand(-8)) | 837 // add(r0, pc, Operand(-8)) |
| 840 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; | 838 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; |
| 839 #endif |
| 841 | 840 |
| 842 static byte* GetNoCodeAgeSequence(uint32_t* length) { | 841 static byte* GetNoCodeAgeSequence(uint32_t* length) { |
| 843 // The sequence of instructions that is patched out for aging code is the | 842 // The sequence of instructions that is patched out for aging code is the |
| 844 // following boilerplate stack-building prologue that is found in FUNCTIONS | 843 // following boilerplate stack-building prologue that is found in FUNCTIONS |
| 845 static bool initialized = false; | 844 static bool initialized = false; |
| 846 static uint32_t sequence[kNoCodeAgeSequenceLength]; | 845 static uint32_t sequence[kNoCodeAgeSequenceLength]; |
| 847 byte* byte_sequence = reinterpret_cast<byte*>(sequence); | 846 byte* byte_sequence = reinterpret_cast<byte*>(sequence); |
| 848 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; | 847 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; |
| 849 if (!initialized) { | 848 if (!initialized) { |
| 850 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); | 849 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 patcher.masm()->add(r0, pc, Operand(-8)); | 897 patcher.masm()->add(r0, pc, Operand(-8)); |
| 899 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 898 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 900 patcher.masm()->emit_code_stub_address(stub); | 899 patcher.masm()->emit_code_stub_address(stub); |
| 901 } | 900 } |
| 902 } | 901 } |
| 903 | 902 |
| 904 | 903 |
| 905 } } // namespace v8::internal | 904 } } // namespace v8::internal |
| 906 | 905 |
| 907 #endif // V8_TARGET_ARCH_ARM | 906 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |