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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // CodeGenerator | 287 // CodeGenerator |
288 | 288 |
289 class CodeGenerator: public AstVisitor { | 289 class CodeGenerator: public AstVisitor { |
290 public: | 290 public: |
291 // Takes a function literal, generates code for it. This function should only | 291 // Takes a function literal, generates code for it. This function should only |
292 // be called by compiler.cc. | 292 // be called by compiler.cc. |
293 static Handle<Code> MakeCode(FunctionLiteral* fun, | 293 static Handle<Code> MakeCode(FunctionLiteral* fun, |
294 Handle<Script> script, | 294 Handle<Script> script, |
295 bool is_eval); | 295 bool is_eval); |
296 | 296 |
297 // During implementation of CodeGenerator, this call creates a | |
298 // CodeGenerator instance, and calls GenCode on it with a null | |
299 // function literal. CodeGenerator will then construct and return | |
300 // a simple dummy function. Call this during bootstrapping before | |
301 // trying to compile any real functions, to get CodeGenerator up | |
302 // and running. | |
303 // TODO(X64): Remove once we can get through the bootstrapping process. | |
304 static void TestCodeGenerator(); | |
305 | |
306 #ifdef ENABLE_LOGGING_AND_PROFILING | 297 #ifdef ENABLE_LOGGING_AND_PROFILING |
307 static bool ShouldGenerateLog(Expression* type); | 298 static bool ShouldGenerateLog(Expression* type); |
308 #endif | 299 #endif |
309 | 300 |
310 static void SetFunctionInfo(Handle<JSFunction> fun, | 301 static void SetFunctionInfo(Handle<JSFunction> fun, |
311 int length, | 302 int length, |
312 int function_token_position, | 303 int function_token_position, |
313 int start_position, | 304 int start_position, |
314 int end_position, | 305 int end_position, |
315 bool is_expression, | 306 bool is_expression, |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 friend class Reference; | 644 friend class Reference; |
654 friend class Result; | 645 friend class Result; |
655 | 646 |
656 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 647 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
657 }; | 648 }; |
658 | 649 |
659 | 650 |
660 } } // namespace v8::internal | 651 } } // namespace v8::internal |
661 | 652 |
662 #endif // V8_X64_CODEGEN_X64_H_ | 653 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |