| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // CodeGenerator | 279 // CodeGenerator |
| 280 | 280 |
| 281 class CodeGenerator: public AstVisitor { | 281 class CodeGenerator: public AstVisitor { |
| 282 public: | 282 public: |
| 283 // Takes a function literal, generates code for it. This function should only | 283 // Takes a function literal, generates code for it. This function should only |
| 284 // be called by compiler.cc. | 284 // be called by compiler.cc. |
| 285 static Handle<Code> MakeCode(FunctionLiteral* fun, | 285 static Handle<Code> MakeCode(FunctionLiteral* fun, |
| 286 Handle<Script> script, | 286 Handle<Script> script, |
| 287 bool is_eval); | 287 bool is_eval); |
| 288 | 288 |
| 289 // During implementation of CodeGenerator, this call creates a |
| 290 // CodeGenerator instance, and calls GenCode on it with a null |
| 291 // function literal. CodeGenerator will then construct and return |
| 292 // a simple dummy function. Call this during bootstrapping before |
| 293 // trying to compile any real functions, to get CodeGenerator up |
| 294 // and running. |
| 295 // TODO(X64): Remove once we can get through the bootstrapping process. |
| 296 static void TestCodeGenerator(); |
| 297 |
| 289 #ifdef ENABLE_LOGGING_AND_PROFILING | 298 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 290 static bool ShouldGenerateLog(Expression* type); | 299 static bool ShouldGenerateLog(Expression* type); |
| 291 #endif | 300 #endif |
| 292 | 301 |
| 293 static void SetFunctionInfo(Handle<JSFunction> fun, | 302 static void SetFunctionInfo(Handle<JSFunction> fun, |
| 294 int length, | 303 int length, |
| 295 int function_token_position, | 304 int function_token_position, |
| 296 int start_position, | 305 int start_position, |
| 297 int end_position, | 306 int end_position, |
| 298 bool is_expression, | 307 bool is_expression, |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 friend class Reference; | 627 friend class Reference; |
| 619 friend class Result; | 628 friend class Result; |
| 620 | 629 |
| 621 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 630 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 622 }; | 631 }; |
| 623 | 632 |
| 624 | 633 |
| 625 } } // namespace v8::internal | 634 } } // namespace v8::internal |
| 626 | 635 |
| 627 #endif // V8_X64_CODEGEN_X64_H_ | 636 #endif // V8_X64_CODEGEN_X64_H_ |
| OLD | NEW |