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/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/code-events.h" | 6 #include "src/code-events.h" |
7 #include "src/code-stub-assembler.h" | 7 #include "src/code-stub-assembler.h" |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, | 95 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, |
96 CodeAssemblerGenerator generator, | 96 CodeAssemblerGenerator generator, |
97 CallDescriptors::Key interface_descriptor, | 97 CallDescriptors::Key interface_descriptor, |
98 Code::Flags flags, const char* name) { | 98 Code::Flags flags, const char* name) { |
99 HandleScope scope(isolate); | 99 HandleScope scope(isolate); |
100 Zone zone(isolate->allocator()); | 100 Zone zone(isolate->allocator()); |
101 // The interface descriptor with given key must be initialized at this point | 101 // The interface descriptor with given key must be initialized at this point |
102 // and this construction just queries the details from the descriptors table. | 102 // and this construction just queries the details from the descriptors table. |
103 CallInterfaceDescriptor descriptor(isolate, interface_descriptor); | 103 CallInterfaceDescriptor descriptor(isolate, interface_descriptor); |
104 // Ensure descriptor is already initialized. | 104 // Ensure descriptor is already initialized. |
105 DCHECK_NOT_NULL(descriptor.GetFunctionType()); | 105 DCHECK_LE(0, descriptor.GetRegisterParameterCount()); |
106 CodeStubAssembler assembler(isolate, &zone, descriptor, flags, name); | 106 CodeStubAssembler assembler(isolate, &zone, descriptor, flags, name); |
107 generator(&assembler); | 107 generator(&assembler); |
108 Handle<Code> code = assembler.GenerateCode(); | 108 Handle<Code> code = assembler.GenerateCode(); |
109 PostBuildProfileAndTracing(isolate, *code, name); | 109 PostBuildProfileAndTracing(isolate, *code, name); |
110 return *code; | 110 return *code; |
111 } | 111 } |
112 } // anonymous namespace | 112 } // anonymous namespace |
113 | 113 |
114 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { | 114 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { |
115 DCHECK(!initialized_); | 115 DCHECK(!initialized_); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 #define DEFINE_BUILTIN_ACCESSOR(Name, ...) \ | 201 #define DEFINE_BUILTIN_ACCESSOR(Name, ...) \ |
202 Handle<Code> Builtins::Name() { \ | 202 Handle<Code> Builtins::Name() { \ |
203 Code** code_address = reinterpret_cast<Code**>(builtin_address(k##Name)); \ | 203 Code** code_address = reinterpret_cast<Code**>(builtin_address(k##Name)); \ |
204 return Handle<Code>(code_address); \ | 204 return Handle<Code>(code_address); \ |
205 } | 205 } |
206 BUILTIN_LIST_ALL(DEFINE_BUILTIN_ACCESSOR) | 206 BUILTIN_LIST_ALL(DEFINE_BUILTIN_ACCESSOR) |
207 #undef DEFINE_BUILTIN_ACCESSOR | 207 #undef DEFINE_BUILTIN_ACCESSOR |
208 | 208 |
209 } // namespace internal | 209 } // namespace internal |
210 } // namespace v8 | 210 } // namespace v8 |
OLD | NEW |