OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // parameters which then can be executed. If the source code contains other | 403 // parameters which then can be executed. If the source code contains other |
404 // functions, they will be compiled and allocated as part of the compilation | 404 // functions, they will be compiled and allocated as part of the compilation |
405 // of the source code. | 405 // of the source code. |
406 | 406 |
407 // Please note this interface returns shared function infos. This means you | 407 // Please note this interface returns shared function infos. This means you |
408 // need to call Factory::NewFunctionFromSharedFunctionInfo before you have a | 408 // need to call Factory::NewFunctionFromSharedFunctionInfo before you have a |
409 // real function with a context. | 409 // real function with a context. |
410 | 410 |
411 class Compiler : public AllStatic { | 411 class Compiler : public AllStatic { |
412 public: | 412 public: |
413 // Default maximum number of function optimization attempts before we | |
414 // give up. | |
415 static const int kDefaultMaxOptCount = 10; | |
416 | |
417 static const int kMaxInliningLevels = 3; | 413 static const int kMaxInliningLevels = 3; |
418 | 414 |
419 // Call count before primitive functions trigger their own optimization. | 415 // Call count before primitive functions trigger their own optimization. |
420 static const int kCallsUntilPrimitiveOpt = 200; | 416 static const int kCallsUntilPrimitiveOpt = 200; |
421 | 417 |
422 // All routines return a SharedFunctionInfo. | 418 // All routines return a SharedFunctionInfo. |
423 // If an error occurs an exception is raised and the return handle | 419 // If an error occurs an exception is raised and the return handle |
424 // contains NULL. | 420 // contains NULL. |
425 | 421 |
426 // Compile a String source within a context. | 422 // Compile a String source within a context. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 461 |
466 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 462 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
467 CompilationInfo* info, | 463 CompilationInfo* info, |
468 Handle<SharedFunctionInfo> shared); | 464 Handle<SharedFunctionInfo> shared); |
469 }; | 465 }; |
470 | 466 |
471 | 467 |
472 } } // namespace v8::internal | 468 } } // namespace v8::internal |
473 | 469 |
474 #endif // V8_COMPILER_H_ | 470 #endif // V8_COMPILER_H_ |
OLD | NEW |