| 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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); | 1555 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); |
| 1556 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); | 1556 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); |
| 1557 // We pass all arguments to the generator, but it may not use all of | 1557 // We pass all arguments to the generator, but it may not use all of |
| 1558 // them. This works because the first arguments are on top of the | 1558 // them. This works because the first arguments are on top of the |
| 1559 // stack. | 1559 // stack. |
| 1560 DCHECK(!masm.has_frame()); | 1560 DCHECK(!masm.has_frame()); |
| 1561 g(&masm, functions[i].name, functions[i].extra_args); | 1561 g(&masm, functions[i].name, functions[i].extra_args); |
| 1562 // Move the code into the object heap. | 1562 // Move the code into the object heap. |
| 1563 CodeDesc desc; | 1563 CodeDesc desc; |
| 1564 masm.GetCode(&desc); | 1564 masm.GetCode(&desc); |
| 1565 Code::Flags flags = functions[i].flags; | 1565 Code::Flags flags = functions[i].flags; |
| 1566 Handle<Code> code = | 1566 Handle<Code> code = |
| 1567 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); | 1567 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); |
| 1568 // Log the event and add the code to the builtins array. | 1568 // Log the event and add the code to the builtins array. |
| 1569 PROFILE(isolate, | 1569 PROFILE(isolate, |
| 1570 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[i].s_name)); | 1570 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[i].s_name)); |
| 1571 builtins_[i] = *code; | 1571 builtins_[i] = *code; |
| 1572 if (code->kind() == Code::BUILTIN) code->set_builtin_index(i); | 1572 if (code->kind() == Code::BUILTIN) code->set_builtin_index(i); |
| 1573 #ifdef ENABLE_DISASSEMBLER | 1573 #ifdef ENABLE_DISASSEMBLER |
| 1574 if (FLAG_print_builtin_code) { | 1574 if (FLAG_print_builtin_code) { |
| 1575 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); | 1575 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 } | 1645 } |
| 1646 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1646 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1647 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1647 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1648 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1648 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1649 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1649 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1650 #undef DEFINE_BUILTIN_ACCESSOR_C | 1650 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1651 #undef DEFINE_BUILTIN_ACCESSOR_A | 1651 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1652 | 1652 |
| 1653 | 1653 |
| 1654 } } // namespace v8::internal | 1654 } } // namespace v8::internal |
| OLD | NEW |