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

Side by Side Diff: runtime/vm/assembler_x64.cc

Issue 10915256: FIx crash in disassembler: check that an addrs is tagged before testing it to be part of the heap. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/disassembler_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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 } 1524 }
1525 addq(RSP, Immediate(stack_elements * kWordSize)); 1525 addq(RSP, Immediate(stack_elements * kWordSize));
1526 } 1526 }
1527 1527
1528 1528
1529 void Assembler::LoadObject(Register dst, const Object& object) { 1529 void Assembler::LoadObject(Register dst, const Object& object) {
1530 if (object.IsSmi() || object.IsNull()) { 1530 if (object.IsSmi() || object.IsNull()) {
1531 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); 1531 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
1532 } else { 1532 } else {
1533 ASSERT(object.IsZoneHandle()); 1533 ASSERT(object.IsZoneHandle());
1534 ASSERT(object.IsOld());
1534 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 1535 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1535 EmitRegisterREX(dst, REX_W); 1536 EmitRegisterREX(dst, REX_W);
1536 EmitUint8(0xB8 | (dst & 7)); 1537 EmitUint8(0xB8 | (dst & 7));
1537 buffer_.EmitObject(object); 1538 buffer_.EmitObject(object);
1538 } 1539 }
1539 } 1540 }
1540 1541
1541 1542
1542 void Assembler::StoreObject(const Address& dst, const Object& object) { 1543 void Assembler::StoreObject(const Address& dst, const Object& object) {
1543 if (object.IsSmi() || object.IsNull()) { 1544 if (object.IsSmi() || object.IsNull()) {
1544 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); 1545 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
1545 } else { 1546 } else {
1547 ASSERT(object.IsZoneHandle());
1546 ASSERT(object.IsOld()); 1548 ASSERT(object.IsOld());
1547 LoadObject(TMP, object); 1549 LoadObject(TMP, object);
1548 movq(dst, TMP); 1550 movq(dst, TMP);
1549 } 1551 }
1550 } 1552 }
1551 1553
1552 1554
1553 void Assembler::PushObject(const Object& object) { 1555 void Assembler::PushObject(const Object& object) {
1554 if (object.IsSmi() || object.IsNull()) { 1556 if (object.IsSmi() || object.IsNull()) {
1555 pushq(Immediate(reinterpret_cast<int64_t>(object.raw()))); 1557 pushq(Immediate(reinterpret_cast<int64_t>(object.raw())));
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 1987
1986 const char* Assembler::XmmRegisterName(XmmRegister reg) { 1988 const char* Assembler::XmmRegisterName(XmmRegister reg) {
1987 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 1989 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
1988 return xmm_reg_names[reg]; 1990 return xmm_reg_names[reg];
1989 } 1991 }
1990 1992
1991 1993
1992 } // namespace dart 1994 } // namespace dart
1993 1995
1994 #endif // defined TARGET_ARCH_X64 1996 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698