Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: updating platform shim
Browse files Browse the repository at this point in the history
PR-URL: #329
Reviewed-By: Jimmy Thomson <[email protected]>
  • Loading branch information
kfarnung committed Aug 10, 2017
1 parent 1b6dd4c commit 281cd64
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
29 changes: 29 additions & 0 deletions deps/chakrashim/include/libplatform/libplatform-export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2016 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.

#ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
#define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_

#if defined(_WIN32)

#ifdef BUILDING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __declspec(dllexport)
#elif USING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __declspec(dllimport)
#else
#define V8_PLATFORM_EXPORT
#endif // BUILDING_V8_PLATFORM_SHARED

#else // defined(_WIN32)

// Setup for Linux shared library export.
#ifdef BUILDING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __attribute__((visibility("default")))
#else
#define V8_PLATFORM_EXPORT
#endif

#endif // defined(_WIN32)

#endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
11 changes: 10 additions & 1 deletion deps/chakrashim/include/libplatform/libplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@
#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
#define V8_LIBPLATFORM_LIBPLATFORM_H_

#include "libplatform/libplatform-export.h"
#include "libplatform/v8-tracing.h"
#include "include/v8-platform.h"

namespace v8 {
namespace platform {

v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0);
enum class IdleTaskSupport { kDisabled, kEnabled };
enum class InProcessStackDumping { kDisabled, kEnabled };

V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform(
int thread_pool_size = 0,
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
InProcessStackDumping in_process_stack_dumping =
InProcessStackDumping::kEnabled);

bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate);

/**
Expand Down
5 changes: 4 additions & 1 deletion deps/chakrashim/src/v8v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "v8chakra.h"
#include "jsrtutils.h"
#include "v8-debug.h"
#include "libplatform/libplatform.h"
#include "libplatform/v8-tracing.h"
#include "jsrtplatform.h"

Expand Down Expand Up @@ -210,7 +211,9 @@ void V8::ToLocalEmpty() {
}

namespace platform {
v8::Platform* CreateDefaultPlatform(int thread_pool_size) {
v8::Platform* CreateDefaultPlatform(
int thread_pool_size, IdleTaskSupport idle_task_support,
InProcessStackDumping in_process_stack_dumping) {
jsrt::DefaultPlatform* platform = new jsrt::DefaultPlatform();
return platform;
}
Expand Down

0 comments on commit 281cd64

Please sign in to comment.