Commit Graph

8 Commits

Author SHA1 Message Date
Sophie Alpert
8c3cececb7 15.x: BSD+Patents -> MIT 2017-09-25 17:02:44 -07:00
Sophie Alpert
080db9d3a7 15.x: File headers BSD+Patents -> MIT 2017-09-25 17:02:43 -07:00
Rick Beerendonk
bef45b0b1a Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes. 2015-12-29 20:20:32 +01:00
Ben Alpert
3b28c72142 Add rudimentary jsc perf-counters runner
Works at least on a CentOS 7 machine after running `sudo yum install
webkitgtk webkitgtk-devel`.

The only globals you get are `print` and `PerfCounters`. No `console` nor the other globals provided by the `jsc` command-line tool (load, readFile, etc) though they're probably not hard to implement.

You can disable the JIT by setting the environment variable `JSC_useJIT=false`.

Test Plan:
```
~/local/react/scripts/perf-counters$ make
~/local/react/scripts/perf-counters$ build/jsc-perf <(echo 'PerfCounters.init(); var a = PerfCounters.getCounters().instructions; print("moo"); var b = PerfCounters.getCounters().instructions; print(b - a);')
moo
72182
~/local/react/scripts/perf-counters$
```
2015-09-30 23:36:06 -07:00
Ben Alpert
b3bccf2273 Add node bindings 2015-09-19 11:30:28 -07:00
Ben Alpert
e922f869e6 Make hardware-counter.cpp compile
`g++ -std=c++11 -lpthread src/hardware-counter.cpp
src/thread-local.cpp src/test.cpp` works and runs where `src/test.cpp` is:

```

int main() {
  bool enable = true;
  std::string events = "";
  bool recordSubprocesses = false;
  HPHP::HardwareCounter::Init(enable, events, recordSubprocesses);

  HPHP::HardwareCounter::s_counter.getCheck();

  int64_t start = HPHP::HardwareCounter::GetInstructionCount();
  volatile int x;
  for (int i = 0; i < 1000000; i++) {
    x += i;
  }
  int64_t end = HPHP::HardwareCounter::GetInstructionCount();

  printf("%d\n", end - start);
}
```
2015-09-19 11:00:27 -07:00
Ben Alpert
42e523ea4d Update license to match React repo license 2015-09-19 11:00:27 -07:00
Ben Alpert
cfbf115b26 Add hardware-counter.cpp and deps from HHVM 2015-09-18 22:10:10 -07:00