Merge instance into context (#2501)

There was quite some confusion about terminology around instances
and contexts. All the docs mentioned external contexts but
functions and types were referring to instances, and the relation
between these two concepts were not clear. This commit keeps
(external) context as the only surviving concept.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-09-04 13:56:49 +02:00
committed by GitHub
parent d3d42f7685
commit 30b7a72344
9 changed files with 145 additions and 140 deletions
+12 -12
View File
@@ -17,27 +17,27 @@
#include "jerryscript-port-default.h"
/**
* Pointer to the current instance.
* Pointer to the current context.
* Note that it is a global variable, and is not a thread safe implementation.
*/
static jerry_instance_t *current_instance_p = NULL;
static jerry_context_t *current_context_p = NULL;
/**
* Set the current_instance_p as the passed pointer.
* Set the current_context_p as the passed pointer.
*/
void
jerry_port_default_set_instance (jerry_instance_t *instance_p) /**< points to the created instance */
jerry_port_default_set_context (jerry_context_t *context_p) /**< points to the created context */
{
current_instance_p = instance_p;
} /* jerry_port_default_set_instance */
current_context_p = context_p;
} /* jerry_port_default_set_context */
/**
* Get the current instance.
* Get the current context.
*
* @return the pointer to the current instance
* @return the pointer to the current context
*/
jerry_instance_t *
jerry_port_get_current_instance (void)
jerry_context_t *
jerry_port_get_current_context (void)
{
return current_instance_p;
} /* jerry_port_get_current_instance */
return current_context_p;
} /* jerry_port_get_current_context */
@@ -37,7 +37,7 @@ bool jerry_port_default_is_abort_on_fail (void);
jerry_log_level_t jerry_port_default_get_log_level (void);
void jerry_port_default_set_log_level (jerry_log_level_t level);
void jerry_port_default_set_instance (jerry_instance_t *instance_p);
void jerry_port_default_set_context (jerry_context_t *context_p);
/**
* @}