Remove jerry-internal.h (#1782)

The internal header was a legacy, declared two functions only. One
of them was not used anymore at all, the other was used at a single
call site. Moreover, their documentation was outdated. This patch
removes the header and the related function implementations -- as
well as the temptation to use such internal functions from outside
the library.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2017-04-26 01:05:33 +02:00
committed by yichoi
parent fdbbd0e8af
commit d48db1d5bd
5 changed files with 5 additions and 101 deletions
-3
View File
@@ -38,9 +38,6 @@
#include "ecma-promise-object.h"
#endif
#define JERRY_INTERNAL
#include "jerry-internal.h"
/* TODO: Extract GC to a separate component */
/** \addtogroup ecma ECMA
@@ -27,9 +27,6 @@
#include "ecma-try-catch-macro.h"
#include "jcontext.h"
#define JERRY_INTERNAL
#include "jerry-internal.h"
/** \addtogroup ecma ECMA
* @{
*
@@ -539,12 +536,12 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
else if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
{
ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
jerry_external_handler_t handler_p = (jerry_external_handler_t) ext_func_obj_p->u.external_function;
ret_value = jerry_dispatch_external_function (func_obj_p,
ext_func_obj_p->u.external_function,
this_arg_value,
arguments_list_p,
arguments_list_len);
ret_value = handler_p (ecma_make_object_value (func_obj_p),
this_arg_value,
arguments_list_p,
arguments_list_len);
}
else
{
-36
View File
@@ -1,36 +0,0 @@
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef JERRY_INTERNAL
# error "The header is for Jerry's internal interfaces"
#endif /* !JERRY_INTERNAL */
#ifndef JERRY_INTERNAL_H
#define JERRY_INTERNAL_H
#include "ecma-globals.h"
#include "jerryscript.h"
ecma_value_t
jerry_dispatch_external_function (ecma_object_t *function_object_p,
ecma_external_pointer_t handler_p,
ecma_value_t this_arg_value,
const ecma_value_t *arguments_list_p,
ecma_length_t arguments_list_len);
void
jerry_dispatch_object_free_callback (ecma_external_pointer_t freecb_p, ecma_external_pointer_t native_p);
#endif /* !JERRY_INTERNAL_H */
-51
View File
@@ -35,9 +35,6 @@
#include "js-parser.h"
#include "re-compiler.h"
#define JERRY_INTERNAL
#include "jerry-internal.h"
JERRY_STATIC_ASSERT (sizeof (jerry_value_t) == sizeof (ecma_value_t),
size_of_jerry_value_t_must_be_equal_to_size_of_ecma_value_t);
@@ -2151,51 +2148,3 @@ jerry_is_valid_cesu8_string (const jerry_char_t *cesu8_buf_p, /**< CESU-8 string
/**
* @}
*/
/**
* ====================== Internal functions ==========================
*/
/**
* Dispatch call to specified external function using the native handler
*
* Note:
* returned value must be freed with jerry_release_value, when it is no longer needed.
*
* @return returned ecma value of the invoked native function - if success
* thrown error - otherwise
*/
ecma_value_t
jerry_dispatch_external_function (ecma_object_t *function_object_p, /**< external function object */
ecma_external_pointer_t handler_p, /**< pointer to the function's native handler */
ecma_value_t this_arg_value, /**< 'this' argument */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< arguments list length */
{
jerry_assert_api_available ();
ecma_value_t ret_value = ((jerry_external_handler_t) handler_p) (ecma_make_object_value (function_object_p),
this_arg_value,
arguments_list_p,
arguments_list_len);
return ret_value;
} /* jerry_dispatch_external_function */
/**
* Dispatch call to object's native free callback function
*
* Note:
* the callback is called during critical GC phase,
* so should not perform any requests to engine.
*/
void
jerry_dispatch_object_free_callback (ecma_external_pointer_t freecb_p, /**< pointer to free callback handler */
ecma_external_pointer_t native_p) /**< native handle, associated
* with freed object */
{
jerry_make_api_unavailable ();
((jerry_object_free_callback_t) freecb_p) ((uintptr_t) native_p);
jerry_make_api_available ();
} /* jerry_dispatch_object_free_callback */
-3
View File
@@ -20,9 +20,6 @@
#include "jrt.h"
#include "jrt-libc-includes.h"
#define JERRY_INTERNAL
#include "jerry-internal.h"
/*
* Exit with specified status code.
*