| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 g(&masm, functions[i].name); | 681 g(&masm, functions[i].name); |
| 682 // Move the code into the object heap. | 682 // Move the code into the object heap. |
| 683 CodeDesc desc; | 683 CodeDesc desc; |
| 684 masm.GetCode(&desc); | 684 masm.GetCode(&desc); |
| 685 Code::Flags flags = functions[i].flags; | 685 Code::Flags flags = functions[i].flags; |
| 686 Object* code; | 686 Object* code; |
| 687 { | 687 { |
| 688 // During startup it's OK to always allocate and defer GC to later. | 688 // During startup it's OK to always allocate and defer GC to later. |
| 689 // This simplifies things because we don't need to retry. | 689 // This simplifies things because we don't need to retry. |
| 690 AlwaysAllocateScope __scope__; | 690 AlwaysAllocateScope __scope__; |
| 691 code = Heap::CreateCode(desc, NULL, flags, NULL); | 691 code = Heap::CreateCode(desc, NULL, flags, masm.CodeObject()); |
| 692 if (code->IsFailure()) { | 692 if (code->IsFailure()) { |
| 693 v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); | 693 v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 // Add any unresolved jumps or calls to the fixup list in the | 696 // Add any unresolved jumps or calls to the fixup list in the |
| 697 // bootstrapper. | 697 // bootstrapper. |
| 698 Bootstrapper::AddFixup(Code::cast(code), &masm); | 698 Bootstrapper::AddFixup(Code::cast(code), &masm); |
| 699 // Log the event and add the code to the builtins array. | 699 // Log the event and add the code to the builtins array. |
| 700 LOG(CodeCreateEvent("Builtin", Code::cast(code), functions[i].s_name)); | 700 LOG(CodeCreateEvent("Builtin", Code::cast(code), functions[i].s_name)); |
| 701 builtins_[i] = code; | 701 builtins_[i] = code; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 if (entry->contains(pc)) { | 735 if (entry->contains(pc)) { |
| 736 return names_[i]; | 736 return names_[i]; |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 return NULL; | 740 return NULL; |
| 741 } | 741 } |
| 742 | 742 |
| 743 | 743 |
| 744 } } // namespace v8::internal | 744 } } // namespace v8::internal |
| OLD | NEW |