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

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

Issue 23514048: Fix leftover usage of OS::Allocate(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 USE(result); 157 USE(result);
158 return FUNCTION_CAST<UnaryMathFunction>(buffer); 158 return FUNCTION_CAST<UnaryMathFunction>(buffer);
159 } 159 }
160 160
161 161
162 #ifdef _WIN64 162 #ifdef _WIN64
163 typedef double (*ModuloFunction)(double, double); 163 typedef double (*ModuloFunction)(double, double);
164 // Define custom fmod implementation. 164 // Define custom fmod implementation.
165 ModuloFunction CreateModuloFunction() { 165 ModuloFunction CreateModuloFunction() {
166 size_t actual_size; 166 size_t actual_size;
167 byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize, 167 byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
168 &actual_size, 168 Assembler::kMinimalBufferSize,
169 true)); 169 &actual_size,
170 VirtualMemory::EXECUTABLE));
170 CHECK(buffer); 171 CHECK(buffer);
171 Assembler masm(NULL, buffer, static_cast<int>(actual_size)); 172 Assembler masm(NULL, buffer, static_cast<int>(actual_size));
172 // Generated code is put into a fixed, unmovable, buffer, and not into 173 // Generated code is put into a fixed, unmovable, buffer, and not into
173 // the V8 heap. We can't, and don't, refer to any relocatable addresses 174 // the V8 heap. We can't, and don't, refer to any relocatable addresses
174 // (e.g. the JavaScript nan-object). 175 // (e.g. the JavaScript nan-object).
175 176
176 // Windows 64 ABI passes double arguments in xmm0, xmm1 and 177 // Windows 64 ABI passes double arguments in xmm0, xmm1 and
177 // returns result in xmm0. 178 // returns result in xmm0.
178 // Argument backing space is allocated on the stack above 179 // Argument backing space is allocated on the stack above
179 // the return address. 180 // the return address.
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize. 770 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize.
770 return Operand(base_reg_, argument_count_reg_, times_pointer_size, 771 return Operand(base_reg_, argument_count_reg_, times_pointer_size,
771 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); 772 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize);
772 } 773 }
773 } 774 }
774 775
775 776
776 } } // namespace v8::internal 777 } } // namespace v8::internal
777 778
778 #endif // V8_TARGET_ARCH_X64 779 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698