summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/smi.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/smi.h')
-rw-r--r--deps/v8/src/objects/smi.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/deps/v8/src/objects/smi.h b/deps/v8/src/objects/smi.h
index 938fc5504d..0f93f37458 100644
--- a/deps/v8/src/objects/smi.h
+++ b/deps/v8/src/objects/smi.h
@@ -5,7 +5,7 @@
#ifndef V8_OBJECTS_SMI_H_
#define V8_OBJECTS_SMI_H_
-#include "src/globals.h"
+#include "src/common/globals.h"
#include "src/objects/heap-object.h"
// Has to be the last include (doesn't have include guards):
@@ -41,7 +41,9 @@ class Smi : public Object {
}
// Convert a Smi object to an int.
- static inline int ToInt(const Object object);
+ static inline int ToInt(const Object object) {
+ return Smi::cast(object).value();
+ }
// Convert a value to a Smi object.
static inline constexpr Smi FromInt(int value) {
@@ -107,6 +109,8 @@ class Smi : public Object {
static constexpr int kMaxValue = kSmiMaxValue;
};
+CAST_ACCESSOR(Smi)
+
} // namespace internal
} // namespace v8