| OLD | NEW |
| 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 20 matching lines...) Expand all Loading... |
| 31 #include "codegen-inl.h" | 31 #include "codegen-inl.h" |
| 32 #include "compilation-cache.h" | 32 #include "compilation-cache.h" |
| 33 #include "compiler.h" | 33 #include "compiler.h" |
| 34 #include "debug.h" | 34 #include "debug.h" |
| 35 #include "scopes.h" | 35 #include "scopes.h" |
| 36 #include "rewriter.h" | 36 #include "rewriter.h" |
| 37 #include "usage-analyzer.h" | 37 #include "usage-analyzer.h" |
| 38 | 38 |
| 39 namespace v8 { namespace internal { | 39 namespace v8 { namespace internal { |
| 40 | 40 |
| 41 DEFINE_bool(strict, false, "strict error checking"); | |
| 42 DEFINE_int(min_preparse_length, 1024, | |
| 43 "Minimum length for automatic enable preparsing"); | |
| 44 DECLARE_bool(debug_info); | |
| 45 | |
| 46 #ifdef DEBUG | |
| 47 DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins"); | |
| 48 DEFINE_bool(print_scopes, false, "print scopes"); | |
| 49 #endif | |
| 50 | |
| 51 | |
| 52 static Handle<Code> MakeCode(FunctionLiteral* literal, | 41 static Handle<Code> MakeCode(FunctionLiteral* literal, |
| 53 Handle<Script> script, | 42 Handle<Script> script, |
| 54 bool is_eval) { | 43 bool is_eval) { |
| 55 ASSERT(literal != NULL); | 44 ASSERT(literal != NULL); |
| 56 | 45 |
| 57 // Rewrite the AST by introducing .result assignments where needed. | 46 // Rewrite the AST by introducing .result assignments where needed. |
| 58 if (!Rewriter::Process(literal) || !AnalyzeVariableUsage(literal)) { | 47 if (!Rewriter::Process(literal) || !AnalyzeVariableUsage(literal)) { |
| 59 // Signal a stack overflow by returning a null handle. The stack | 48 // Signal a stack overflow by returning a null handle. The stack |
| 60 // overflow exception will be thrown by the caller. | 49 // overflow exception will be thrown by the caller. |
| 61 return Handle<Code>::null(); | 50 return Handle<Code>::null(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // Set the expected number of properties for instances. | 283 // Set the expected number of properties for instances. |
| 295 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); | 284 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); |
| 296 | 285 |
| 297 // Check the function has compiled code. | 286 // Check the function has compiled code. |
| 298 ASSERT(shared->is_compiled()); | 287 ASSERT(shared->is_compiled()); |
| 299 return true; | 288 return true; |
| 300 } | 289 } |
| 301 | 290 |
| 302 | 291 |
| 303 } } // namespace v8::internal | 292 } } // namespace v8::internal |
| OLD | NEW |