OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/linkage.h" | 5 #include "src/compiler/linkage.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { | 45 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { |
46 // TODO(svenpanne) Output properties etc. and be less cryptic. | 46 // TODO(svenpanne) Output properties etc. and be less cryptic. |
47 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() | 47 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() |
48 << "s" << d.StackParameterCount() << "i" << d.InputCount() << "f" | 48 << "s" << d.StackParameterCount() << "i" << d.InputCount() << "f" |
49 << d.FrameStateCount() << "t" << d.SupportsTailCalls(); | 49 << d.FrameStateCount() << "t" << d.SupportsTailCalls(); |
50 } | 50 } |
51 | 51 |
52 MachineSignature* CallDescriptor::GetMachineSignature(Zone* zone) const { | 52 MachineSignature* CallDescriptor::GetMachineSignature(Zone* zone) const { |
53 size_t param_count = ParameterCount(); | 53 size_t param_count = ParameterCount(); |
54 size_t return_count = ReturnCount(); | 54 size_t return_count = ReturnCount(); |
55 MachineType* types = reinterpret_cast<MachineType*>( | 55 MachineType* types = zone->NewArray<MachineType>(param_count + return_count); |
56 zone->New(sizeof(MachineType*) * (param_count + return_count))); | |
57 int current = 0; | 56 int current = 0; |
58 for (size_t i = 0; i < return_count; ++i) { | 57 for (size_t i = 0; i < return_count; ++i) { |
59 types[current++] = GetReturnType(i); | 58 types[current++] = GetReturnType(i); |
60 } | 59 } |
61 for (size_t i = 0; i < param_count; ++i) { | 60 for (size_t i = 0; i < param_count; ++i) { |
62 types[current++] = GetParameterType(i); | 61 types[current++] = GetParameterType(i); |
63 } | 62 } |
64 return new (zone) MachineSignature(return_count, param_count, types); | 63 return new (zone) MachineSignature(return_count, param_count, types); |
65 } | 64 } |
66 | 65 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 DCHECK(loc == regloc(kContextRegister, MachineType::AnyTagged())); | 504 DCHECK(loc == regloc(kContextRegister, MachineType::AnyTagged())); |
506 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot, | 505 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot, |
507 MachineType::AnyTagged()); | 506 MachineType::AnyTagged()); |
508 } | 507 } |
509 } | 508 } |
510 | 509 |
511 | 510 |
512 } // namespace compiler | 511 } // namespace compiler |
513 } // namespace internal | 512 } // namespace internal |
514 } // namespace v8 | 513 } // namespace v8 |
OLD | NEW |