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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 TestJSONStream() : eos_signaled_(0), abort_countdown_(-1) {} | 564 TestJSONStream() : eos_signaled_(0), abort_countdown_(-1) {} |
565 explicit TestJSONStream(int abort_countdown) | 565 explicit TestJSONStream(int abort_countdown) |
566 : eos_signaled_(0), abort_countdown_(abort_countdown) {} | 566 : eos_signaled_(0), abort_countdown_(abort_countdown) {} |
567 virtual ~TestJSONStream() {} | 567 virtual ~TestJSONStream() {} |
568 virtual void EndOfStream() { ++eos_signaled_; } | 568 virtual void EndOfStream() { ++eos_signaled_; } |
569 virtual WriteResult WriteAsciiChunk(char* buffer, int chars_written) { | 569 virtual WriteResult WriteAsciiChunk(char* buffer, int chars_written) { |
570 if (abort_countdown_ > 0) --abort_countdown_; | 570 if (abort_countdown_ > 0) --abort_countdown_; |
571 if (abort_countdown_ == 0) return kAbort; | 571 if (abort_countdown_ == 0) return kAbort; |
572 CHECK_GT(chars_written, 0); | 572 CHECK_GT(chars_written, 0); |
573 i::Vector<char> chunk = buffer_.AddBlock(chars_written, '\0'); | 573 i::Vector<char> chunk = buffer_.AddBlock(chars_written, '\0'); |
574 memcpy(chunk.start(), buffer, chars_written); | 574 i::OS::MemCopy(chunk.start(), buffer, chars_written); |
575 return kContinue; | 575 return kContinue; |
576 } | 576 } |
577 virtual WriteResult WriteUint32Chunk(uint32_t* buffer, int chars_written) { | 577 virtual WriteResult WriteUint32Chunk(uint32_t* buffer, int chars_written) { |
578 ASSERT(false); | 578 ASSERT(false); |
579 return kAbort; | 579 return kAbort; |
580 } | 580 } |
581 void WriteTo(i::Vector<char> dest) { buffer_.WriteTo(dest); } | 581 void WriteTo(i::Vector<char> dest) { buffer_.WriteTo(dest); } |
582 int eos_signaled() { return eos_signaled_; } | 582 int eos_signaled() { return eos_signaled_; } |
583 int size() { return buffer_.size(); } | 583 int size() { return buffer_.size(); } |
584 | 584 |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 // Check all the objects have got their names. | 1765 // Check all the objects have got their names. |
1766 // ... well check just every 8th because otherwise it's too slow in debug. | 1766 // ... well check just every 8th because otherwise it's too slow in debug. |
1767 for (int i = 0; i < num_objects - 1; i += 8) { | 1767 for (int i = 0; i < num_objects - 1; i += 8) { |
1768 i::EmbeddedVector<char, 100> var_name; | 1768 i::EmbeddedVector<char, 100> var_name; |
1769 i::OS::SNPrintF(var_name, "f_%d", i); | 1769 i::OS::SNPrintF(var_name, "f_%d", i); |
1770 const v8::HeapGraphNode* f_object = GetProperty( | 1770 const v8::HeapGraphNode* f_object = GetProperty( |
1771 context_object, v8::HeapGraphEdge::kContextVariable, var_name.start()); | 1771 context_object, v8::HeapGraphEdge::kContextVariable, var_name.start()); |
1772 CHECK_NE(NULL, f_object); | 1772 CHECK_NE(NULL, f_object); |
1773 } | 1773 } |
1774 } | 1774 } |
OLD | NEW |