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

Side by Side Diff: src/parser.cc

Issue 6453009: Fix wrong assumption in parser that parsing a function literal cannot throw an exception. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1110.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 FunctionLiteralType type = 759 FunctionLiteralType type =
760 info->is_expression() ? EXPRESSION : DECLARATION; 760 info->is_expression() ? EXPRESSION : DECLARATION;
761 bool ok = true; 761 bool ok = true;
762 result = ParseFunctionLiteral(name, 762 result = ParseFunctionLiteral(name,
763 false, // Strict mode name already checked. 763 false, // Strict mode name already checked.
764 RelocInfo::kNoPosition, type, &ok); 764 RelocInfo::kNoPosition, type, &ok);
765 // Make sure the results agree. 765 // Make sure the results agree.
766 ASSERT(ok == (result != NULL)); 766 ASSERT(ok == (result != NULL));
767 // The only errors should be stack overflows.
768 ASSERT(ok || stack_overflow_);
769 } 767 }
770 768
771 // Make sure the target stack is empty. 769 // Make sure the target stack is empty.
772 ASSERT(target_stack_ == NULL); 770 ASSERT(target_stack_ == NULL);
773 771
774 // If there was a stack overflow we have to get rid of AST and it is 772 // If there was a stack overflow we have to get rid of AST and it is
775 // not safe to do before scope has been deleted. 773 // not safe to do before scope has been deleted.
776 if (result == NULL) { 774 if (result == NULL) {
777 Top::StackOverflow();
778 zone_scope->DeleteOnExit(); 775 zone_scope->DeleteOnExit();
776 if (stack_overflow_) Top::StackOverflow();
779 } else { 777 } else {
780 Handle<String> inferred_name(info->inferred_name()); 778 Handle<String> inferred_name(info->inferred_name());
781 result->set_inferred_name(inferred_name); 779 result->set_inferred_name(inferred_name);
782 } 780 }
783 return result; 781 return result;
784 } 782 }
785 783
786 784
787 Handle<String> Parser::GetSymbol(bool* ok) { 785 Handle<String> Parser::GetSymbol(bool* ok) {
788 int symbol_id = -1; 786 int symbol_id = -1;
(...skipping 4310 matching lines...) Expand 10 before | Expand all | Expand 10 after
5099 info->is_global(), 5097 info->is_global(),
5100 info->StrictMode()); 5098 info->StrictMode());
5101 } 5099 }
5102 } 5100 }
5103 5101
5104 info->SetFunction(result); 5102 info->SetFunction(result);
5105 return (result != NULL); 5103 return (result != NULL);
5106 } 5104 }
5107 5105
5108 } } // namespace v8::internal 5106 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1110.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698