summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSWithScope.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/JSWithScope.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSWithScope.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSWithScope.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/Source/JavaScriptCore/runtime/JSWithScope.cpp b/Source/JavaScriptCore/runtime/JSWithScope.cpp
index 82f2e210f..50eff92c5 100644
--- a/Source/JavaScriptCore/runtime/JSWithScope.cpp
+++ b/Source/JavaScriptCore/runtime/JSWithScope.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2012, 2016 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,21 +26,38 @@
#include "config.h"
#include "JSWithScope.h"
-#include "Operations.h"
+#include "JSCInlines.h"
namespace JSC {
-const ClassInfo JSWithScope::s_info = { "WithScope", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSWithScope) };
+const ClassInfo JSWithScope::s_info = { "WithScope", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWithScope) };
+
+JSWithScope* JSWithScope::create(
+ VM& vm, JSGlobalObject* globalObject, JSObject* object, JSScope* next)
+{
+ Structure* structure = globalObject->withScopeStructure();
+ JSWithScope* withScope = new (NotNull, allocateCell<JSWithScope>(vm.heap)) JSWithScope(vm, structure, object, next);
+ withScope->finishCreation(vm);
+ return withScope;
+}
void JSWithScope::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSWithScope* thisObject = jsCast<JSWithScope*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
- ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
-
Base::visitChildren(thisObject, visitor);
- visitor.append(&thisObject->m_object);
+ visitor.append(thisObject->m_object);
+}
+
+Structure* JSWithScope::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
+{
+ return Structure::create(vm, globalObject, proto, TypeInfo(WithScopeType, StructureFlags), info());
+}
+
+JSWithScope::JSWithScope(VM& vm, Structure* structure, JSObject* object, JSScope* next)
+ : Base(vm, structure, next)
+ , m_object(vm, this, object)
+{
}
} // namespace JSC