| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "api.h" | 7 #include "api.h" |
| 8 #include "arguments.h" | 8 #include "arguments.h" |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "builtins.h" | 10 #include "builtins.h" |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 ASSERT(!initialized_); | 1597 ASSERT(!initialized_); |
| 1598 | 1598 |
| 1599 // Create a scope for the handles in the builtins. | 1599 // Create a scope for the handles in the builtins. |
| 1600 HandleScope scope(isolate); | 1600 HandleScope scope(isolate); |
| 1601 | 1601 |
| 1602 const BuiltinDesc* functions = builtin_function_table.functions(); | 1602 const BuiltinDesc* functions = builtin_function_table.functions(); |
| 1603 | 1603 |
| 1604 // For now we generate builtin adaptor code into a stack-allocated | 1604 // For now we generate builtin adaptor code into a stack-allocated |
| 1605 // buffer, before copying it into individual code objects. Be careful | 1605 // buffer, before copying it into individual code objects. Be careful |
| 1606 // with alignment, some platforms don't like unaligned code. | 1606 // with alignment, some platforms don't like unaligned code. |
| 1607 #ifdef DEBUG | 1607 // TODO(jbramley): I had to increase the size of this buffer from 8KB because |
| 1608 // We can generate a lot of debug code on Arm64. | 1608 // we can generate a lot of debug code on ARM64. |
| 1609 const size_t buffer_size = 32*KB; | 1609 union { int force_alignment; byte buffer[16*KB]; } u; |
| 1610 #else | |
| 1611 const size_t buffer_size = 8*KB; | |
| 1612 #endif | |
| 1613 union { int force_alignment; byte buffer[buffer_size]; } u; | |
| 1614 | 1610 |
| 1615 // Traverse the list of builtins and generate an adaptor in a | 1611 // Traverse the list of builtins and generate an adaptor in a |
| 1616 // separate code object for each one. | 1612 // separate code object for each one. |
| 1617 for (int i = 0; i < builtin_count; i++) { | 1613 for (int i = 0; i < builtin_count; i++) { |
| 1618 if (create_heap_objects) { | 1614 if (create_heap_objects) { |
| 1619 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); | 1615 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); |
| 1620 // Generate the code/adaptor. | 1616 // Generate the code/adaptor. |
| 1621 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); | 1617 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); |
| 1622 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); | 1618 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); |
| 1623 // We pass all arguments to the generator, but it may not use all of | 1619 // We pass all arguments to the generator, but it may not use all of |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 } | 1706 } |
| 1711 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1707 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1712 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1708 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1713 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1709 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1714 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1710 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1715 #undef DEFINE_BUILTIN_ACCESSOR_C | 1711 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1716 #undef DEFINE_BUILTIN_ACCESSOR_A | 1712 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1717 | 1713 |
| 1718 | 1714 |
| 1719 } } // namespace v8::internal | 1715 } } // namespace v8::internal |
| OLD | NEW |