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

Side by Side Diff: src/lithium-codegen.cc

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/lithium-codegen.h" 7 #include "src/lithium-codegen.h"
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 #include "src/ia32/lithium-ia32.h" // NOLINT 10 #include "src/ia32/lithium-ia32.h" // NOLINT
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 hinstr->Mnemonic(), instr->Mnemonic()); 125 hinstr->Mnemonic(), instr->Mnemonic());
126 } 126 }
127 } 127 }
128 #endif 128 #endif
129 } 129 }
130 130
131 131
132 void LCodeGenBase::Comment(const char* format, ...) { 132 void LCodeGenBase::Comment(const char* format, ...) {
133 if (!FLAG_code_comments) return; 133 if (!FLAG_code_comments) return;
134 char buffer[4 * KB]; 134 char buffer[4 * KB];
135 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); 135 StringBuilder builder(buffer, arraysize(buffer));
136 va_list arguments; 136 va_list arguments;
137 va_start(arguments, format); 137 va_start(arguments, format);
138 builder.AddFormattedList(format, arguments); 138 builder.AddFormattedList(format, arguments);
139 va_end(arguments); 139 va_end(arguments);
140 140
141 // Copy the string before recording it in the assembler to avoid 141 // Copy the string before recording it in the assembler to avoid
142 // issues when the stack allocated buffer goes out of scope. 142 // issues when the stack allocated buffer goes out of scope.
143 size_t length = builder.position(); 143 size_t length = builder.position();
144 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); 144 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1);
145 MemCopy(copy.start(), builder.Finalize(), copy.length()); 145 MemCopy(copy.start(), builder.Finalize(), copy.length());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 chunk_->AddDeprecationDependency(map); 227 chunk_->AddDeprecationDependency(map);
228 } 228 }
229 229
230 230
231 void LCodeGenBase::AddStabilityDependency(Handle<Map> map) { 231 void LCodeGenBase::AddStabilityDependency(Handle<Map> map) {
232 if (!map->is_stable()) return Abort(kMapBecameUnstable); 232 if (!map->is_stable()) return Abort(kMapBecameUnstable);
233 chunk_->AddStabilityDependency(map); 233 chunk_->AddStabilityDependency(map);
234 } 234 }
235 235
236 } } // namespace v8::internal 236 } } // namespace v8::internal
OLDNEW
« src/base/macros.h ('K') | « src/jsregexp.cc ('k') | src/messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698