OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 void FunctionLoggingParserRecorder::WriteString(Vector<const char> str) { | 82 void FunctionLoggingParserRecorder::WriteString(Vector<const char> str) { |
83 function_store_.Add(str.length()); | 83 function_store_.Add(str.length()); |
84 for (int i = 0; i < str.length(); i++) { | 84 for (int i = 0; i < str.length(); i++) { |
85 function_store_.Add(str[i]); | 85 function_store_.Add(str[i]); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
| 89 |
89 // ---------------------------------------------------------------------------- | 90 // ---------------------------------------------------------------------------- |
90 // PartialParserRecorder - Record both function entries and symbols. | 91 // PartialParserRecorder - Record both function entries and symbols. |
91 | 92 |
92 Vector<unsigned> PartialParserRecorder::ExtractData() { | 93 Vector<unsigned> PartialParserRecorder::ExtractData() { |
93 int function_size = function_store_.size(); | 94 int function_size = function_store_.size(); |
94 int total_size = PreparseDataConstants::kHeaderSize + function_size; | 95 int total_size = PreparseDataConstants::kHeaderSize + function_size; |
95 Vector<unsigned> data = Vector<unsigned>::New(total_size); | 96 Vector<unsigned> data = Vector<unsigned>::New(total_size); |
96 preamble_[PreparseDataConstants::kFunctionsSizeOffset] = function_size; | 97 preamble_[PreparseDataConstants::kFunctionsSizeOffset] = function_size; |
97 preamble_[PreparseDataConstants::kSymbolCountOffset] = 0; | 98 preamble_[PreparseDataConstants::kSymbolCountOffset] = 0; |
98 OS::MemCopy(data.start(), preamble_, sizeof(preamble_)); | 99 OS::MemCopy(data.start(), preamble_, sizeof(preamble_)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u); | 175 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u); |
175 number &= mask; | 176 number &= mask; |
176 } | 177 } |
177 mask >>= 7; | 178 mask >>= 7; |
178 } | 179 } |
179 symbol_store_.Add(static_cast<byte>(number)); | 180 symbol_store_.Add(static_cast<byte>(number)); |
180 } | 181 } |
181 | 182 |
182 | 183 |
183 } } // namespace v8::internal. | 184 } } // namespace v8::internal. |
OLD | NEW |