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

Side by Side Diff: src/compiler.cc

Issue 9429: Handle stack overflow errors correctly when rewriting the AST... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 | src/rewriter.h » ('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 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 #ifdef DEBUG 60 #ifdef DEBUG
61 if (Bootstrapper::IsActive() ? 61 if (Bootstrapper::IsActive() ?
62 FLAG_print_builtin_scopes : 62 FLAG_print_builtin_scopes :
63 FLAG_print_scopes) { 63 FLAG_print_scopes) {
64 literal->scope()->Print(); 64 literal->scope()->Print();
65 } 65 }
66 #endif 66 #endif
67 67
68 // Optimize the AST. 68 // Optimize the AST.
69 Rewriter::Optimize(literal); 69 if (!Rewriter::Optimize(literal)) {
70 // Signal a stack overflow by returning a null handle. The stack
71 // overflow exception will be thrown by the caller.
72 return Handle<Code>::null();
73 }
70 74
71 // Generate code and return it. 75 // Generate code and return it.
72 Handle<Code> result = CodeGenerator::MakeCode(literal, script, is_eval); 76 Handle<Code> result = CodeGenerator::MakeCode(literal, script, is_eval);
73 return result; 77 return result;
74 } 78 }
75 79
76 80
77 static Handle<JSFunction> MakeFunction(bool is_global, 81 static Handle<JSFunction> MakeFunction(bool is_global,
78 bool is_eval, 82 bool is_eval,
79 Handle<Script> script, 83 Handle<Script> script,
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // Set the expected number of properties for instances. 294 // Set the expected number of properties for instances.
291 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 295 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
292 296
293 // Check the function has compiled code. 297 // Check the function has compiled code.
294 ASSERT(shared->is_compiled()); 298 ASSERT(shared->is_compiled());
295 return true; 299 return true;
296 } 300 }
297 301
298 302
299 } } // namespace v8::internal 303 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698