Index: src/runtime/runtime-classes.cc |
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc |
index 323604ffdec47047d31e14cd4600fa9e0f78e068..c13e408da63b886d35bfe3cd59ad630022da34c4 100644 |
--- a/src/runtime/runtime-classes.cc |
+++ b/src/runtime/runtime-classes.cc |
@@ -7,6 +7,7 @@ |
#include <stdlib.h> |
#include <limits> |
+#include "src/accessors.h" |
#include "src/arguments.h" |
#include "src/debug/debug.h" |
#include "src/frames-inl.h" |
@@ -188,6 +189,22 @@ RUNTIME_FUNCTION(Runtime_DefineClass) { |
end_position)); |
} |
+ |
+RUNTIME_FUNCTION(Runtime_InstallClassNameAccessor) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
+ |
+ PropertyAttributes attrs = |
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
+ // Cannot fail since this should only be called when creating an object |
+ // literal. |
+ CHECK(!JSObject::SetAccessor( |
Henrique Ferreiro
2016/11/26 22:42:24
Is this comment and CHECK still valid using SetAcc
Toon Verwaest
2016/11/28 10:40:58
Yes
|
+ object, Accessors::FunctionNameInfo(object->GetIsolate(), attrs)) |
+ .is_null()); |
+ return *object; |
+} |
+ |
namespace { |
enum class SuperMode { kLoad, kStore }; |