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 56 matching lines...) Loading... |
67 preamble_[PreparseDataConstants::kHasErrorOffset] = true; | 67 preamble_[PreparseDataConstants::kHasErrorOffset] = true; |
68 function_store_.Reset(); | 68 function_store_.Reset(); |
69 STATIC_ASSERT(PreparseDataConstants::kMessageStartPos == 0); | 69 STATIC_ASSERT(PreparseDataConstants::kMessageStartPos == 0); |
70 function_store_.Add(start_pos); | 70 function_store_.Add(start_pos); |
71 STATIC_ASSERT(PreparseDataConstants::kMessageEndPos == 1); | 71 STATIC_ASSERT(PreparseDataConstants::kMessageEndPos == 1); |
72 function_store_.Add(end_pos); | 72 function_store_.Add(end_pos); |
73 STATIC_ASSERT(PreparseDataConstants::kMessageArgCountPos == 2); | 73 STATIC_ASSERT(PreparseDataConstants::kMessageArgCountPos == 2); |
74 function_store_.Add((arg_opt == NULL) ? 0 : 1); | 74 function_store_.Add((arg_opt == NULL) ? 0 : 1); |
75 STATIC_ASSERT(PreparseDataConstants::kMessageTextPos == 3); | 75 STATIC_ASSERT(PreparseDataConstants::kMessageTextPos == 3); |
76 WriteString(CStrVector(message)); | 76 WriteString(CStrVector(message)); |
77 if (arg_opt) WriteString(CStrVector(arg_opt)); | 77 if (arg_opt != NULL) WriteString(CStrVector(arg_opt)); |
78 is_recording_ = false; | 78 is_recording_ = false; |
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 } |
(...skipping 86 matching lines...) Loading... |
174 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u); | 174 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u); |
175 number &= mask; | 175 number &= mask; |
176 } | 176 } |
177 mask >>= 7; | 177 mask >>= 7; |
178 } | 178 } |
179 symbol_store_.Add(static_cast<byte>(number)); | 179 symbol_store_.Add(static_cast<byte>(number)); |
180 } | 180 } |
181 | 181 |
182 | 182 |
183 } } // namespace v8::internal. | 183 } } // namespace v8::internal. |
OLD | NEW |