chromium/v8/src/runtime/runtime-classes.cc

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdlib.h>

#include <limits>

#include "src/builtins/accessors.h"
#include "src/common/globals.h"
#include "src/common/message-template.h"
#include "src/execution/arguments-inl.h"
#include "src/execution/isolate-inl.h"
#include "src/logging/log.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/literal-objects-inl.h"
#include "src/objects/lookup-inl.h"
#include "src/objects/smi.h"
#include "src/runtime/runtime.h"

namespace v8 {
namespace internal {


RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) {}


RUNTIME_FUNCTION(Runtime_ThrowConstructorNonCallableError) {}


RUNTIME_FUNCTION(Runtime_ThrowStaticPrototypeError) {}

RUNTIME_FUNCTION(Runtime_ThrowSuperAlreadyCalledError) {}

RUNTIME_FUNCTION(Runtime_ThrowSuperNotCalled) {}

namespace {

Tagged<Object> ThrowNotSuperConstructor(Isolate* isolate,
                                        Handle<Object> constructor,
                                        DirectHandle<JSFunction> function) {}

}  // namespace

RUNTIME_FUNCTION(Runtime_ThrowNotSuperConstructor) {}

namespace {

template <typename Dictionary>
Handle<Name> KeyToName(Isolate* isolate, Handle<Object> key) {}

template <>
Handle<Name> KeyToName<NumberDictionary>(Isolate* isolate, Handle<Object> key) {}

// Gets |index|'th argument which may be a class constructor object, a class
// prototype object or a class method. In the latter case the following
// post-processing may be required:
// 1) set method's name to a concatenation of |name_prefix| and |key| if the
//    method's shared function info indicates that method does not have a
//    shared name.
template <typename Dictionary>
MaybeHandle<Object> GetMethodAndSetName(Isolate* isolate,
                                        RuntimeArguments& args,
                                        Tagged<Smi> index,
                                        DirectHandle<String> name_prefix,
                                        Handle<Object> key) {}

// Gets |index|'th argument which may be a class constructor object, a class
// prototype object or a class method.
// This is a simplified version of GetMethodAndSetName()
// function above that is used when it's guaranteed that the method has
// shared name.
Tagged<Object> GetMethodWithSharedName(Isolate* isolate, RuntimeArguments& args,
                                       Tagged<Object> index) {}

template <typename Dictionary>
Handle<Dictionary> ShallowCopyDictionaryTemplate(
    Isolate* isolate, Handle<Dictionary> dictionary_template) {}

template <typename Dictionary>
bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary,
                      RuntimeArguments& args) {}

template <typename Dictionary>
void UpdateProtectors(Isolate* isolate, Handle<JSObject> receiver,
                      DirectHandle<Dictionary> properties_dictionary) {}

void UpdateProtectors(Isolate* isolate, Handle<JSObject> receiver,
                      DirectHandle<DescriptorArray> properties_template) {}

bool AddDescriptorsByTemplate(
    Isolate* isolate, DirectHandle<Map> map,
    DirectHandle<DescriptorArray> descriptors_template,
    Handle<NumberDictionary> elements_dictionary_template,
    Handle<JSObject> receiver, RuntimeArguments& args) {}

// TODO(v8:7569): This is a workaround for the Handle vs MaybeHandle difference
// in the return types of the different Add functions:
// OrderedNameDictionary::Add returns MaybeHandle, NameDictionary::Add returns
// Handle.
template <typename T>
Handle<T> ToHandle(Handle<T> h) {}
template <typename T>
Handle<T> ToHandle(MaybeHandle<T> h) {}

template <typename Dictionary>
bool AddDescriptorsByTemplate(
    Isolate* isolate, DirectHandle<Map> map,
    Handle<Dictionary> properties_dictionary_template,
    Handle<NumberDictionary> elements_dictionary_template,
    DirectHandle<FixedArray> computed_properties, Handle<JSObject> receiver,
    RuntimeArguments& args) {}

Handle<JSObject> CreateClassPrototype(Isolate* isolate) {}

bool InitClassPrototype(Isolate* isolate,
                        DirectHandle<ClassBoilerplate> class_boilerplate,
                        Handle<JSObject> prototype,
                        Handle<HeapObject> prototype_parent,
                        DirectHandle<JSFunction> constructor,
                        RuntimeArguments& args) {}

bool InitClassConstructor(Isolate* isolate,
                          DirectHandle<ClassBoilerplate> class_boilerplate,
                          Handle<HeapObject> constructor_parent,
                          Handle<JSFunction> constructor,
                          RuntimeArguments& args) {}

MaybeHandle<Object> DefineClass(
    Isolate* isolate, DirectHandle<ClassBoilerplate> class_boilerplate,
    Handle<Object> super_class, Handle<JSFunction> constructor,
    RuntimeArguments& args) {}

}  // namespace

RUNTIME_FUNCTION(Runtime_DefineClass) {}

namespace {

enum class SuperMode {};

MaybeHandle<JSReceiver> GetSuperHolder(Isolate* isolate,
                                       Handle<JSObject> home_object,
                                       SuperMode mode, PropertyKey* key) {}

MaybeHandle<Object> LoadFromSuper(Isolate* isolate, Handle<Object> receiver,
                                  Handle<JSObject> home_object,
                                  PropertyKey* key) {}

}  // anonymous namespace

RUNTIME_FUNCTION(Runtime_LoadFromSuper) {}


RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {}

namespace {

MaybeHandle<Object> StoreToSuper(Isolate* isolate, Handle<JSObject> home_object,
                                 Handle<Object> receiver, PropertyKey* key,
                                 Handle<Object> value,
                                 StoreOrigin store_origin) {}

}  // anonymous namespace

RUNTIME_FUNCTION(Runtime_StoreToSuper) {}

RUNTIME_FUNCTION(Runtime_StoreKeyedToSuper) {}

}  // namespace internal
}  // namespace v8