| 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |