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

Side by Side Diff: src/builtins/setup-builtins-internal.cc

Issue 2900683002: [compiler] Delay allocation of code-embedded heap numbers. (Closed)
Patch Set: Fix rebase. Created 3 years, 6 months 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.cc ('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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/setup-isolate.h" 5 #include "src/setup-isolate.h"
6 6
7 #include "src/builtins/builtins.h" 7 #include "src/builtins/builtins.h"
8 #include "src/code-events.h" 8 #include "src/code-events.h"
9 #include "src/compiler/code-assembler.h" 9 #include "src/compiler/code-assembler.h"
10 #include "src/interface-descriptors.h" 10 #include "src/interface-descriptors.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 HandleScope scope(isolate); 43 HandleScope scope(isolate);
44 // Canonicalize handles, so that we can share constant pool entries pointing 44 // Canonicalize handles, so that we can share constant pool entries pointing
45 // to code targets without dereferencing their handles. 45 // to code targets without dereferencing their handles.
46 CanonicalHandleScope canonical(isolate); 46 CanonicalHandleScope canonical(isolate);
47 const size_t buffer_size = 32 * KB; 47 const size_t buffer_size = 32 * KB;
48 byte buffer[buffer_size]; // NOLINT(runtime/arrays) 48 byte buffer[buffer_size]; // NOLINT(runtime/arrays)
49 MacroAssembler masm(isolate, buffer, buffer_size, CodeObjectRequired::kYes); 49 MacroAssembler masm(isolate, buffer, buffer_size, CodeObjectRequired::kYes);
50 DCHECK(!masm.has_frame()); 50 DCHECK(!masm.has_frame());
51 generator(&masm); 51 generator(&masm);
52 CodeDesc desc; 52 CodeDesc desc;
53 masm.GetCode(&desc); 53 masm.GetCode(isolate, &desc);
54 Handle<Code> code = 54 Handle<Code> code =
55 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); 55 isolate->factory()->NewCode(desc, flags, masm.CodeObject());
56 PostBuildProfileAndTracing(isolate, *code, s_name); 56 PostBuildProfileAndTracing(isolate, *code, s_name);
57 return *code; 57 return *code;
58 } 58 }
59 59
60 Code* BuildAdaptor(Isolate* isolate, Address builtin_address, 60 Code* BuildAdaptor(Isolate* isolate, Address builtin_address,
61 Builtins::ExitFrameType exit_frame_type, Code::Flags flags, 61 Builtins::ExitFrameType exit_frame_type, Code::Flags flags,
62 const char* name) { 62 const char* name) {
63 HandleScope scope(isolate); 63 HandleScope scope(isolate);
64 // Canonicalize handles, so that we can share constant pool entries pointing 64 // Canonicalize handles, so that we can share constant pool entries pointing
65 // to code targets without dereferencing their handles. 65 // to code targets without dereferencing their handles.
66 CanonicalHandleScope canonical(isolate); 66 CanonicalHandleScope canonical(isolate);
67 const size_t buffer_size = 32 * KB; 67 const size_t buffer_size = 32 * KB;
68 byte buffer[buffer_size]; // NOLINT(runtime/arrays) 68 byte buffer[buffer_size]; // NOLINT(runtime/arrays)
69 MacroAssembler masm(isolate, buffer, buffer_size, CodeObjectRequired::kYes); 69 MacroAssembler masm(isolate, buffer, buffer_size, CodeObjectRequired::kYes);
70 DCHECK(!masm.has_frame()); 70 DCHECK(!masm.has_frame());
71 Builtins::Generate_Adaptor(&masm, builtin_address, exit_frame_type); 71 Builtins::Generate_Adaptor(&masm, builtin_address, exit_frame_type);
72 CodeDesc desc; 72 CodeDesc desc;
73 masm.GetCode(&desc); 73 masm.GetCode(isolate, &desc);
74 Handle<Code> code = 74 Handle<Code> code =
75 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); 75 isolate->factory()->NewCode(desc, flags, masm.CodeObject());
76 PostBuildProfileAndTracing(isolate, *code, name); 76 PostBuildProfileAndTracing(isolate, *code, name);
77 return *code; 77 return *code;
78 } 78 }
79 79
80 // Builder for builtins implemented in TurboFan with JS linkage. 80 // Builder for builtins implemented in TurboFan with JS linkage.
81 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate, 81 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate,
82 CodeAssemblerGenerator generator, int argc, 82 CodeAssemblerGenerator generator, int argc,
83 Code::Flags flags, const char* name) { 83 Code::Flags flags, const char* name) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 ->set_has_tagged_params(false); 207 ->set_has_tagged_params(false);
208 208
209 BUILTINS_WITH_UNTAGGED_PARAMS(SET_CODE_NON_TAGGED_PARAMS) 209 BUILTINS_WITH_UNTAGGED_PARAMS(SET_CODE_NON_TAGGED_PARAMS)
210 #undef SET_CODE_NON_TAGGED_PARAMS 210 #undef SET_CODE_NON_TAGGED_PARAMS
211 211
212 isolate->builtins()->MarkInitialized(); 212 isolate->builtins()->MarkInitialized();
213 } 213 }
214 214
215 } // namespace internal 215 } // namespace internal
216 } // namespace v8 216 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698