Permalink
Browse files

core, refactor: define v8 api in v8_api.h.

  • Loading branch information...
xicilion committed Oct 27, 2017
1 parent bfdedd0 commit 0260298dd463fb3ac38d2667cc19f3a6c26456ea
View
@@ -357,6 +357,7 @@
<ClInclude Include="include\ssl.h" />
<ClInclude Include="include\utf8.h" />
<ClInclude Include="include\utils.h" />
<ClInclude Include="include\v8_api.h" />
<ClInclude Include="include\version.h" />
<ClInclude Include="src\db\sql\trans.h" />
<ClInclude Include="src\gui\windows\WebView.h" />
@@ -912,6 +912,9 @@
<ClInclude Include="include\utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\v8_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
View
@@ -357,6 +357,7 @@
<ClInclude Include="include\ssl.h" />
<ClInclude Include="include\utf8.h" />
<ClInclude Include="include\utils.h" />
<ClInclude Include="include\v8_api.h" />
<ClInclude Include="include\version.h" />
<ClInclude Include="src\db\sql\trans.h" />
<ClInclude Include="src\gui\windows\WebView.h" />
@@ -912,6 +912,9 @@
<ClInclude Include="include\utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\v8_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
View
@@ -1073,9 +1073,6 @@ inline result_t SocketError()
#endif
}
exlib::string traceInfo(v8::Isolate* isolate, int32_t deep);
exlib::string traceInfo(v8::Isolate* isolate, int32_t deep, void* entry_fp, void* handle);
exlib::string getResultMessage(result_t hr);
v8::Local<v8::Value> ThrowResult(result_t hr);
void ReportException(TryCatch& try_catch, result_t hr);
View
@@ -0,0 +1,26 @@
/*
* v8_api.h
*
* Created on: Oct 27, 2017
* Author: lion
*/
#ifndef _V8_API_H_
#define _V8_API_H_
namespace fibjs {
struct V8FrameInfo {
void* entry_fp;
void* handle;
};
V8FrameInfo save_fi(v8::Isolate* isolate);
exlib::string traceInfo(v8::Isolate* isolate, int32_t deep, void* entry_fp, void* handle);
exlib::string traceInfo(v8::Isolate* isolate, int32_t deep);
} /* namespace fibjs */
#endif /* _V8_API_H_ */
@@ -14,6 +14,7 @@
#include "ifs/process.h"
#include "ifs/coroutine.h"
#include "ifs/profiler.h"
#include "v8_api.h"
namespace fibjs {
@@ -59,12 +60,6 @@ exlib::LockedList<Isolate> s_isolates;
exlib::atomic s_iso_id;
extern int32_t stack_size;
struct V8FrameInfo {
void* entry_fp;
void* handle;
};
V8FrameInfo save_fi(v8::Isolate* isolate);
Isolate::rt_base::rt_base(Isolate* cur)
: m_isolate((cur ? cur : Isolate::current()))
{
@@ -16,14 +16,10 @@
#include "v8/src/frames.h"
#include "v8/src/frames-inl.h"
#include "exlib/include/qstring.h"
#include "v8_api.h"
namespace fibjs {
struct V8FrameInfo {
void* entry_fp;
void* handle;
};
V8FrameInfo save_fi(v8::Isolate* isolate)
{
v8::internal::Isolate* v8_isolate = (v8::internal::Isolate*)isolate;
@@ -11,6 +11,7 @@
#include "ifs/encoding.h"
#include "ifs/process.h"
#include "ifs/util.h"
#include "v8_api.h"
#include <map>
#include "console.h"
#include <stdlib.h>
@@ -10,6 +10,7 @@
#include "Trigger.h"
#include "ifs/os.h"
#include "ifs/process.h"
#include "v8_api.h"
namespace fibjs {
@@ -20,8 +21,6 @@ extern int32_t stack_size;
int32_t g_spareFibers;
static int32_t g_tlsCurrent;
exlib::string traceInfo(int32_t deep, void* entry_fp, void* handle);
void init_fiber()
{
g_spareFibers = MAX_IDLE;

0 comments on commit 0260298

Please sign in to comment.