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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 if (print_ast) { | 149 if (print_ast) { |
150 PrintF("--- AST ---\n%s\n", AstPrinter().PrintProgram(flit)); | 150 PrintF("--- AST ---\n%s\n", AstPrinter().PrintProgram(flit)); |
151 } | 151 } |
152 #endif // DEBUG | 152 #endif // DEBUG |
153 | 153 |
154 // Generate code. | 154 // Generate code. |
155 const int initial_buffer_size = 4 * KB; | 155 const int initial_buffer_size = 4 * KB; |
156 CodeGenerator cgen(initial_buffer_size, script, is_eval); | 156 CodeGenerator cgen(initial_buffer_size, script, is_eval); |
| 157 CodeGeneratorScope scope(&cgen); |
157 cgen.GenCode(flit); | 158 cgen.GenCode(flit); |
158 if (cgen.HasStackOverflow()) { | 159 if (cgen.HasStackOverflow()) { |
159 ASSERT(!Top::has_pending_exception()); | 160 ASSERT(!Top::has_pending_exception()); |
160 return Handle<Code>::null(); | 161 return Handle<Code>::null(); |
161 } | 162 } |
162 | 163 |
163 // Allocate and install the code. Time the rest of this function as | 164 // Allocate and install the code. Time the rest of this function as |
164 // code creation. | 165 // code creation. |
165 HistogramTimerScope timer(&Counters::code_creation); | 166 HistogramTimerScope timer(&Counters::code_creation); |
166 CodeDesc desc; | 167 CodeDesc desc; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 629 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
629 switch (type_) { | 630 switch (type_) { |
630 case READ_LENGTH: GenerateReadLength(masm); break; | 631 case READ_LENGTH: GenerateReadLength(masm); break; |
631 case READ_ELEMENT: GenerateReadElement(masm); break; | 632 case READ_ELEMENT: GenerateReadElement(masm); break; |
632 case NEW_OBJECT: GenerateNewObject(masm); break; | 633 case NEW_OBJECT: GenerateNewObject(masm); break; |
633 } | 634 } |
634 } | 635 } |
635 | 636 |
636 | 637 |
637 } } // namespace v8::internal | 638 } } // namespace v8::internal |
OLD | NEW |