| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1631 // Move the code into the object heap. | 1631 // Move the code into the object heap. |
| 1632 CodeDesc desc; | 1632 CodeDesc desc; |
| 1633 masm.GetCode(&desc); | 1633 masm.GetCode(&desc); |
| 1634 Code::Flags flags = functions[i].flags; | 1634 Code::Flags flags = functions[i].flags; |
| 1635 Handle<Code> code = | 1635 Handle<Code> code = |
| 1636 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); | 1636 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); |
| 1637 // Log the event and add the code to the builtins array. | 1637 // Log the event and add the code to the builtins array. |
| 1638 PROFILE(isolate, | 1638 PROFILE(isolate, |
| 1639 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[i].s_name)); | 1639 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[i].s_name)); |
| 1640 builtins_[i] = *code; | 1640 builtins_[i] = *code; |
| 1641 if (code->kind() == Code::BUILTIN) code->set_builtin_index(i); |
| 1641 #ifdef ENABLE_DISASSEMBLER | 1642 #ifdef ENABLE_DISASSEMBLER |
| 1642 if (FLAG_print_builtin_code) { | 1643 if (FLAG_print_builtin_code) { |
| 1643 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); | 1644 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); |
| 1644 OFStream os(trace_scope.file()); | 1645 OFStream os(trace_scope.file()); |
| 1645 os << "Builtin: " << functions[i].s_name << "\n"; | 1646 os << "Builtin: " << functions[i].s_name << "\n"; |
| 1646 code->Disassemble(functions[i].s_name, os); | 1647 code->Disassemble(functions[i].s_name, os); |
| 1647 os << "\n"; | 1648 os << "\n"; |
| 1648 } | 1649 } |
| 1649 #endif | 1650 #endif |
| 1650 } else { | 1651 } else { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 } | 1714 } |
| 1714 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1715 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1715 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1716 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1716 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1717 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1717 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1718 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1718 #undef DEFINE_BUILTIN_ACCESSOR_C | 1719 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1719 #undef DEFINE_BUILTIN_ACCESSOR_A | 1720 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1720 | 1721 |
| 1721 | 1722 |
| 1722 } } // namespace v8::internal | 1723 } } // namespace v8::internal |
| OLD | NEW |