| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 void Assembler::EmitGenericShift(int rm, | 1555 void Assembler::EmitGenericShift(int rm, |
| 1556 Register operand, | 1556 Register operand, |
| 1557 Register shifter) { | 1557 Register shifter) { |
| 1558 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 1558 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 1559 ASSERT(shifter == ECX); | 1559 ASSERT(shifter == ECX); |
| 1560 EmitUint8(0xD3); | 1560 EmitUint8(0xD3); |
| 1561 EmitOperand(rm, Operand(operand)); | 1561 EmitOperand(rm, Operand(operand)); |
| 1562 } | 1562 } |
| 1563 | 1563 |
| 1564 | 1564 |
| 1565 void Assembler::Comment(const char* comment) { | 1565 void Assembler::Comment(const char* format, ...) { |
| 1566 if (FLAG_code_comments) { | 1566 if (FLAG_code_comments) { |
| 1567 char buffer[1024]; |
| 1568 |
| 1569 va_list args; |
| 1570 va_start(args, format); |
| 1571 OS::VSNPrint(buffer, sizeof(buffer), format, args); |
| 1572 va_end(args); |
| 1573 |
| 1567 comments_.Add(new CodeComment(buffer_.GetPosition(), | 1574 comments_.Add(new CodeComment(buffer_.GetPosition(), |
| 1568 String::Handle(String::New(comment)))); | 1575 String::Handle(String::New(buffer)))); |
| 1569 } | 1576 } |
| 1570 } | 1577 } |
| 1571 | 1578 |
| 1572 | 1579 |
| 1573 const Code::Comments& Assembler::GetCodeComments() const { | 1580 const Code::Comments& Assembler::GetCodeComments() const { |
| 1574 Code::Comments& comments = Code::Comments::New(comments_.length()); | 1581 Code::Comments& comments = Code::Comments::New(comments_.length()); |
| 1575 | 1582 |
| 1576 for (intptr_t i = 0; i < comments_.length(); i++) { | 1583 for (intptr_t i = 0; i < comments_.length(); i++) { |
| 1577 comments.SetPCOffsetAt(i, comments_[i]->pc_offset()); | 1584 comments.SetPCOffsetAt(i, comments_[i]->pc_offset()); |
| 1578 comments.SetCommentAt(i, comments_[i]->comment()); | 1585 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1579 } | 1586 } |
| 1580 | 1587 |
| 1581 return comments; | 1588 return comments; |
| 1582 } | 1589 } |
| 1583 | 1590 |
| 1584 | 1591 |
| 1585 } // namespace dart | 1592 } // namespace dart |
| 1586 | 1593 |
| 1587 #endif // defined TARGET_ARCH_IA32 | 1594 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |