Skip to content

Commit

Permalink
Enable the debugger by default in host builds
Browse files Browse the repository at this point in the history
Summary:
Always enable the Hermes debugger in host builds to decrease the number
of supported configurations.

Reviewed By: willholen

Differential Revision: D20969039

fbshipit-source-id: 2ab5cb3aa5abf911ae60d20f0b8eb30bc04a3b3a
  • Loading branch information
tmikov authored and facebook-github-bot committed Apr 11, 2020
1 parent 181f6c6 commit 0d9a5a1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ include(Lit)
set(HERMES_RELEASE_VERSION ${PROJECT_VERSION}${VERSION_SUFFIX})

# Project options.

set(HERMES_IS_ANDROID OFF CACHE BOOL
"Building for Android")

set(HERMES_IS_MOBILE_BUILD ${HERMES_IS_ANDROID} CACHE BOOL
"Building for a mobile device")

set(HERMESVM_GCKIND NONCONTIG_GENERATIONAL
CACHE STRING
"HermesVM GC type: either NONCONTIG_GENERATIONAL or MALLOC")
Expand Down Expand Up @@ -119,7 +126,11 @@ set(HERMES_SLOW_DEBUG ON CACHE BOOL
set(HERMES_STATIC_LINK OFF CACHE BOOL
"Link Hermes statically. May only work on GNU/Linux.")

set(HERMES_ENABLE_DEBUGGER OFF CACHE BOOL
set(HERMES_ENABLE_DEBUGGER_DEFAULT OFF)
if (NOT HERMES_IS_MOBILE_BUILD)
set(HERMES_ENABLE_DEBUGGER_DEFAULT ON)
endif()
set(HERMES_ENABLE_DEBUGGER ${HERMES_ENABLE_DEBUGGER_DEFAULT} CACHE BOOL
"Build with debugger support")

set(HERMES_ENABLE_IR_INSTRUMENTATION OFF CACHE BOOL
Expand All @@ -146,12 +157,6 @@ set(HERMESVM_JIT_DISASSEMBLER OFF CACHE BOOL
set(HERMES_USE_FLOWPARSER OFF CACHE BOOL
"Use libflowparser for parsing es6")

set(HERMES_IS_MOBILE_BUILD OFF CACHE BOOL
"Building for a mobile device")

set(HERMES_IS_ANDROID OFF CACHE BOOL
"Building for Android")

set(HERMES_ENABLE_WERROR OFF CACHE BOOL
"Whether the build should have -Werror enabled")

Expand Down
8 changes: 1 addition & 7 deletions lib/InternalBytecode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ add_hermes_library(hermesInternalBytecode
InternalBytecode.cpp
)

# Only enable optimized libraries if the Hermes debugger isn't on.
# This allows the user to debug the JS libraries.
if(HERMES_ENABLE_DEBUGGER)
set(JS_COMPILER_FLAGS "")
else()
set(JS_COMPILER_FLAGS "-O")
endif()
set(JS_COMPILER_FLAGS "-O")

# Concatenate all JS files into one source file for compilation.
# This way there is only one RuntimeModule made for them.
Expand Down
3 changes: 2 additions & 1 deletion lib/VM/Profiler/InlineCacheProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifdef HERMESVM_PROFILER_BB
#ifndef INLINECACHE_PROFILER_H
#include "hermes/VM/Profiler/InlineCacheProfiler.h"
#include "hermes/Support/Algorithms.h"
#include "hermes/VM/CodeBlock.h"
#include "hermes/VM/Handle.h"
#include "hermes/VM/HiddenClass.h"
Expand Down Expand Up @@ -116,7 +117,7 @@ void InlineCacheProfiler::dumpHiddenClassProperties(
std::unique_ptr<InlineCacheProfiler::ICMissList>
InlineCacheProfiler::getRankedInlineCachingMisses() {
std::unique_ptr<InlineCacheProfiler::ICMissList> icInfoList =
std::make_unique<InlineCacheProfiler::ICMissList>();
hermes::make_unique<InlineCacheProfiler::ICMissList>();
// rank inline caching miss information
for (auto itr = cacheMisses_.begin(); itr != cacheMisses_.end(); ++itr) {
icInfoList->push_back(*itr);
Expand Down
3 changes: 2 additions & 1 deletion unittests/VMRuntime/HeapSnapshotTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "TestHelpers.h"
#include "gtest/gtest.h"
#include "hermes/Parser/JSONParser.h"
#include "hermes/Support/Algorithms.h"
#include "hermes/Support/Allocator.h"
#include "hermes/VM/CellKind.h"
#include "hermes/VM/GC.h"
Expand Down Expand Up @@ -788,7 +789,7 @@ struct ChromeStackTreeNode {
llvm::cast<JSONNumber>(traceNodes[i + 1])->getValue();
auto children = llvm::cast<JSONArray>(traceNodes[i + 4]);
auto treeNode =
std::make_unique<ChromeStackTreeNode>(parent, functionInfoIndex);
hermes::make_unique<ChromeStackTreeNode>(parent, functionInfoIndex);
idNodeMap.emplace(id, treeNode.get());
treeNode->children_ = parse(*children, treeNode.get(), idNodeMap);
res.emplace_back(std::move(treeNode));
Expand Down

0 comments on commit 0d9a5a1

Please sign in to comment.