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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 Handle<Code> new_object = factory->NewCode( | 244 Handle<Code> new_object = factory->NewCode( |
245 desc, GetCodeFlags(), masm.CodeObject(), NeedsImmovableCode()); | 245 desc, GetCodeFlags(), masm.CodeObject(), NeedsImmovableCode()); |
246 return new_object; | 246 return new_object; |
247 } | 247 } |
248 | 248 |
249 Handle<Code> HydrogenCodeStub::GenerateRuntimeTailCall( | 249 Handle<Code> HydrogenCodeStub::GenerateRuntimeTailCall( |
250 CodeStubDescriptor* descriptor) { | 250 CodeStubDescriptor* descriptor) { |
251 const char* name = CodeStub::MajorName(MajorKey()); | 251 const char* name = CodeStub::MajorName(MajorKey()); |
252 Zone zone(isolate()->allocator(), ZONE_NAME); | 252 Zone zone(isolate()->allocator(), ZONE_NAME); |
253 CallInterfaceDescriptor interface_descriptor(GetCallInterfaceDescriptor()); | 253 CallInterfaceDescriptor interface_descriptor(GetCallInterfaceDescriptor()); |
254 CodeStubAssembler assembler(isolate(), &zone, interface_descriptor, | 254 compiler::CodeAssemblerState state(isolate(), &zone, interface_descriptor, |
255 GetCodeFlags(), name); | 255 GetCodeFlags(), name); |
| 256 CodeStubAssembler assembler(&state); |
256 int total_params = interface_descriptor.GetStackParameterCount() + | 257 int total_params = interface_descriptor.GetStackParameterCount() + |
257 interface_descriptor.GetRegisterParameterCount(); | 258 interface_descriptor.GetRegisterParameterCount(); |
258 switch (total_params) { | 259 switch (total_params) { |
259 case 0: | 260 case 0: |
260 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 261 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
261 assembler.Parameter(0)); | 262 assembler.Parameter(0)); |
262 break; | 263 break; |
263 case 1: | 264 case 1: |
264 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 265 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
265 assembler.Parameter(1), assembler.Parameter(0)); | 266 assembler.Parameter(1), assembler.Parameter(0)); |
(...skipping 11 matching lines...) Expand all Loading... |
277 case 4: | 278 case 4: |
278 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 279 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
279 assembler.Parameter(4), assembler.Parameter(0), | 280 assembler.Parameter(4), assembler.Parameter(0), |
280 assembler.Parameter(1), assembler.Parameter(2), | 281 assembler.Parameter(1), assembler.Parameter(2), |
281 assembler.Parameter(3)); | 282 assembler.Parameter(3)); |
282 break; | 283 break; |
283 default: | 284 default: |
284 UNIMPLEMENTED(); | 285 UNIMPLEMENTED(); |
285 break; | 286 break; |
286 } | 287 } |
287 return assembler.GenerateCode(); | 288 return compiler::CodeAssembler::GenerateCode(&state); |
288 } | 289 } |
289 | 290 |
290 template <class Stub> | 291 template <class Stub> |
291 static Handle<Code> DoGenerateCode(Stub* stub) { | 292 static Handle<Code> DoGenerateCode(Stub* stub) { |
292 Isolate* isolate = stub->isolate(); | 293 Isolate* isolate = stub->isolate(); |
293 CodeStubDescriptor descriptor(stub); | 294 CodeStubDescriptor descriptor(stub); |
294 | 295 |
295 if (FLAG_minimal && descriptor.has_miss_handler()) { | 296 if (FLAG_minimal && descriptor.has_miss_handler()) { |
296 return stub->GenerateRuntimeTailCall(&descriptor); | 297 return stub->GenerateRuntimeTailCall(&descriptor); |
297 } | 298 } |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); | 1149 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); |
1149 } | 1150 } |
1150 | 1151 |
1151 | 1152 |
1152 Handle<Code> LoadDictionaryElementStub::GenerateCode() { | 1153 Handle<Code> LoadDictionaryElementStub::GenerateCode() { |
1153 return DoGenerateCode(this); | 1154 return DoGenerateCode(this); |
1154 } | 1155 } |
1155 | 1156 |
1156 } // namespace internal | 1157 } // namespace internal |
1157 } // namespace v8 | 1158 } // namespace v8 |
OLD | NEW |