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

Side by Side Diff: src/parser.cc

Issue 13343: More assertion propagation. (Closed)
Patch Set: "Does it lint?" Created 12 years 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after
4295 // The list owns the backing store so we need to clone the vector. 4295 // The list owns the backing store so we need to clone the vector.
4296 // That way, the result will be exactly the right size rather than 4296 // That way, the result will be exactly the right size rather than
4297 // the expected 50% too large. 4297 // the expected 50% too large.
4298 Vector<unsigned> store = parser.recorder()->store()->ToVector().Clone(); 4298 Vector<unsigned> store = parser.recorder()->store()->ToVector().Clone();
4299 return new ScriptDataImpl(store); 4299 return new ScriptDataImpl(store);
4300 } 4300 }
4301 4301
4302 4302
4303 bool ParseRegExp(FlatStringReader* input, 4303 bool ParseRegExp(FlatStringReader* input,
4304 bool multiline, 4304 bool multiline,
4305 RegExpParseResult* result) { 4305 RegExpCompileData* result) {
4306 ASSERT(result != NULL); 4306 ASSERT(result != NULL);
4307 // Make sure we have a stack guard. 4307 // Make sure we have a stack guard.
4308 StackGuard guard; 4308 StackGuard guard;
4309 RegExpParser parser(input, &result->error, multiline); 4309 RegExpParser parser(input, &result->error, multiline);
4310 result->tree = parser.ParsePattern(); 4310 result->tree = parser.ParsePattern();
4311 if (parser.failed()) { 4311 if (parser.failed()) {
4312 ASSERT(result->tree == NULL); 4312 ASSERT(result->tree == NULL);
4313 ASSERT(!result->error.is_null()); 4313 ASSERT(!result->error.is_null());
4314 } else { 4314 } else {
4315 ASSERT(result->tree != NULL); 4315 ASSERT(result->tree != NULL);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4366 start_position, 4366 start_position,
4367 is_expression); 4367 is_expression);
4368 return result; 4368 return result;
4369 } 4369 }
4370 4370
4371 4371
4372 #undef NEW 4372 #undef NEW
4373 4373
4374 4374
4375 } } // namespace v8::internal 4375 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698