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/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
11 #include "src/bootstrapper.h" | 11 #include "src/bootstrapper.h" |
12 #include "src/elements.h" | 12 #include "src/elements.h" |
13 #include "src/frames-inl.h" | 13 #include "src/frames-inl.h" |
14 #include "src/full-codegen/full-codegen.h" | |
ulan
2015/10/21 12:26:51
Let's not add dependency on full-codegen for built
| |
14 #include "src/gdb-jit.h" | 15 #include "src/gdb-jit.h" |
15 #include "src/ic/handler-compiler.h" | 16 #include "src/ic/handler-compiler.h" |
16 #include "src/ic/ic.h" | 17 #include "src/ic/ic.h" |
17 #include "src/isolate-inl.h" | 18 #include "src/isolate-inl.h" |
18 #include "src/messages.h" | 19 #include "src/messages.h" |
19 #include "src/profiler/cpu-profiler.h" | 20 #include "src/profiler/cpu-profiler.h" |
20 #include "src/prototype.h" | 21 #include "src/prototype.h" |
21 #include "src/vm-state-inl.h" | 22 #include "src/vm-state-inl.h" |
22 | 23 |
23 namespace v8 { | 24 namespace v8 { |
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2088 | 2089 |
2089 const BuiltinDesc* functions = builtin_function_table.functions(); | 2090 const BuiltinDesc* functions = builtin_function_table.functions(); |
2090 | 2091 |
2091 // For now we generate builtin adaptor code into a stack-allocated | 2092 // For now we generate builtin adaptor code into a stack-allocated |
2092 // buffer, before copying it into individual code objects. Be careful | 2093 // buffer, before copying it into individual code objects. Be careful |
2093 // with alignment, some platforms don't like unaligned code. | 2094 // with alignment, some platforms don't like unaligned code. |
2094 #ifdef DEBUG | 2095 #ifdef DEBUG |
2095 // We can generate a lot of debug code on Arm64. | 2096 // We can generate a lot of debug code on Arm64. |
2096 const size_t buffer_size = 32*KB; | 2097 const size_t buffer_size = 32*KB; |
2097 #else | 2098 #else |
2098 const size_t buffer_size = 8*KB; | 2099 const size_t buffer_size = |
2100 ((8 * FullCodeGenerator::kCodeSizeMultiplier) / 100) * KB; | |
2099 #endif | 2101 #endif |
2100 union { int force_alignment; byte buffer[buffer_size]; } u; | 2102 union { int force_alignment; byte buffer[buffer_size]; } u; |
2101 | 2103 |
2102 // Traverse the list of builtins and generate an adaptor in a | 2104 // Traverse the list of builtins and generate an adaptor in a |
2103 // separate code object for each one. | 2105 // separate code object for each one. |
2104 for (int i = 0; i < builtin_count; i++) { | 2106 for (int i = 0; i < builtin_count; i++) { |
2105 if (create_heap_objects) { | 2107 if (create_heap_objects) { |
2106 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); | 2108 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); |
2107 // Generate the code/adaptor. | 2109 // Generate the code/adaptor. |
2108 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); | 2110 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2199 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2201 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
2200 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2202 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
2201 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2203 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
2202 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2204 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
2203 #undef DEFINE_BUILTIN_ACCESSOR_C | 2205 #undef DEFINE_BUILTIN_ACCESSOR_C |
2204 #undef DEFINE_BUILTIN_ACCESSOR_A | 2206 #undef DEFINE_BUILTIN_ACCESSOR_A |
2205 | 2207 |
2206 | 2208 |
2207 } // namespace internal | 2209 } // namespace internal |
2208 } // namespace v8 | 2210 } // namespace v8 |
OLD | NEW |