Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/builtins.cc

Issue 1476763002: Make whether or not a Code object should be created by masm explicit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enum class FTW Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/assembler.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 const size_t buffer_size = 10 * KB; 2299 const size_t buffer_size = 10 * KB;
2300 #else 2300 #else
2301 const size_t buffer_size = 8*KB; 2301 const size_t buffer_size = 8*KB;
2302 #endif 2302 #endif
2303 union { int force_alignment; byte buffer[buffer_size]; } u; 2303 union { int force_alignment; byte buffer[buffer_size]; } u;
2304 2304
2305 // Traverse the list of builtins and generate an adaptor in a 2305 // Traverse the list of builtins and generate an adaptor in a
2306 // separate code object for each one. 2306 // separate code object for each one.
2307 for (int i = 0; i < builtin_count; i++) { 2307 for (int i = 0; i < builtin_count; i++) {
2308 if (create_heap_objects) { 2308 if (create_heap_objects) {
2309 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); 2309 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer,
2310 CodeObjectRequired::kYes);
2310 // Generate the code/adaptor. 2311 // Generate the code/adaptor.
2311 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); 2312 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments);
2312 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); 2313 Generator g = FUNCTION_CAST<Generator>(functions[i].generator);
2313 // We pass all arguments to the generator, but it may not use all of 2314 // We pass all arguments to the generator, but it may not use all of
2314 // them. This works because the first arguments are on top of the 2315 // them. This works because the first arguments are on top of the
2315 // stack. 2316 // stack.
2316 DCHECK(!masm.has_frame()); 2317 DCHECK(!masm.has_frame());
2317 g(&masm, functions[i].name, functions[i].extra_args); 2318 g(&masm, functions[i].name, functions[i].extra_args);
2318 // Move the code into the object heap. 2319 // Move the code into the object heap.
2319 CodeDesc desc; 2320 CodeDesc desc;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
2402 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2403 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2403 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2404 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2404 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2405 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2405 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2406 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2406 #undef DEFINE_BUILTIN_ACCESSOR_C 2407 #undef DEFINE_BUILTIN_ACCESSOR_C
2407 #undef DEFINE_BUILTIN_ACCESSOR_A 2408 #undef DEFINE_BUILTIN_ACCESSOR_A
2408 2409
2409 2410
2410 } // namespace internal 2411 } // namespace internal
2411 } // namespace v8 2412 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698