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 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "codegen.h" | 9 #include "codegen.h" |
10 #include "macro-assembler.h" | 10 #include "macro-assembler.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #if !defined(USE_SIMULATOR) | 64 #if !defined(USE_SIMULATOR) |
65 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 65 return FUNCTION_CAST<UnaryMathFunction>(buffer); |
66 #else | 66 #else |
67 fast_exp_mips_machine_code = buffer; | 67 fast_exp_mips_machine_code = buffer; |
68 return &fast_exp_simulator; | 68 return &fast_exp_simulator; |
69 #endif | 69 #endif |
70 } | 70 } |
71 | 71 |
72 | 72 |
73 #if defined(V8_HOST_ARCH_MIPS) | 73 #if defined(V8_HOST_ARCH_MIPS) |
74 OS::MemCopyUint8Function CreateMemCopyUint8Function( | 74 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub) { |
75 OS::MemCopyUint8Function stub) { | |
76 #if defined(USE_SIMULATOR) | 75 #if defined(USE_SIMULATOR) |
77 return stub; | 76 return stub; |
78 #else | 77 #else |
79 size_t actual_size; | 78 size_t actual_size; |
80 byte* buffer = static_cast<byte*>(OS::Allocate(3 * KB, &actual_size, true)); | 79 byte* buffer = static_cast<byte*>(OS::Allocate(3 * KB, &actual_size, true)); |
81 if (buffer == NULL) return stub; | 80 if (buffer == NULL) return stub; |
82 | 81 |
83 // This code assumes that cache lines are 32 bytes and if the cache line is | 82 // This code assumes that cache lines are 32 bytes and if the cache line is |
84 // larger it will not work correctly. | 83 // larger it will not work correctly. |
85 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); | 84 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 589 |
591 __ jr(ra); | 590 __ jr(ra); |
592 __ nop(); | 591 __ nop(); |
593 } | 592 } |
594 CodeDesc desc; | 593 CodeDesc desc; |
595 masm.GetCode(&desc); | 594 masm.GetCode(&desc); |
596 ASSERT(!RelocInfo::RequiresRelocation(desc)); | 595 ASSERT(!RelocInfo::RequiresRelocation(desc)); |
597 | 596 |
598 CPU::FlushICache(buffer, actual_size); | 597 CPU::FlushICache(buffer, actual_size); |
599 OS::ProtectCode(buffer, actual_size); | 598 OS::ProtectCode(buffer, actual_size); |
600 return FUNCTION_CAST<OS::MemCopyUint8Function>(buffer); | 599 return FUNCTION_CAST<MemCopyUint8Function>(buffer); |
601 #endif | 600 #endif |
602 } | 601 } |
603 #endif | 602 #endif |
604 | 603 |
605 UnaryMathFunction CreateSqrtFunction() { | 604 UnaryMathFunction CreateSqrtFunction() { |
606 #if defined(USE_SIMULATOR) | 605 #if defined(USE_SIMULATOR) |
607 return &std::sqrt; | 606 return &std::sqrt; |
608 #else | 607 #else |
609 size_t actual_size; | 608 size_t actual_size; |
610 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); | 609 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 patcher.masm()->nop(); // Pad the empty space. | 1193 patcher.masm()->nop(); // Pad the empty space. |
1195 } | 1194 } |
1196 } | 1195 } |
1197 | 1196 |
1198 | 1197 |
1199 #undef __ | 1198 #undef __ |
1200 | 1199 |
1201 } } // namespace v8::internal | 1200 } } // namespace v8::internal |
1202 | 1201 |
1203 #endif // V8_TARGET_ARCH_MIPS | 1202 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |