| OLD | NEW |
| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 | 265 |
| 266 Operand::Operand(const ExternalReference& f) | 266 Operand::Operand(const ExternalReference& f) |
| 267 : immediate_(reinterpret_cast<intptr_t>(f.address())), | 267 : immediate_(reinterpret_cast<intptr_t>(f.address())), |
| 268 reg_(NoReg), | 268 reg_(NoReg), |
| 269 rmode_(RelocInfo::EXTERNAL_REFERENCE) {} | 269 rmode_(RelocInfo::EXTERNAL_REFERENCE) {} |
| 270 | 270 |
| 271 | 271 |
| 272 Operand::Operand(Handle<Object> handle) : reg_(NoReg) { | 272 Operand::Operand(Handle<Object> handle) : reg_(NoReg) { |
| 273 #ifdef DEBUG | |
| 274 Isolate* isolate = Isolate::Current(); | |
| 275 #endif | |
| 276 AllowDeferredHandleDereference using_raw_address; | 273 AllowDeferredHandleDereference using_raw_address; |
| 277 | 274 |
| 278 // Verify all Objects referred by code are NOT in new space. | 275 // Verify all Objects referred by code are NOT in new space. |
| 279 Object* obj = *handle; | 276 Object* obj = *handle; |
| 280 ASSERT(!isolate->heap()->InNewSpace(obj)); | |
| 281 if (obj->IsHeapObject()) { | 277 if (obj->IsHeapObject()) { |
| 278 ASSERT(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj)); |
| 282 immediate_ = reinterpret_cast<intptr_t>(handle.location()); | 279 immediate_ = reinterpret_cast<intptr_t>(handle.location()); |
| 283 rmode_ = RelocInfo::EMBEDDED_OBJECT; | 280 rmode_ = RelocInfo::EMBEDDED_OBJECT; |
| 284 } else { | 281 } else { |
| 285 STATIC_ASSERT(sizeof(intptr_t) == sizeof(int64_t)); | 282 STATIC_ASSERT(sizeof(intptr_t) == sizeof(int64_t)); |
| 286 immediate_ = reinterpret_cast<intptr_t>(obj); | 283 immediate_ = reinterpret_cast<intptr_t>(obj); |
| 287 rmode_ = RelocInfo::NONE64; | 284 rmode_ = RelocInfo::NONE64; |
| 288 } | 285 } |
| 289 } | 286 } |
| 290 | 287 |
| 291 | 288 |
| (...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 // code. | 2513 // code. |
| 2517 #ifdef ENABLE_DEBUGGER_SUPPORT | 2514 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 2518 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); | 2515 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); |
| 2519 #endif | 2516 #endif |
| 2520 } | 2517 } |
| 2521 | 2518 |
| 2522 | 2519 |
| 2523 } } // namespace v8::internal | 2520 } } // namespace v8::internal |
| 2524 | 2521 |
| 2525 #endif // V8_TARGET_ARCH_A64 | 2522 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |