Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/mips64/codegen-mips64.cc

Issue 1480883002: Initialize fast memmove methods in the Isolate's ctor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | src/utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/mips64/codegen-mips64.h" 5 #include "src/mips64/codegen-mips64.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #if !defined(USE_SIMULATOR) 64 #if !defined(USE_SIMULATOR)
65 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); 65 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(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 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub) { 74 MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate,
75 MemCopyUint8Function stub) {
75 #if defined(USE_SIMULATOR) 76 #if defined(USE_SIMULATOR)
76 return stub; 77 return stub;
77 #else 78 #else
78 79
79 size_t actual_size; 80 size_t actual_size;
80 byte* buffer = 81 byte* buffer =
81 static_cast<byte*>(base::OS::Allocate(3 * KB, &actual_size, true)); 82 static_cast<byte*>(base::OS::Allocate(3 * KB, &actual_size, true));
82 if (buffer == NULL) return stub; 83 if (buffer == nullptr) return stub;
83 84
84 // This code assumes that cache lines are 32 bytes and if the cache line is 85 // This code assumes that cache lines are 32 bytes and if the cache line is
85 // larger it will not work correctly. 86 // larger it will not work correctly.
86 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), 87 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size),
87 CodeObjectRequired::kNo); 88 CodeObjectRequired::kNo);
88 89
89 { 90 {
90 Label lastb, unaligned, aligned, chkw, 91 Label lastb, unaligned, aligned, chkw,
91 loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop, 92 loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop,
92 leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw, 93 leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw,
93 ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop; 94 ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop;
94 95
95 // The size of each prefetch. 96 // The size of each prefetch.
96 uint32_t pref_chunk = 32; 97 uint32_t pref_chunk = 32;
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 __ bne(a0, a3, &ua_smallCopy_loop); 592 __ bne(a0, a3, &ua_smallCopy_loop);
592 __ sb(v1, MemOperand(a0, -1)); // In delay slot. 593 __ sb(v1, MemOperand(a0, -1)); // In delay slot.
593 594
594 __ jr(ra); 595 __ jr(ra);
595 __ nop(); 596 __ nop();
596 } 597 }
597 CodeDesc desc; 598 CodeDesc desc;
598 masm.GetCode(&desc); 599 masm.GetCode(&desc);
599 DCHECK(!RelocInfo::RequiresRelocation(desc)); 600 DCHECK(!RelocInfo::RequiresRelocation(desc));
600 601
601 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); 602 Assembler::FlushICache(isolate, buffer, actual_size);
602 base::OS::ProtectCode(buffer, actual_size); 603 base::OS::ProtectCode(buffer, actual_size);
603 return FUNCTION_CAST<MemCopyUint8Function>(buffer); 604 return FUNCTION_CAST<MemCopyUint8Function>(buffer);
604 #endif 605 #endif
605 } 606 }
606 #endif 607 #endif
607 608
608 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { 609 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
609 #if defined(USE_SIMULATOR) 610 #if defined(USE_SIMULATOR)
610 return nullptr; 611 return nullptr;
611 #else 612 #else
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 } 1258 }
1258 } 1259 }
1259 1260
1260 1261
1261 #undef __ 1262 #undef __
1262 1263
1263 } // namespace internal 1264 } // namespace internal
1264 } // namespace v8 1265 } // namespace v8
1265 1266
1266 #endif // V8_TARGET_ARCH_MIPS64 1267 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698