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

Side by Side Diff: src/a64/assembler-a64.cc

Issue 170403003: templatize operand constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/a64/assembler-a64.h ('k') | src/a64/assembler-a64-inl.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 match &= !reg3.IsValid() || reg3.IsSameSizeAndType(reg1); 240 match &= !reg3.IsValid() || reg3.IsSameSizeAndType(reg1);
241 match &= !reg4.IsValid() || reg4.IsSameSizeAndType(reg1); 241 match &= !reg4.IsValid() || reg4.IsSameSizeAndType(reg1);
242 match &= !reg5.IsValid() || reg5.IsSameSizeAndType(reg1); 242 match &= !reg5.IsValid() || reg5.IsSameSizeAndType(reg1);
243 match &= !reg6.IsValid() || reg6.IsSameSizeAndType(reg1); 243 match &= !reg6.IsValid() || reg6.IsSameSizeAndType(reg1);
244 match &= !reg7.IsValid() || reg7.IsSameSizeAndType(reg1); 244 match &= !reg7.IsValid() || reg7.IsSameSizeAndType(reg1);
245 match &= !reg8.IsValid() || reg8.IsSameSizeAndType(reg1); 245 match &= !reg8.IsValid() || reg8.IsSameSizeAndType(reg1);
246 return match; 246 return match;
247 } 247 }
248 248
249 249
250 Operand::Operand(const ExternalReference& f) 250 void Operand::initialize_handle(Handle<Object> handle) {
251 : immediate_(reinterpret_cast<intptr_t>(f.address())),
252 reg_(NoReg),
253 rmode_(RelocInfo::EXTERNAL_REFERENCE) {}
254
255
256 Operand::Operand(Handle<Object> handle) : reg_(NoReg) {
257 AllowDeferredHandleDereference using_raw_address; 251 AllowDeferredHandleDereference using_raw_address;
258 252
259 // Verify all Objects referred by code are NOT in new space. 253 // Verify all Objects referred by code are NOT in new space.
260 Object* obj = *handle; 254 Object* obj = *handle;
261 if (obj->IsHeapObject()) { 255 if (obj->IsHeapObject()) {
262 ASSERT(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj)); 256 ASSERT(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj));
263 immediate_ = reinterpret_cast<intptr_t>(handle.location()); 257 immediate_ = reinterpret_cast<intptr_t>(handle.location());
264 rmode_ = RelocInfo::EMBEDDED_OBJECT; 258 rmode_ = RelocInfo::EMBEDDED_OBJECT;
265 } else { 259 } else {
266 STATIC_ASSERT(sizeof(intptr_t) == sizeof(int64_t)); 260 STATIC_ASSERT(sizeof(intptr_t) == sizeof(int64_t));
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 // code. 2501 // code.
2508 #ifdef ENABLE_DEBUGGER_SUPPORT 2502 #ifdef ENABLE_DEBUGGER_SUPPORT
2509 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); 2503 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
2510 #endif 2504 #endif
2511 } 2505 }
2512 2506
2513 2507
2514 } } // namespace v8::internal 2508 } } // namespace v8::internal
2515 2509
2516 #endif // V8_TARGET_ARCH_A64 2510 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « src/a64/assembler-a64.h ('k') | src/a64/assembler-a64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698