Commit 41925b95 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[test] Add missing field definitions

Even static constant fields need to have definitions outside of the
class scope if a reference to them is passed.
This CL fixes link errors which occured on an independent CL
(https://crrev.com/c/730716).

Drive-by: Make the fields constexpr.

R=mstarzinger@chromium.org

Change-Id: Iff5dd1f3d41ddfba0c20531dbecd63c1d4c670e8
Reviewed-on: https://chromium-review.googlesource.com/732114Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48816}
parent b4c832eb
...@@ -257,20 +257,20 @@ class TestEnvironment : public HandleAndZoneScope { ...@@ -257,20 +257,20 @@ class TestEnvironment : public HandleAndZoneScope {
public: public:
// These constants may be tuned to experiment with different environments. // These constants may be tuned to experiment with different environments.
static const int kGeneralRegisterCount = 4; static constexpr int kGeneralRegisterCount = 4;
static const int kDoubleRegisterCount = 6; static constexpr int kDoubleRegisterCount = 6;
static const int kTaggedSlotCount = 64; static constexpr int kTaggedSlotCount = 64;
static const int kFloat32SlotCount = 64; static constexpr int kFloat32SlotCount = 64;
static const int kFloat64SlotCount = 64; static constexpr int kFloat64SlotCount = 64;
static const int kStackParameterCount = static constexpr int kStackParameterCount =
kTaggedSlotCount + kFloat32SlotCount + kFloat64SlotCount; kTaggedSlotCount + kFloat32SlotCount + kFloat64SlotCount;
// TODO(all): Test all types of constants (e.g. ExternalReference and // TODO(all): Test all types of constants (e.g. ExternalReference and
// HeapObject). // HeapObject).
static const int kSmiConstantCount = 4; static constexpr int kSmiConstantCount = 4;
static const int kFloatConstantCount = 4; static constexpr int kFloatConstantCount = 4;
static const int kDoubleConstantCount = 4; static constexpr int kDoubleConstantCount = 4;
TestEnvironment() TestEnvironment()
: blocks_(main_zone()), : blocks_(main_zone()),
...@@ -735,6 +735,17 @@ class TestEnvironment : public HandleAndZoneScope { ...@@ -735,6 +735,17 @@ class TestEnvironment : public HandleAndZoneScope {
allocated_slots_; allocated_slots_;
}; };
// static
constexpr int TestEnvironment::kGeneralRegisterCount;
constexpr int TestEnvironment::kDoubleRegisterCount;
constexpr int TestEnvironment::kTaggedSlotCount;
constexpr int TestEnvironment::kFloat32SlotCount;
constexpr int TestEnvironment::kFloat64SlotCount;
constexpr int TestEnvironment::kStackParameterCount;
constexpr int TestEnvironment::kSmiConstantCount;
constexpr int TestEnvironment::kFloatConstantCount;
constexpr int TestEnvironment::kDoubleConstantCount;
// Wrapper around the CodeGenerator. Code generated by this can only be called // Wrapper around the CodeGenerator. Code generated by this can only be called
// using the given `TestEnvironment`. // using the given `TestEnvironment`.
// //
......
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