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 compiler::CodeAssemblerState state(isolate(), &zone, interface_descriptor, | 254 CodeStubAssembler assembler(isolate(), &zone, interface_descriptor, |
255 GetCodeFlags(), name); | 255 GetCodeFlags(), name); |
256 CodeStubAssembler assembler(&state); | |
257 int total_params = interface_descriptor.GetStackParameterCount() + | 256 int total_params = interface_descriptor.GetStackParameterCount() + |
258 interface_descriptor.GetRegisterParameterCount(); | 257 interface_descriptor.GetRegisterParameterCount(); |
259 switch (total_params) { | 258 switch (total_params) { |
260 case 0: | 259 case 0: |
261 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 260 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
262 assembler.Parameter(0)); | 261 assembler.Parameter(0)); |
263 break; | 262 break; |
264 case 1: | 263 case 1: |
265 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 264 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
266 assembler.Parameter(1), assembler.Parameter(0)); | 265 assembler.Parameter(1), assembler.Parameter(0)); |
(...skipping 11 matching lines...) Expand all Loading... |
278 case 4: | 277 case 4: |
279 assembler.TailCallRuntime(descriptor->miss_handler_id(), | 278 assembler.TailCallRuntime(descriptor->miss_handler_id(), |
280 assembler.Parameter(4), assembler.Parameter(0), | 279 assembler.Parameter(4), assembler.Parameter(0), |
281 assembler.Parameter(1), assembler.Parameter(2), | 280 assembler.Parameter(1), assembler.Parameter(2), |
282 assembler.Parameter(3)); | 281 assembler.Parameter(3)); |
283 break; | 282 break; |
284 default: | 283 default: |
285 UNIMPLEMENTED(); | 284 UNIMPLEMENTED(); |
286 break; | 285 break; |
287 } | 286 } |
288 return compiler::CodeAssembler::GenerateCode(&state); | 287 return assembler.GenerateCode(); |
289 } | 288 } |
290 | 289 |
291 template <class Stub> | 290 template <class Stub> |
292 static Handle<Code> DoGenerateCode(Stub* stub) { | 291 static Handle<Code> DoGenerateCode(Stub* stub) { |
293 Isolate* isolate = stub->isolate(); | 292 Isolate* isolate = stub->isolate(); |
294 CodeStubDescriptor descriptor(stub); | 293 CodeStubDescriptor descriptor(stub); |
295 | 294 |
296 if (FLAG_minimal && descriptor.has_miss_handler()) { | 295 if (FLAG_minimal && descriptor.has_miss_handler()) { |
297 return stub->GenerateRuntimeTailCall(&descriptor); | 296 return stub->GenerateRuntimeTailCall(&descriptor); |
298 } | 297 } |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); | 1148 return BuildUncheckedDictionaryElementLoad(receiver, elements, key, hash); |
1150 } | 1149 } |
1151 | 1150 |
1152 | 1151 |
1153 Handle<Code> LoadDictionaryElementStub::GenerateCode() { | 1152 Handle<Code> LoadDictionaryElementStub::GenerateCode() { |
1154 return DoGenerateCode(this); | 1153 return DoGenerateCode(this); |
1155 } | 1154 } |
1156 | 1155 |
1157 } // namespace internal | 1156 } // namespace internal |
1158 } // namespace v8 | 1157 } // namespace v8 |
OLD | NEW |