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

Side by Side Diff: src/x87/assembler-x87-inl.h

Issue 1155703006: Revert of Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/x87/assembler-x87.cc ('k') | src/x87/deoptimizer-x87.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 rmode_ = RelocInfo::NONE32; 405 rmode_ = RelocInfo::NONE32;
406 } 406 }
407 407
408 408
409 void Assembler::emit(uint32_t x) { 409 void Assembler::emit(uint32_t x) {
410 *reinterpret_cast<uint32_t*>(pc_) = x; 410 *reinterpret_cast<uint32_t*>(pc_) = x;
411 pc_ += sizeof(uint32_t); 411 pc_ += sizeof(uint32_t);
412 } 412 }
413 413
414 414
415 void Assembler::emit_q(uint64_t x) {
416 *reinterpret_cast<uint64_t*>(pc_) = x;
417 pc_ += sizeof(uint64_t);
418 }
419
420
421 void Assembler::emit(Handle<Object> handle) { 415 void Assembler::emit(Handle<Object> handle) {
422 AllowDeferredHandleDereference heap_object_check; 416 AllowDeferredHandleDereference heap_object_check;
423 // Verify all Objects referred by code are NOT in new space. 417 // Verify all Objects referred by code are NOT in new space.
424 Object* obj = *handle; 418 Object* obj = *handle;
425 DCHECK(!isolate()->heap()->InNewSpace(obj)); 419 DCHECK(!isolate()->heap()->InNewSpace(obj));
426 if (obj->IsHeapObject()) { 420 if (obj->IsHeapObject()) {
427 emit(reinterpret_cast<intptr_t>(handle.location()), 421 emit(reinterpret_cast<intptr_t>(handle.location()),
428 RelocInfo::EMBEDDED_OBJECT); 422 RelocInfo::EMBEDDED_OBJECT);
429 } else { 423 } else {
430 // no relocation needed 424 // no relocation needed
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 469
476 470
477 void Assembler::emit_w(const Immediate& x) { 471 void Assembler::emit_w(const Immediate& x) {
478 DCHECK(RelocInfo::IsNone(x.rmode_)); 472 DCHECK(RelocInfo::IsNone(x.rmode_));
479 uint16_t value = static_cast<uint16_t>(x.x_); 473 uint16_t value = static_cast<uint16_t>(x.x_);
480 reinterpret_cast<uint16_t*>(pc_)[0] = value; 474 reinterpret_cast<uint16_t*>(pc_)[0] = value;
481 pc_ += sizeof(uint16_t); 475 pc_ += sizeof(uint16_t);
482 } 476 }
483 477
484 478
485 Address Assembler::target_address_at(Address pc, Address constant_pool) { 479 Address Assembler::target_address_at(Address pc,
480 ConstantPoolArray* constant_pool) {
486 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); 481 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
487 } 482 }
488 483
489 484
490 void Assembler::set_target_address_at(Address pc, Address constant_pool, 485 void Assembler::set_target_address_at(Address pc,
486 ConstantPoolArray* constant_pool,
491 Address target, 487 Address target,
492 ICacheFlushMode icache_flush_mode) { 488 ICacheFlushMode icache_flush_mode) {
493 int32_t* p = reinterpret_cast<int32_t*>(pc); 489 int32_t* p = reinterpret_cast<int32_t*>(pc);
494 *p = target - (pc + sizeof(int32_t)); 490 *p = target - (pc + sizeof(int32_t));
495 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 491 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
496 CpuFeatures::FlushICache(p, sizeof(int32_t)); 492 CpuFeatures::FlushICache(p, sizeof(int32_t));
497 } 493 }
498 } 494 }
499 495
500 496
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 584
589 585
590 Operand::Operand(Immediate imm) { 586 Operand::Operand(Immediate imm) {
591 // [disp/r] 587 // [disp/r]
592 set_modrm(0, ebp); 588 set_modrm(0, ebp);
593 set_dispr(imm.x_, imm.rmode_); 589 set_dispr(imm.x_, imm.rmode_);
594 } 590 }
595 } } // namespace v8::internal 591 } } // namespace v8::internal
596 592
597 #endif // V8_X87_ASSEMBLER_X87_INL_H_ 593 #endif // V8_X87_ASSEMBLER_X87_INL_H_
OLDNEW
« no previous file with comments | « src/x87/assembler-x87.cc ('k') | src/x87/deoptimizer-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698