Commit 133c1fca authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[torque] Make AllocatedSize const

This is a partial reland of https://crrev.com/c/v8/v8/+/2601880 .

Change-Id: I7ad9ca42201c49df7037e65671a50caabc1fdf98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2705256Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#72961}
parent d2cb2ae6
...@@ -3912,9 +3912,9 @@ void CppClassGenerator::GenerateClass() { ...@@ -3912,9 +3912,9 @@ void CppClassGenerator::GenerateClass() {
const Field& last_field = type_->LastField(); const Field& last_field = type_->LastField();
std::string last_field_item_size = std::string last_field_item_size =
std::get<1>(*SizeOf(last_field.name_and_type.type)); std::get<1>(*SizeOf(last_field.name_and_type.type));
hdr_ << " inline int AllocatedSize();\n\n"; hdr_ << " inline int AllocatedSize() const;\n\n";
inl_ << "template <class D, class P>\n"; inl_ << "template <class D, class P>\n";
inl_ << "int " << gen_name_T_ << "::AllocatedSize() {\n"; inl_ << "int " << gen_name_T_ << "::AllocatedSize() const {\n";
inl_ << " auto slice = " inl_ << " auto slice = "
<< Callable::PrefixNameForCCOutput( << Callable::PrefixNameForCCOutput(
type_->GetSliceMacroName(last_field)) type_->GetSliceMacroName(last_field))
...@@ -3954,7 +3954,7 @@ void CppClassGenerator::GenerateClass() { ...@@ -3954,7 +3954,7 @@ void CppClassGenerator::GenerateClass() {
} }
hdr_ << " return size;\n"; hdr_ << " return size;\n";
hdr_ << " }\n\n"; hdr_ << " }\n\n";
hdr_ << " V8_INLINE int32_t AllocatedSize() {\n"; hdr_ << " V8_INLINE int32_t AllocatedSize() const {\n";
hdr_ << " return SizeFor("; hdr_ << " return SizeFor(";
first = true; first = true;
for (auto field : *index_fields) { for (auto field : *index_fields) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment