OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |