| 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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 g(&masm, functions[i].name, functions[i].extra_args); | 1468 g(&masm, functions[i].name, functions[i].extra_args); |
| 1469 // Move the code into the object heap. | 1469 // Move the code into the object heap. |
| 1470 CodeDesc desc; | 1470 CodeDesc desc; |
| 1471 masm.GetCode(&desc); | 1471 masm.GetCode(&desc); |
| 1472 Code::Flags flags = functions[i].flags; | 1472 Code::Flags flags = functions[i].flags; |
| 1473 Object* code; | 1473 Object* code; |
| 1474 { | 1474 { |
| 1475 // During startup it's OK to always allocate and defer GC to later. | 1475 // During startup it's OK to always allocate and defer GC to later. |
| 1476 // This simplifies things because we don't need to retry. | 1476 // This simplifies things because we don't need to retry. |
| 1477 AlwaysAllocateScope __scope__; | 1477 AlwaysAllocateScope __scope__; |
| 1478 code = Heap::CreateCode(desc, NULL, flags, masm.CodeObject()); | 1478 code = Heap::CreateCode(desc, flags, masm.CodeObject()); |
| 1479 if (code->IsFailure()) { | 1479 if (code->IsFailure()) { |
| 1480 v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); | 1480 v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); |
| 1481 } | 1481 } |
| 1482 } | 1482 } |
| 1483 // Log the event and add the code to the builtins array. | 1483 // Log the event and add the code to the builtins array. |
| 1484 PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG, | 1484 PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG, |
| 1485 Code::cast(code), functions[i].s_name)); | 1485 Code::cast(code), functions[i].s_name)); |
| 1486 builtins_[i] = code; | 1486 builtins_[i] = code; |
| 1487 #ifdef ENABLE_DISASSEMBLER | 1487 #ifdef ENABLE_DISASSEMBLER |
| 1488 if (FLAG_print_builtin_code) { | 1488 if (FLAG_print_builtin_code) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 if (entry->contains(pc)) { | 1520 if (entry->contains(pc)) { |
| 1521 return names_[i]; | 1521 return names_[i]; |
| 1522 } | 1522 } |
| 1523 } | 1523 } |
| 1524 } | 1524 } |
| 1525 return NULL; | 1525 return NULL; |
| 1526 } | 1526 } |
| 1527 | 1527 |
| 1528 | 1528 |
| 1529 } } // namespace v8::internal | 1529 } } // namespace v8::internal |
| OLD | NEW |