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

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

Issue 306473004: Reland 21502 - "Move OS::MemCopy and OS::MemMove out of platform to utils" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « src/ia32/assembler-ia32.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('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 "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "codegen.h" 9 #include "codegen.h"
10 #include "heap.h" 10 #include "heap.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 public: 179 public:
180 explicit LabelConverter(byte* buffer) : buffer_(buffer) {} 180 explicit LabelConverter(byte* buffer) : buffer_(buffer) {}
181 int32_t address(Label* l) const { 181 int32_t address(Label* l) const {
182 return reinterpret_cast<int32_t>(buffer_) + l->pos(); 182 return reinterpret_cast<int32_t>(buffer_) + l->pos();
183 } 183 }
184 private: 184 private:
185 byte* buffer_; 185 byte* buffer_;
186 }; 186 };
187 187
188 188
189 OS::MemMoveFunction CreateMemMoveFunction() { 189 MemMoveFunction CreateMemMoveFunction() {
190 size_t actual_size; 190 size_t actual_size;
191 // Allocate buffer in executable space. 191 // Allocate buffer in executable space.
192 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); 192 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
193 if (buffer == NULL) return NULL; 193 if (buffer == NULL) return NULL;
194 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 194 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
195 LabelConverter conv(buffer); 195 LabelConverter conv(buffer);
196 196
197 // Generated code is put into a fixed, unmovable buffer, and not into 197 // Generated code is put into a fixed, unmovable buffer, and not into
198 // the V8 heap. We can't, and don't, refer to any relocatable addresses 198 // the V8 heap. We can't, and don't, refer to any relocatable addresses
199 // (e.g. the JavaScript nan-object). 199 // (e.g. the JavaScript nan-object).
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 __ bind(&pop_and_return); 501 __ bind(&pop_and_return);
502 MemMoveEmitPopAndReturn(&masm); 502 MemMoveEmitPopAndReturn(&masm);
503 503
504 CodeDesc desc; 504 CodeDesc desc;
505 masm.GetCode(&desc); 505 masm.GetCode(&desc);
506 ASSERT(!RelocInfo::RequiresRelocation(desc)); 506 ASSERT(!RelocInfo::RequiresRelocation(desc));
507 CPU::FlushICache(buffer, actual_size); 507 CPU::FlushICache(buffer, actual_size);
508 OS::ProtectCode(buffer, actual_size); 508 OS::ProtectCode(buffer, actual_size);
509 // TODO(jkummerow): It would be nice to register this code creation event 509 // TODO(jkummerow): It would be nice to register this code creation event
510 // with the PROFILE / GDBJIT system. 510 // with the PROFILE / GDBJIT system.
511 return FUNCTION_CAST<OS::MemMoveFunction>(buffer); 511 return FUNCTION_CAST<MemMoveFunction>(buffer);
512 } 512 }
513 513
514 514
515 #undef __ 515 #undef __
516 516
517 // ------------------------------------------------------------------------- 517 // -------------------------------------------------------------------------
518 // Code generators 518 // Code generators
519 519
520 #define __ ACCESS_MASM(masm) 520 #define __ ACCESS_MASM(masm)
521 521
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 Code* stub = GetCodeAgeStub(isolate, age, parity); 1010 Code* stub = GetCodeAgeStub(isolate, age, parity);
1011 CodePatcher patcher(sequence, young_length); 1011 CodePatcher patcher(sequence, young_length);
1012 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); 1012 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32);
1013 } 1013 }
1014 } 1014 }
1015 1015
1016 1016
1017 } } // namespace v8::internal 1017 } } // namespace v8::internal
1018 1018
1019 #endif // V8_TARGET_ARCH_IA32 1019 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698