| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 // Generate code. | 155 // Generate code. |
| 156 const int initial_buffer_size = 4 * KB; | 156 const int initial_buffer_size = 4 * KB; |
| 157 CodeGenerator cgen(initial_buffer_size, script, is_eval); | 157 CodeGenerator cgen(initial_buffer_size, script, is_eval); |
| 158 cgen.GenCode(flit); | 158 cgen.GenCode(flit); |
| 159 if (cgen.HasStackOverflow()) { | 159 if (cgen.HasStackOverflow()) { |
| 160 ASSERT(!Top::has_pending_exception()); | 160 ASSERT(!Top::has_pending_exception()); |
| 161 return Handle<Code>::null(); | 161 return Handle<Code>::null(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Allocate and install the code. | 164 // Allocate and install the code. Time the rest of this function as |
| 165 // code creation. |
| 166 HistogramTimerScope timer(&Counters::code_creation); |
| 165 CodeDesc desc; | 167 CodeDesc desc; |
| 166 cgen.masm()->GetCode(&desc); | 168 cgen.masm()->GetCode(&desc); |
| 167 ScopeInfo<> sinfo(flit->scope()); | 169 ScopeInfo<> sinfo(flit->scope()); |
| 168 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 170 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
| 169 Handle<Code> code = Factory::NewCode(desc, | 171 Handle<Code> code = Factory::NewCode(desc, |
| 170 &sinfo, | 172 &sinfo, |
| 171 flags, | 173 flags, |
| 172 cgen.masm()->CodeObject()); | 174 cgen.masm()->CodeObject()); |
| 173 | 175 |
| 174 // Add unresolved entries in the code to the fixup list. | 176 // Add unresolved entries in the code to the fixup list. |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 629 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
| 628 switch (type_) { | 630 switch (type_) { |
| 629 case READ_LENGTH: GenerateReadLength(masm); break; | 631 case READ_LENGTH: GenerateReadLength(masm); break; |
| 630 case READ_ELEMENT: GenerateReadElement(masm); break; | 632 case READ_ELEMENT: GenerateReadElement(masm); break; |
| 631 case NEW_OBJECT: GenerateNewObject(masm); break; | 633 case NEW_OBJECT: GenerateNewObject(masm); break; |
| 632 } | 634 } |
| 633 } | 635 } |
| 634 | 636 |
| 635 | 637 |
| 636 } } // namespace v8::internal | 638 } } // namespace v8::internal |
| OLD | NEW |