Commit Graph

83 Commits

Author SHA1 Message Date
Pieter De Baets 9ed9bca0bf Lazily instantiate native modules
Summary: Instead of sending a list of modules over to JS on startup (and actually blocking script execution) instead provide a proxy object that constructs each of these lazily.

Reviewed By: lexs

Differential Revision: D3936979

fbshipit-source-id: 71bde822f01eb17a29f56c5e60e95e98e207d74d
2016-10-11 07:28:42 -07:00
Emil Sjolander b7ded130df Dont use explicit .so file name to support more platforms
Reviewed By: dreiss

Differential Revision: D3981166

fbshipit-source-id: 0b19f73e6de48a30613419ccc54735c968701532
2016-10-08 09:28:42 -07:00
Pieter De Baets 5200ac1ee9 Add check for nil nativeToJS bridge
Reviewed By: mhorowitz

Differential Revision: D3980922

fbshipit-source-id: ba8ba283cd186a28cd9d5c1c35d4828829864a6a
2016-10-07 08:13:38 -07:00
leeight 9a7e4b4902 Dump invalid json when call Value::fromJSON failed
Summary:
See #9117
Closes https://github.com/facebook/react-native/pull/10231

Differential Revision: D3974063

Pulled By: javache

fbshipit-source-id: 63d3ae02ae731cd5a63fcb3a645c612c57cbb8b4
2016-10-05 04:43:45 -07:00
Pieter De Baets d7d89172c2 Expose ModuleRegistry on ExecutorDelegate
Differential Revision: D3944588

fbshipit-source-id: f8450a6735e1f6283c3bfe9d2ce883327172621c
2016-10-03 05:13:38 -07:00
Hoa Dinh 5a24ea0b42 Create headers symlinks for FBReactKit
Reviewed By: javache, skotchvail

Differential Revision: D3946452

fbshipit-source-id: c6354f529bec2f9635a0ecf5f65e21dc4e17b1e4
2016-09-30 14:28:41 -07:00
Pieter De Baets 5b52dab781 Remove follySupport.h
Reviewed By: lexs

Differential Revision: D3944918

fbshipit-source-id: 702907a12e3916f9d6edde7362416188df909d70
2016-09-30 12:28:41 -07:00
Pieter De Baets 6ee319d8eb Only configure nativeInjectHMRUpdate in DEBUG builds
Reviewed By: martinbigio

Differential Revision: D3944601

fbshipit-source-id: 8b98b7ae9a10c1e95d0ae80f6bbd90675d7c3ef5
2016-09-30 12:28:41 -07:00
Michał Gregorczyk 67f9d92478 Do not use bare file descriptors
Reviewed By: nadavrot

Differential Revision: D3945330

fbshipit-source-id: f3a28e2632c7f17a0b6394f3dd3de183bc9e97af
2016-09-30 12:13:51 -07:00
Pieter De Baets 4b70c66a27 Use glob in cxxreact BUCK rule
Reviewed By: lexs

Differential Revision: D3944546

fbshipit-source-id: 73cb3eeff3b3f5f543e69893f5071c4bd3e78be4
2016-09-30 09:28:47 -07:00
Michał Gregorczyk b1fdac47b5 Wire compiled bundle API
Differential Revision: D3887878

fbshipit-source-id: 212fc3188f059d7378ecd61bb5e31fc87a857e8a
2016-09-29 09:13:39 -07:00
Michael Lee fc154fcd74 Add `sign-compare` suppression for warning coming from `gtest.h`
Differential Revision: D3935414

fbshipit-source-id: 5f531cc65e74cae4cb23a0706b92dac0f3ef272d
2016-09-28 14:43:46 -07:00
Marc Horowitz d7a2d3a957 Add API for sync function calls
Reviewed By: javache

Differential Revision: D3897526

fbshipit-source-id: cadead316996ca7c1dd2b0d60d87945f5452640c
2016-09-26 16:14:11 -07:00
Marc Horowitz 6071e8ca2c Support sync loading of the initial bundle/source
Reviewed By: javache

Differential Revision: D3897521

fbshipit-source-id: a4f234c7003a5f4be952d315eb62f382836e24dc
2016-09-26 16:14:11 -07:00
Marc Horowitz 971cda8794 Move thread jump for js loading into NativeToJSBridge, out of platform code
Reviewed By: javache

Differential Revision: D3906009

fbshipit-source-id: b9782a6c209e3c1626899dac7fd50233cdef87f3
2016-09-26 16:14:10 -07:00
leeight 7fd9e77837 Remove duplicate call delegate->moduleNames()
Summary: Closes https://github.com/facebook/react-native/pull/9962

Differential Revision: D3923050

fbshipit-source-id: 59e05e673835beb7409512195170c9a1e20a9ea1
2016-09-26 01:43:41 -07:00
Pieter De Baets ff79224d37 Simplify ModuleConfig array format
Reviewed By: lexs, mhorowitz

Differential Revision: D3901563

fbshipit-source-id: 70aea19db1b01170be57b74ccfa1a306dfa1f362
2016-09-23 11:14:10 -07:00
Pieter De Baets 145109fc6d Remove additional JSON encoding for native->JS communication
Reviewed By: mhorowitz

Differential Revision: D3857323

fbshipit-source-id: 4386cc107b8a1425ecb7297b0f659f6c47f01a78
2016-09-19 04:44:12 -07:00
Chris Hopman 77e533cb9f Fix value.cpp tests and add tests for bad utf8/16
Reviewed By: mhorowitz

Differential Revision: D3699086

fbshipit-source-id: f8e4628a324602c786d6dfeb8f55736f9fc757cd
2016-09-12 16:43:36 -07:00
Chris Hopman c507a05f70 Use c++1y for cxxreact
Reviewed By: mhorowitz

Differential Revision: D3852279

fbshipit-source-id: a7b80170d6b86428db47c15bbf02d68d293112fc
2016-09-12 16:43:36 -07:00
Pieter De Baets 99e0267c25 Cleanup and document native module configuration
Summary: Get rid of the old behaviour of JSON encoding in `nativeRequireModuleConfig` and consistently use the same names for function types "async/promise/sync"

Reviewed By: lexs

Differential Revision: D3819348

fbshipit-source-id: fc798a5abcaf6a3ef9d95bd8654afa7825c83967
2016-09-08 04:13:51 -07:00
Marc Horowitz 3940f06211 Add more profiling, fix existing profiling, perf fix
Reviewed By: javache

Differential Revision: D3807467

fbshipit-source-id: 3ff6feebd6d7966952152bac708389506de721e6
2016-09-02 12:43:48 -07:00
Marc Horowitz 1d571c5ed5 Don't use the same throw for calling into JSC, and calling into native modules
Differential Revision: D3779181

fbshipit-source-id: 7fb17c9c90abd9302137dad3a326c6ce30e7ca86
2016-09-01 15:13:51 -07:00
Adam Ernst 708efcffba Codemod away buck_flags in Libraries/FBR*
Reviewed By: ryu2

fbshipit-source-id: cc2d82a691b67aebfbb8ee8e40ba1ee4b49a0c44
2016-08-29 13:28:44 -07:00
Adam Ernst 2cd9939206 Even less deep copying of flags
Reviewed By: yiding

Differential Revision: D3760126

fbshipit-source-id: 590173773f65372c6aa4f4814a7d247ef23015d3
2016-08-29 10:13:48 -07:00
Chris Hopman ccdc57dd96 Fix handling of bad utf16 passed out of JS
Summary:
JSC's utf16 -> utf8 conversion crashes on encountering bad utf16. Instead, use our own conversion (conveniently copied from fbjni).

Original fix thanks to rigdern (https://github.com/facebook/react-native/pull/9302)

Reviewed By: mhorowitz

Differential Revision: D3746947

fbshipit-source-id: 29887ca720f6a2b074f01f853bad28a083b273bc
2016-08-23 17:13:38 -07:00
Kellie Medlin 2bd1f627ea Test building with clang 3.9
Reviewed By: compnerd

Differential Revision: D3667327

fbshipit-source-id: f3ad04360068ee26aeec6f1c2dbe0ed96ba32ad0
2016-08-10 13:13:34 -07:00
Ben Nham 94ac3e4d08 fix static jsc build for ios
Reviewed By: dcaspi

Differential Revision: D3693192

fbshipit-source-id: dca500262e698e02c27c840e74c421ec6bc006fe
2016-08-10 04:28:26 -07:00
Michał Gregorczyk 5405aeb2a3 First step to boot rn apps with hot bytecode cache
Reviewed By: tadeuzagallo

Differential Revision: D3561565

fbshipit-source-id: dc1cf580d7b31f30939b180aec38d9b8d0dd0f58
2016-08-04 15:58:36 -07:00
Marc Horowitz 5d0131d31b Android instrumentation tests for C++ module sync methods.
Differential Revision: D3574896

fbshipit-source-id: 8cd4c55b7a472c77cc86fd5cbfe43bc4541ba6ba
2016-08-04 11:43:54 -07:00
Marc Horowitz e5ccdc4c2d add support for registering and calling sync methods in C++ modules
Differential Revision: D3574800

fbshipit-source-id: 4c238fd96c8f83e9424c8e2bf2c8ebb1d39d397a
2016-08-03 18:13:44 -07:00
Marc Horowitz da2684f0e7 Refactor CxxNativeModule out of android-specific code into common code
Differential Revision: D3574789

fbshipit-source-id: 0cb5965d20dcf7accb6a94514486b8fda1126b7b
2016-08-03 16:01:24 -07:00
Lukas Piatkowski ec0ccf599a #15 Add a button in devtools to start/stop the Sampling Profiler
Differential Revision: D3555704

fbshipit-source-id: 4add16c923fcfd306892efec4630c24ae438d6dd
2016-08-02 11:14:06 -07:00
Andy Street 0418353249 Add MicroProfiler for low-overhead profiling of JSC/bridge performance
Summary:
We have a lot of small-ish calls to JSC and within the bridge that add up during TTI. This gives us a way to measure them in aggregate in a reasonable way.

From the comments:

MicroProfiler is a performance profiler for measuring the cumulative impact of
a large number of small-ish calls. This is normally a problem for standard profilers
like Systrace because the overhead of the profiler itself skews the timings you
are able to collect. This is especially a problem when doing nested calls to
profiled functions, as the parent calls will contain the overhead of their profiling
plus the overhead of all their childrens' profiling.

MicroProfiler attempts to be low overhead by 1) aggregating timings in memory and
2) trying to remove estimated profiling overhead from the returned timings.

To remove estimated overhead, at the beginning of each trace we calculate the
average cost of profiling a no-op code section, as well as invoking the average
cost of invoking the system clock. The former is subtracted out for each child
profiler section that is invoked within a parent profiler section. The latter is
subtracted from each section, child or not.

The usage is similar to Systrace: you put a MICRO_PROFILER_BLOCK in the block you want to profile and C++ RAII will handle timing it.

After MicroProfiler::stopProfiling() is called, a table of tracing data is emitted
to glog (which shows up in logcat on Android).

Differential Revision: D3635319

fbshipit-source-id: 01390b8ac76a68dd425cba2adfdde6e4957440cc
2016-08-02 07:43:31 -07:00
Michał Gregorczyk 73a64ed2eb Do not set forceProfilerBytecodeGeneration option
Reviewed By: bnham

Differential Revision: D3598103

fbshipit-source-id: 3bd7069379cd38bd86c13a87487f546044f66902
2016-07-26 07:28:41 -07:00
Chris Hopman d67258eb91 Move some really old tests to the cxx bridge
Reviewed By: mhorowitz

Differential Revision: D3507905

fbshipit-source-id: cbe55495a991bf6eef961319ba8b219e660dce05
2016-07-25 12:29:25 -07:00
Chris Hopman e7fba4c123 Remove some throw specifications
Reviewed By: mhorowitz

Differential Revision: D3588394

fbshipit-source-id: 56e24f28b1f4eba2564007b395afcac6fa5cb209
2016-07-21 17:43:27 -07:00
Dan Caspi 654e4bed2e Better folly::dynamic ==> JSValue conversion
Reviewed By: lexs

Differential Revision: D3347854

fbshipit-source-id: 95b81152d1b0d5fe41e01991c44f5d1110be7ddb
2016-07-20 04:28:37 -07:00
Lukas Piatkowski edb9fce9c3 #6 Notify SamplingProfiler of the main MachineThread
Reviewed By: bnham

Differential Revision: D3503444

fbshipit-source-id: a2e9a692cd5badac5a15416844c8497f88021a5e
2016-07-15 11:58:31 -07:00
Michał Gregorczyk 3c0f428f05 Fix optimized bundle stuff.
Reviewed By: davidaurelio, tadeuzagallo

Differential Revision: D3563710

fbshipit-source-id: 2b0a982d388ee5f44b806f8e561ef49a3fd8c8ca
2016-07-14 15:28:46 -07:00
David Aurelio df01215006 Reverted commit D3545345
Reviewed By: tadeuzagallo

Differential Revision: D3545345

fbshipit-source-id: d655918be7dcadaf8143800497e85f3de44bd48a
2016-07-14 10:58:27 -07:00
Michał Gregorczyk 1331e20db5 add API to CatalystInstanceImpl for executing optimized bundle
Reviewed By: tadeuzagallo

Differential Revision: D3545345

fbshipit-source-id: 538fec77b816c3fd767e8c2eda81c78971996b17
2016-07-12 08:13:32 -07:00
Tadeu Zagallo 5d06918d07 Add new FileSourceProvider
Summary: Add a new interface to JSC that allows loading a file lazily from disk, i.e. using mmap, instead of loading the whole file upfront and copying into the VM.

Reviewed By: michalgr

Differential Revision: D3534042

fbshipit-source-id: 98b193cc7b7e33248073e2556ea94ce3391507c7
2016-07-11 06:58:26 -07:00
Clement Genzmer 80c23ae324 Reverted commit D3207541
Reviewed By: michalgr

Differential Revision: D3207541

fbshipit-source-id: 36366188b7cb74c51d4aa974abd4a648498bcf78
2016-07-07 14:58:43 -07:00
Alexander Blom be0abd17e5 Remove a bunch of copies
Reviewed By: astreet

Differential Revision: D3475592

fbshipit-source-id: 37148bb8d8d47e9301ad549b183029337f7c4ca0
2016-07-07 09:00:01 -07:00
Alexander Blom 95401aba72 Create tracing name in C++ instead of Java
Reviewed By: mhorowitz

Differential Revision: D3469140

fbshipit-source-id: 77a00a7150573e44f219972556cbb936a57d7054
2016-07-07 09:00:00 -07:00
Tadeu Zagallo af24e8001a Add new FileSourceProvider
Reviewed By: michalgr

Differential Revision: D3207541

fbshipit-source-id: d53599c3cf36ae7c89e85a29f637987bc7139159
2016-07-07 08:44:30 -07:00
Andy Street f5345601d9 Add JSCHelper function to easily install native hooks outside of JSCExecutor
Summary: JSCExecutor has something like this, but for methods on JSCExecutor itself. Open to better ideas around how to share code

Reviewed By: lexs

Differential Revision: D3516314

fbshipit-source-id: 4b1265916c52d582bb0b9348e9b4a099f566d6c9
2016-07-07 04:58:47 -07:00
Andy Street 10d41b50c2 Add getType/getPrivate to Value
Summary:
Adds:
 - getType so you can switch on type
 - getPrivate

Reviewed By: lexs

Differential Revision: D3515510

fbshipit-source-id: d574b04f563ac650bacec3751b50be6345e8439a
2016-07-07 04:43:51 -07:00
Andy Street 8a0640716b Add more Value APIs
Summary:
Adds:
 - callAsConstructor
 - Ability to provide `this` object to callAsFunction
 - getPropertyNames() now returns Strings (which can be converted by the caller to std::string if they want).

Fixes:
 - double free issue with the String move constructor

Reviewed By: lexs

Differential Revision: D3515398

fbshipit-source-id: afa1342044e41fdd833dd27b8a244a58d4078442
2016-07-06 06:43:26 -07:00