OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 // Generate the code. Takes a function literal, generates code for it, assemble | 74 // Generate the code. Takes a function literal, generates code for it, assemble |
75 // all the pieces into a Code object. This function is only to be called by | 75 // all the pieces into a Code object. This function is only to be called by |
76 // the compiler.cc code. | 76 // the compiler.cc code. |
77 Handle<Code> CodeGenerator::MakeCode(FunctionLiteral* flit, | 77 Handle<Code> CodeGenerator::MakeCode(FunctionLiteral* flit, |
78 Handle<Script> script, | 78 Handle<Script> script, |
79 bool is_eval) { | 79 bool is_eval) { |
80 #ifdef ENABLE_DISASSEMBLER | 80 #ifdef ENABLE_DISASSEMBLER |
81 bool print_code = FLAG_print_code && !Bootstrapper::IsActive(); | 81 bool print_code = Bootstrapper::IsActive() |
| 82 ? FLAG_print_builtin_code |
| 83 : FLAG_print_code; |
82 #endif | 84 #endif |
83 | 85 |
84 #ifdef DEBUG | 86 #ifdef DEBUG |
85 bool print_source = false; | 87 bool print_source = false; |
86 bool print_ast = false; | 88 bool print_ast = false; |
87 const char* ftype; | 89 const char* ftype; |
88 | 90 |
89 if (Bootstrapper::IsActive()) { | 91 if (Bootstrapper::IsActive()) { |
90 print_source = FLAG_print_builtin_source; | 92 print_source = FLAG_print_builtin_source; |
91 print_ast = FLAG_print_builtin_ast; | 93 print_ast = FLAG_print_builtin_ast; |
92 print_code = FLAG_print_builtin_code; | |
93 ftype = "builtin"; | 94 ftype = "builtin"; |
94 } else { | 95 } else { |
95 print_source = FLAG_print_source; | 96 print_source = FLAG_print_source; |
96 print_ast = FLAG_print_ast; | 97 print_ast = FLAG_print_ast; |
97 ftype = "user-defined"; | 98 ftype = "user-defined"; |
98 } | 99 } |
99 | 100 |
100 if (FLAG_trace_codegen || print_source || print_ast) { | 101 if (FLAG_trace_codegen || print_source || print_ast) { |
101 PrintF("*** Generate code for %s function: ", ftype); | 102 PrintF("*** Generate code for %s function: ", ftype); |
102 flit->name()->ShortPrint(); | 103 flit->name()->ShortPrint(); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 477 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
477 switch (type_) { | 478 switch (type_) { |
478 case READ_LENGTH: GenerateReadLength(masm); break; | 479 case READ_LENGTH: GenerateReadLength(masm); break; |
479 case READ_ELEMENT: GenerateReadElement(masm); break; | 480 case READ_ELEMENT: GenerateReadElement(masm); break; |
480 case NEW_OBJECT: GenerateNewObject(masm); break; | 481 case NEW_OBJECT: GenerateNewObject(masm); break; |
481 } | 482 } |
482 } | 483 } |
483 | 484 |
484 | 485 |
485 } } // namespace v8::internal | 486 } } // namespace v8::internal |
OLD | NEW |