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

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

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-mode Arm issue. 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
415 void Assembler::emit(Handle<Object> handle) { 421 void Assembler::emit(Handle<Object> handle) {
416 AllowDeferredHandleDereference heap_object_check; 422 AllowDeferredHandleDereference heap_object_check;
417 // Verify all Objects referred by code are NOT in new space. 423 // Verify all Objects referred by code are NOT in new space.
418 Object* obj = *handle; 424 Object* obj = *handle;
419 DCHECK(!isolate()->heap()->InNewSpace(obj)); 425 DCHECK(!isolate()->heap()->InNewSpace(obj));
420 if (obj->IsHeapObject()) { 426 if (obj->IsHeapObject()) {
421 emit(reinterpret_cast<intptr_t>(handle.location()), 427 emit(reinterpret_cast<intptr_t>(handle.location()),
422 RelocInfo::EMBEDDED_OBJECT); 428 RelocInfo::EMBEDDED_OBJECT);
423 } else { 429 } else {
424 // no relocation needed 430 // no relocation needed
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 475
470 476
471 void Assembler::emit_w(const Immediate& x) { 477 void Assembler::emit_w(const Immediate& x) {
472 DCHECK(RelocInfo::IsNone(x.rmode_)); 478 DCHECK(RelocInfo::IsNone(x.rmode_));
473 uint16_t value = static_cast<uint16_t>(x.x_); 479 uint16_t value = static_cast<uint16_t>(x.x_);
474 reinterpret_cast<uint16_t*>(pc_)[0] = value; 480 reinterpret_cast<uint16_t*>(pc_)[0] = value;
475 pc_ += sizeof(uint16_t); 481 pc_ += sizeof(uint16_t);
476 } 482 }
477 483
478 484
479 Address Assembler::target_address_at(Address pc, 485 Address Assembler::target_address_at(Address pc, Address constant_pool) {
480 ConstantPoolArray* constant_pool) {
481 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc); 486 return pc + sizeof(int32_t) + *reinterpret_cast<int32_t*>(pc);
482 } 487 }
483 488
484 489
485 void Assembler::set_target_address_at(Address pc, 490 void Assembler::set_target_address_at(Address pc, Address constant_pool,
486 ConstantPoolArray* constant_pool,
487 Address target, 491 Address target,
488 ICacheFlushMode icache_flush_mode) { 492 ICacheFlushMode icache_flush_mode) {
489 int32_t* p = reinterpret_cast<int32_t*>(pc); 493 int32_t* p = reinterpret_cast<int32_t*>(pc);
490 *p = target - (pc + sizeof(int32_t)); 494 *p = target - (pc + sizeof(int32_t));
491 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 495 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
492 CpuFeatures::FlushICache(p, sizeof(int32_t)); 496 CpuFeatures::FlushICache(p, sizeof(int32_t));
493 } 497 }
494 } 498 }
495 499
496 500
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 588
585 589
586 Operand::Operand(Immediate imm) { 590 Operand::Operand(Immediate imm) {
587 // [disp/r] 591 // [disp/r]
588 set_modrm(0, ebp); 592 set_modrm(0, ebp);
589 set_dispr(imm.x_, imm.rmode_); 593 set_dispr(imm.x_, imm.rmode_);
590 } 594 }
591 } } // namespace v8::internal 595 } } // namespace v8::internal
592 596
593 #endif // V8_X87_ASSEMBLER_X87_INL_H_ 597 #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