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

Side by Side Diff: src/x64/assembler-x64.cc

Issue 113631: Implement constructor and destructor of 64-bit assembler (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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
« src/ia32/assembler-ia32.cc ('K') | « src/x64/assembler-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* a) { 72 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* a) {
73 UNIMPLEMENTED(); 73 UNIMPLEMENTED();
74 } 74 }
75 75
76 void ArgumentsAccessStub::GenerateReadLength(MacroAssembler* a) { 76 void ArgumentsAccessStub::GenerateReadLength(MacroAssembler* a) {
77 UNIMPLEMENTED(); 77 UNIMPLEMENTED();
78 } 78 }
79 79
80 Assembler::Assembler(void* a, int b) { 80 // -----------------------------------------------------------------------------
81 UNIMPLEMENTED(); 81 // Implementation of Assembler
82
83 byte* Assembler::spare_buffer_ = NULL;
84
85 Assembler::Assembler(void* buffer, int buffer_size) {
86 if (buffer == NULL) {
87 // do our own buffer management
88 if (buffer_size <= kMinimalBufferSize) {
89 buffer_size = kMinimalBufferSize;
90
91 if (spare_buffer_ != NULL) {
92 buffer = spare_buffer_;
93 spare_buffer_ = NULL;
94 }
95 }
96 if (buffer == NULL) {
97 buffer_ = NewArray<byte>(buffer_size);
98 } else {
99 buffer_ = static_cast<byte*>(buffer);
100 }
101 buffer_size_ = buffer_size;
102 own_buffer_ = true;
103 } else {
104 // use externally provided buffer instead
105 ASSERT(buffer_size > 0);
106 buffer_ = static_cast<byte*>(buffer);
107 buffer_size_ = buffer_size;
108 own_buffer_ = false;
109 }
110
111 // Clear the buffer in debug mode unless it was provided by the
112 // caller in which case we can't be sure it's okay to overwrite
113 // existing code in it; see CodePatcher::CodePatcher(...).
114 #ifdef DEBUG
115 if (own_buffer_) {
116 memset(buffer_, 0xCC, buffer_size); // int3
117 }
118 #endif
119
120 // setup buffer pointers
121 ASSERT(buffer_ != NULL);
122 pc_ = buffer_;
123 reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
124
125 last_pc_ = NULL;
126 current_statement_position_ = RelocInfo::kNoPosition;
127 current_position_ = RelocInfo::kNoPosition;
128 written_statement_position_ = current_statement_position_;
129 written_position_ = current_position_;
130 #ifdef GENERATED_CODE_COVERAGE
131 InitCoverageLog();
132 #endif
82 } 133 }
83 134
84 void Assembler::GetCode(CodeDesc* a) { 135
85 UNIMPLEMENTED(); 136 Assembler::~Assembler() {
137 if (own_buffer_) {
138 if (spare_buffer_ == NULL && buffer_size_ == kMinimalBufferSize) {
139 spare_buffer_ = buffer_;
140 } else {
141 DeleteArray(buffer_);
142 }
143 }
86 } 144 }
87 145
146
147 void Assembler::GetCode(CodeDesc* desc) {
148 // finalize code
149 // (at this point overflow() may be true, but the gap ensures that
150 // we are still not overlapping instructions and relocation info)
151 ASSERT(pc_ <= reloc_info_writer.pos()); // no overlap
152 // setup desc
153 desc->buffer = buffer_;
154 desc->buffer_size = buffer_size_;
155 desc->instr_size = pc_offset();
156 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
157 desc->origin = this;
158
159 Counters::reloc_info_size.Increment(desc->reloc_size);
160 }
161
162
163 void Assembler::Align(int m) {
164 ASSERT(IsPowerOf2(m));
165 while ((pc_offset() & (m - 1)) != 0) {
166 nop();
167 }
168 }
169
170
88 void Assembler::RecordComment(char const* a) { 171 void Assembler::RecordComment(char const* a) {
89 UNIMPLEMENTED(); 172 UNIMPLEMENTED();
90 } 173 }
91 174
92 void Assembler::RecordPosition(int a) { 175 void Assembler::RecordPosition(int a) {
93 UNIMPLEMENTED(); 176 UNIMPLEMENTED();
94 } 177 }
95 178
96 void Assembler::RecordStatementPosition(int a) { 179 void Assembler::RecordStatementPosition(int a) {
97 UNIMPLEMENTED(); 180 UNIMPLEMENTED();
98 } 181 }
99 182
100 void Assembler::bind(Label* a) { 183 void Assembler::bind(Label* a) {
101 UNIMPLEMENTED(); 184 UNIMPLEMENTED();
102 } 185 }
103 186
104 Assembler::~Assembler() {
105 UNIMPLEMENTED();
106 }
107
108 187
109 void Assembler::nop() { 188 void Assembler::nop() {
110 UNIMPLEMENTED(); 189 UNIMPLEMENTED();
111 } 190 }
112 191
113 192
114 void BreakLocationIterator::ClearDebugBreakAtReturn() { 193 void BreakLocationIterator::ClearDebugBreakAtReturn() {
115 UNIMPLEMENTED(); 194 UNIMPLEMENTED();
116 } 195 }
117 196
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 UNIMPLEMENTED(); 855 UNIMPLEMENTED();
777 return NULL; 856 return NULL;
778 } 857 }
779 858
780 byte* JavaScriptFrame::GetCallerStackPointer() const { 859 byte* JavaScriptFrame::GetCallerStackPointer() const {
781 UNIMPLEMENTED(); 860 UNIMPLEMENTED();
782 return NULL; 861 return NULL;
783 } 862 }
784 863
785 } } // namespace v8::internal 864 } } // namespace v8::internal
OLDNEW
« src/ia32/assembler-ia32.cc ('K') | « src/x64/assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698