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

Side by Side Diff: src/log.cc

Issue 13932006: Replace OS::MemCopy with OS::MemMove (just as fast but more flexible). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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 | « src/liveedit.cc ('k') | src/log-utils.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 if (utf8_pos_ + char_length > kUtf8BufferSize) break; 400 if (utf8_pos_ + char_length > kUtf8BufferSize) break;
401 unibrow::Utf8::Encode(utf8_buffer_ + utf8_pos_, c, previous); 401 unibrow::Utf8::Encode(utf8_buffer_ + utf8_pos_, c, previous);
402 utf8_pos_ += char_length; 402 utf8_pos_ += char_length;
403 } 403 }
404 previous = c; 404 previous = c;
405 } 405 }
406 } 406 }
407 407
408 void AppendBytes(const char* bytes, int size) { 408 void AppendBytes(const char* bytes, int size) {
409 size = Min(size, kUtf8BufferSize - utf8_pos_); 409 size = Min(size, kUtf8BufferSize - utf8_pos_);
410 memcpy(utf8_buffer_ + utf8_pos_, bytes, size); 410 OS::MemCopy(utf8_buffer_ + utf8_pos_, bytes, size);
411 utf8_pos_ += size; 411 utf8_pos_ += size;
412 } 412 }
413 413
414 void AppendBytes(const char* bytes) { 414 void AppendBytes(const char* bytes) {
415 AppendBytes(bytes, StrLength(bytes)); 415 AppendBytes(bytes, StrLength(bytes));
416 } 416 }
417 417
418 void AppendByte(char c) { 418 void AppendByte(char c) {
419 if (utf8_pos_ >= kUtf8BufferSize) return; 419 if (utf8_pos_ >= kUtf8BufferSize) return;
420 utf8_buffer_[utf8_pos_++] = c; 420 utf8_buffer_[utf8_pos_++] = c;
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { 2004 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) {
2005 ASSERT(sampler->IsActive()); 2005 ASSERT(sampler->IsActive());
2006 ScopedLock lock(active_samplers_mutex); 2006 ScopedLock lock(active_samplers_mutex);
2007 ASSERT(active_samplers_ != NULL); 2007 ASSERT(active_samplers_ != NULL);
2008 bool removed = active_samplers_->RemoveElement(sampler); 2008 bool removed = active_samplers_->RemoveElement(sampler);
2009 ASSERT(removed); 2009 ASSERT(removed);
2010 USE(removed); 2010 USE(removed);
2011 } 2011 }
2012 2012
2013 } } // namespace v8::internal 2013 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/log-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698