Re: [v8-users] Debugging ES6 modules with V8 inspector

2020-07-10 Thread Isiah Meadows
Node v10 uses V8 6.8 (two years old), and the latest version of V8 is 8.4.

On Thursday, July 9, 2020 at 1:42:07 PM UTC-7, Nupoor Kotasthane wrote:
>
> I am able to reproduce the same behavior with Node.js v10.21.0. 
>
>
> On Tuesday, June 30, 2020 at 5:46:07 PM UTC-7, Nupoor Kotasthane wrote:
>>
>> The observation here was that we are able to inspect, only the objects 
>> that are imported/exported, using Debugger.evaluateOnCallFrame. For all the 
>> other objects, when evaluated, we just get reference errors.  
>> Any insight on why this may be happening will be great!
>>
>> Thanks,
>> Nupoor
>>
>>
>>
>> On Friday, June 26, 2020 at 9:07:45 AM UTC-7, Nupoor Kotasthane wrote:
>>>
>>> Hi Ben,
>>>
>>> Here's the example I have been using:
>>> I have two mjs files:
>>> sample.mjs:
>>> import {a} from '/testmod.mjs';
>>> let p = 9;
>>> var t1 = 1;
>>> var t2 = 2;
>>> var t3 = 3;
>>> var t4 = 4;
>>> var temp = 1;
>>> temp = 2* temp;
>>> temp = 3* temp;
>>> temp
>>>
>>> testmod.mjs:
>>> export var a = 10;
>>> export var b = 20;
>>> export var c = 30;
>>>
>>> Once I start debugging sample.mjs, I step over a little and reach line 5 
>>> and I get the following notification from inspector:
>>> {
>>>   "method": "Debugger.paused",
>>>   "params": {
>>> "callFrames": [
>>>   {
>>> "callFrameId": "{\"ordinal\":0,\"injectedScriptId\":1}",
>>> "functionName": "",
>>> "functionLocation": {
>>>   "scriptId": "11",
>>>   "lineNumber": 0,
>>>   "columnNumber": 0
>>> },
>>> "location": {
>>>   "scriptId": "11",
>>>   "lineNumber": 5,
>>>   "columnNumber": 9
>>> },
>>> "url": "/sample.mjs",
>>> "scopeChain": [
>>>   {
>>> "type": "module",
>>> "object": {
>>>   "type": "object",
>>>   "className": "Object",
>>>   "description": "Object",
>>>   "objectId": "{\"injectedScriptId\":1,\"id\":19}"
>>> },
>>> "startLocation": {
>>>   "scriptId": "11",
>>>   "lineNumber": 0,
>>>   "columnNumber": 0
>>> },
>>> "endLocation": {
>>>   "scriptId": "11",
>>>   "lineNumber": 10,
>>>   "columnNumber": 0
>>> }
>>>   },
>>>   {
>>> "type": "global",
>>> "object": {
>>>   "type": "object",
>>>   "className": "global",
>>>   "description": "global",
>>>   "objectId": "{\"injectedScriptId\":1,\"id\":20}"
>>> }
>>>   }
>>> ],
>>> "this": {
>>>   "type": "undefined"
>>> }
>>>   }
>>> ],
>>> "reason": "other",
>>> "hitBreakpoints": []
>>>   }
>>> }
>>>
>>>
>>> At this point I want to inspect variable "p". A 
>>> Debugger.evaluateOnCallFrame request to inspector with the parameter "p" 
>>> returns:
>>> {
>>> "id": 12, 
>>> "result": 
>>> {
>>> "result": 
>>> {
>>> "type": "object", 
>>> "subtype": "error", 
>>> "className": "ReferenceError", 
>>> "description": "ReferenceError: p is not defined\n at eval (eval at 
>>>  (/sample.mjs:6:10), :1:1)\n at /sample.mjs:6:10", 
>>>
>>> "objectId": "{\"injectedScriptId\":1,\"id\":21}"
>>> }
>>> , 
>>> "exceptionDetails": 
>>> {
>>> "exceptionId": 1, 
>>> "text": "Uncaught", 
>>> "lineNumber": 0, 
>>> "columnNumber": 0, 
>>> "scriptId": "14", 
>>> "stackTrace": 
>>> {
>>> "callFrames": 
>>> [
>>> {
>>> "functionName": "", 
>>> "scriptId": "14", 
>>> "url": "", 
>>> "lineNumber": 0, 
>>> "columnNumber": 0
>>> }
>>> , 
>>> {
>>> "functionName": "", 
>>> "scriptId": "11", 
>>> "url": "/sample.mjs", 
>>> "lineNumber": 5, 
>>> "columnNumber": 9
>>> }
>>> ]
>>> }
>>> , 
>>> "exception": 
>>> {
>>> "type": "object", 
>>> "subtype": "error", 
>>> "className": "ReferenceError", 
>>> "description": "ReferenceError: p is not defined\n at eval (eval at 
>>>  (/sample.mjs:6:10), :1:1)\n at /sample.mjs:6:10", 
>>>
>>> "objectId": "{\"injectedScriptId\":1,\"id\":22}"
>>> }
>>> }
>>> }
>>> }
>>>
>>> The expected outcome here would have been to see the actual value of 
>>> variable "p". I am seeing similar response for all variables declared in 
>>> sample.mjs and that is unexpected. However, the imported object "a" can 
>>> does not yield the same response. Inspector returns the right value for 
>>> "a". 
>>>
>>> At the same point if I send Runtime.getProperties request to V8 with the 
>>> current module scope's object id: '{\"injectedScriptId\":1,\"id\":19}' as 
>>> parameter, I only see the following:
>>> {
>>> "id": 15, 
>>> "result": 
>>> {
>>> "result": 
>>> [
>>> {
>>> "name": "a", 
>>> "value": 
>>> {
>>> "type": "number", 
>>> "value": 10, 
>>> "description": "10"
>>> }
>>> , 
>>> "writable": true, 
>>> "configurable": true, 
>>> "enumerable": true, 
>>> "isOwn": true
>>> }
>>> ]
>>> }
>>> }
>>>
>>> I do not see the other variables in 

[v8-users] Re: trying to understand v8's opt/deopt strategy, is this behavior normal?

2018-09-05 Thread Isiah Meadows
Not a V8 dev, but:

- What's the offending code triggering the opt/deopt loop look like? That 
should help quite a bit in understanding what's going on.

- Opt/deopt loops are engine bugs - it should never do that. V8 should 
figure out at some point whether to optimize or completely bail out. Feel 
free to report it at https://bugs.chromium.org/p/v8/issues/list.

On Tuesday, September 4, 2018 at 5:33:28 PM UTC-4, Taylor Dondich wrote:
>
> So I'm building a NES(Nintendo) emulator in Javascript and I'm doing 
> optimizations to get the emulation to run faster.  Code is located at: 
> https://github.com/tdondich/vue-2a03-emu
>
> So, I have done a dump of v8 activity using --trace-opt and --trace-deopt
>
> I'm seeing a lot of deopt over and over for certain critical functions.  
> V8 will mark to opt, optimize, then do a soft deopt, over and over on the 
> same functions.
>
> So, my question is, what are good strategies to defend against this?  I'd 
> rather it optimizes once and is good to go on these functions.
>
> For example, I see:
> [deoptimizing (DEOPT soft): begin 0x4356287660f9  435628765439)> (opt #112) @253, FP to SP delta: 152, caller sp: 
> 0x00202c9fd7d8]
> ;;; deoptimize at , 
> Insufficient type feedback for generic named access
>
> But documentation on insufficient type feedback for generic named access 
> nowhere to be found.  How can I restructure my code to help avoid this?  Or 
> the same for "Insufficent type feedback for generic named access".
>
> So this goes on over and over, with the same depots happening on the same 
> functions all the time (and my emu runs loops at over 3 million iterations 
> a second).
>
> Any insight?
>
> Thanks!  First time going this level with V8. It's fun!
>
> Taylor Dondich
>
>
>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Passing variables from C++ to JavaScript (server-side to client-side)?

2018-05-18 Thread Isiah Meadows
I would recommend that for questions specific to Node itself like this, you 
should check out https://github.com/nodejs/help first before asking here. 
There, they can help you with a wide variety of things, including things 
like this, and you're more likely to get better answers out of it. They can 
help you with both native addons and JavaScript-related questions, and they 
can help you with quite a few things.

Also, I thought I'd point out that for this particular case, if your server 
is in fact Node, I'd suggest using `process.env` instead (see 
https://nodejs.org/api/process.html#process_process_env). This does 
basically what you want, without much ceremony (and as a couple pros, it 
works across all platforms and it doesn't even require any C++ code).

On Thursday, May 17, 2018 at 8:39:28 PM UTC-4, Osman Zakir wrote:
>
> Hi,
>
> Thanks for the answer.  
>
> I think this can help me.  I also need to know if I need to actually make 
> a C++ addon for Node.js or if I just need to #include the v8.h header in 
> C++ and require() v8 in JavaScript and then expose the variable from C++ to 
> JavaScript that way without also making a Node.js addon (I'm using 
> Browserify, so I can use require() client-side in my code).  
>
> On Sunday, May 13, 2018 at 6:37:38 AM UTC+3, Anoop R. S. wrote:
>>
>> Hi,
>> Please see if this is of any help. I am not sure whether this is what you 
>> meant. 
>>
>> https://github.com/anoop-rs/C-ObjectAccessUsingV8
>>
>> regards,
>> Anoop R. S.
>>
>> On Sunday, 13 May 2018 00:05:11 UTC+5:30, Osman Zakir wrote:
>>>
>>> My issue is as stated in the title.  Is it possible to do this using 
>>> V8?  If so, how?  Thanks in advance for any replies and/or help.  
>>>
>>> Note: I have a Google API key and a currency API access key stored in 
>>> environment variables I want to pass them to the client-side code.  The 
>>> Google API key has to go the HTML page somehow and the other one to the 
>>> JavaScript code.  
>>>
>>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: What kind of loops can v8 easily optimize?

2016-11-03 Thread Isiah Meadows
In my experience, DataViews are way slower than typed arrays, and it's a 
known issue . They 
delegate to C++ instead of generating code at runtime for it (with just 
SMIs, it's comparable to a standard function call in generated assembly 
length), which is probably the bigger slowdown (it's faster there than even 
in normal JS).

On Thursday, November 3, 2016 at 7:01:37 AM UTC-4, vroad wrote:
>
> Well, changing loop statements improved performance. But batching is still 
> too slow on mobile devices..
>
>
> https://github.com/openfl/starling/blob/b1a458f7283a7e3673146049a6c05124ecd3d7fe/starling/rendering/VertexData.hx#L248-L260
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Does v8 optimize map()?

2016-03-04 Thread Isiah Meadows
Question: would a call site optimization featuring pipelines work? Several 
Array prototype methods always return arrays, so that's why I'm thinking a 
pipeline would be feasible. It's probably not trivial to implement, 
especially considering lazy evaluation of a specific internal reference is 
necessary to make it work (no extra *JS closures* necessary, though), but I 
think it could really speed up a lot of cases, simply by virtue of reducing 
GC.

// Unoptimized.
let B = A
  .map(Math.abs)
  .map(x => x * 10)
  .map(function (x) { return new Foo(this, x) }, true)
  .filter(foo => foo.value > 10)

let C = B
  .map(foo => foo.get())
  .forEach(x => console.log(x))

assert(C === undefined)

// Optimized, see below for code stubs
{
  @initPipeline(A)
  @runMap(Math.abs, false)
  @runMap(x => x * 10, false)
  @runMap(x => new Foo(x), true, true)
  @runFilter(foo => foo.value > 10, false)
  @assignResult(B)
}

{
  @initPipeline(B)
  @runMap(foo => foo.get(), false)
  @runForEach(x => console.log(x))
  @assignValue(C)
}

assert(C === undefined)

This would significantly reduce garbage collection for such chains.

Here's a set of code stubs for that idea, in pseudo-JS:

// Legend:
// $variable - internal variable
// %Func - runtime function
// @value - compile-time macro/value
// `output` - output code, literal code
// Note that the stubs implicitly create blocks, and their arguments are
// implicitly evaluated.

// This is just a helper.
function %CloneArray(array) {
  const ret = []
  const len = TO_LENGTH(array.length)
  for (let i = 0; i < len; i++) {
if (HAS_INDEX(array, i, true)) {
  DefineIndexedProperty(ret, i, array[i])
}
  }
  return ret
}

stub @initPipeline(@init) {
  // The initial copy should be considered the master copy.
  `let $ret = {got: true, value: @init}`

  // This is a lazy value that, when initialized, does the equivalent of the
  // following code:
  // if (!$ret.got) {
  //   $ret.got = true
  //   $ret.value = %CloneArray($ret.value)
  // }
  `let $ref = %Ref($ret)`
  `let $len = @init.length`
}

// Return the actual result
stub @assignResult(@dest) {
  `if ($ret.got) {`
`@dest = $ret.value`
  `} else {`
`@dest = %CloneArray($ret.value)`
  `}`
}

// Assign the result of the last part
stub @assignValue(@dest) {
  `@dest = $ret.value`
}

// This is just a helper.
stub @iterate(@passed, @receiver, stub @missing, stub @exists) {
  if (@passed) `if (IS_UNDEFINED(@receiver)) {`

  `for (let $i = 0; $i < $len; $i++) {`
`if (HAS_INDEX($ret.value, $i, true)) {`
  @missing(`$i`, `$ret.value[$i]`)
`}`
  `}`

  if (@passed) {
`} else {`
  `for (let $i = 0; $i < $len; $i++) {`
`if (HAS_INDEX($ret.value, $i, true)) {`
  @exists(`$i`, `$ret.value[$i]`, `$receiver`)
`}`
  `}`
`}`
  }
}

stub @runMap(@f, @passed, @receiver) {
  `let $f = @f`
  if (@passed) `let $receiver = @receiver`

  @iterate(@passed, @receiver, (@i, @entry) => {
`@entry = $f(@entry, @i, $ref)`
  }, (@i, @entry, $receiver) => {
`@entry = %Call($f, $receiver, @entry, @i, $ref)`
  })
}

stub @runFilter(@f, @passed, @receiver) {
  `let $new = []`
  `let $newLen = 0`
  `let $f = @f`
  if (@passed) `let $receiver = @receiver`

  @iterate(@passed, @receiver, (@i, @entry) => {
`let $entry = @entry`
`if ($f($entry, @i, $ref)) {`
  `$new[$newLen++] = $entry`
`}`
  }, (@i, @entry, $receiver) => {
`let $entry = @entry`
`if (%Call(@f, $receiver, $entry, $i, $ref)) {`
  `$new[$newLen++] = $entry`
`}`
  })

  `$ret.value = $new`
  `$ret.got = false`
  `$len = $newLen`
}

stub @runForEach(@f, @passed, @receiver) {
  `let $f = @f`
  if (@passed) `let $receiver = @receiver`

  @iterate(@passed, @receiver, (@i, @entry) => {
`@f(@entry, @i, $ref)`
  }, (@i, @entry, $receiver) => {
`%Call(@f, @receiver, @entry, @i, $ref)`
  })

  // Terminate the chain
  `$ret.value = undefined`
  `$ret.got = true`
}


On Friday, March 4, 2016 at 9:55:36 AM UTC-5, Jakob Kummerow wrote:
>
> Also ES6 is mostly a burden for JS implementations, not much of an 
> opportunity. We have to invest some serious effort just to *maintain* 
> previous 
> performance as we're implementing ES6, and in some cases not even that is 
> possible.
>
> On Fri, Mar 4, 2016 at 3:49 PM, 'Andreas Rossberg' via v8-users <
> v8-u...@googlegroups.com > wrote:
>
>> There is no refcount in JS implementation, and no affordable way to 
>> discover aliasing dynamically. And given the gazillion intersession and 
>> mutation points in JavaScript's semantics, it is also practically 
>> impossible to analyse aliasing at compile time, in all but the most trivial 
>> cases. Note also that the callback itself may have or acquire references to 
>> the same object as A and look at them during the execution of map itself.
>>
>> On 4 March 2016 at 15:34, 'Robert Eisele' via v8-users <
>> v8-u...@googlegroups.com > wrote:
>>
>>> Sounds reasonable, but wouldn't it make sense to make this 

Re: [v8-users] performance oddities of v8 Arrays

2015-10-17 Thread Isiah Meadows
Maybe do the array allocation and initialization from the JS side? This 
will likely be extremely cheap to do, and almost as fast as simply 
iterating the array.

function getArray() {
var arrayBinding = getNativeArrayBinding()
var array = []
// arrayBinding.length is a static property
for (var i = 0; i < arrayBinding.length; i++) {
array[i] = arrayBinding.get(i)
}
return array
}

// All set to go!
var array = getArray()
doSomething(array)

If you are dealing with large arrays, you might have to deal with the 
slowness, since it'll kill your memory to release it, but if you're dealing 
with an array with up to a thousand or so elements, you should be in the 
clear. Don't try to outsmart the engine - there's a reason it executes JS 
almost the speed of C++, the language it's written in.

On Friday, October 16, 2015 at 6:20:31 PM UTC-4, Dmitry Orlov wrote:
>
> Thanks Jacob!
>
> On 16 October 2015 at 13:56, Jakob Kummerow  > wrote:
>
>> It's not about what the "internal array representation" is, it's about 
>> how the array is accessed. V8 employs all sorts of smarts to make 
>> JavaScript execution very fast, because that's its job. Accessing things 
>> via the C++ API ("array->Set(...)" in your example) isn't anywhere near as 
>> optimized. The difference is most pronounced for tight hot loops, it will 
>> be much smaller (to the point of being negligible) for code that runs only 
>> once.
>>
> Is there any way to bulk-allocate a v8::Array in a cheap way, for example, 
> from a C-array of v8::Handles?
>  
>
>>
>> That said, if "Build Type: DEBUG" in your output means what I think it 
>> means, then any performance measurement results are pretty much 
>> meaningless. Try again in Release mode.
>>
> This message is reported because the Google benchmark library was build 
> without NDEBUG directive:
>
> https://github.com/google/benchmark/blob/cf40a0f1172afc061e910eb5590f71e6ffdece66/src/console_reporter.cc#L43
> Apparently, that is the way its Makefile is written.
>
> My code is compiled wtih -O3:
> CXXFLAGS=-Wall -Werror -g -O3 -march=corei7 -mtune=corei7-avx -std=gnu++0x 
> -pthread 
>
> Is it possible that I inadvertently built V8 in debug mode? This is how I 
> install it:
> $ export PATH=$PATH:/path/to/depot_tools
> $ fetch v8
> $ cd v8
> $ git fetch
> $ git checkout 4.2.77.21
> $ gclient sync
> $ make clean
> $ make -j8 native
>
>  
>
>>
>> On Fri, Oct 16, 2015 at 8:57 PM, Dmitry Orlov > > wrote:
>>
>>> Hello everyone,
>>>
>>> I've noticed peculiar performance characteristics of V8 objects when 
>>> benchmarking my V8-embedding application. In particular, v8::Array is 
>>> incredibly expensive - each Set(index, value) operation on an array 
>>> consistently takes 100ns on a 3.4Ghz Xeon, instead of single digit 
>>> nanoseconds one would expect from a C-array based implementation.
>>> In contrast, javascript code using arrays runs blaze-fast, taking around 
>>> 2ns for each assignment.
>>>
>>> I've benchmarked these code fragments separately, implementation is 
>>> below:
>>>
>>> void allocate_v8_integer_array(benchmark::State& state) {
>>> v8::HandleScope scope(isolate);
>>> v8::Local int_value = v8::Integer::New(isolate, 100);
>>> while (state.KeepRunning()) {
>>> const int n = state.range_x();
>>> v8::Local array = v8::Array::New(isolate, 
>>> state.range_x());
>>> for (int i = 0; i < n; ++i) {
>>> array->Set(i, int_value);
>>> }
>>> }
>>> }
>>>
>>> void allocate_v8_integer_array_in_javascript(benchmark::State& state) {
>>> v8::TryCatch try_catch(isolate);
>>> v8::HandleScope scope(isolate);
>>> v8::Local script = 
>>> v8::Script::Compile(v8::String::NewFromUtf8(isolate,
>>> "function run(n) {"
>>> "  var x = Array(n);"
>>> "  for (var i = 0; i < n; i++) {"
>>> "x[i] = i;"
>>> "  }"
>>> "}"));
>>> script->Run();
>>> assert(!try_catch.HasCaught());
>>> v8::Local run = v8::Local::Cast(
>>> 
>>> context.Get(isolate)->Global()->Get(v8::String::NewFromUtf8(isolate, 
>>> "run")));
>>> v8::Local arg = v8::Integer::New(isolate, 
>>> state.range_x());
>>> while (state.KeepRunning()) {
>>> run->Call(context.Get(isolate)->Global(), 1, );
>>> assert(!try_catch.HasCaught());
>>> }
>>> }
>>>
>>> Benchmark results:
>>> Run on (8 X 3399.98 MHz CPU s
>>> 2015-10-16 18:47:44
>>> Build Type: DEBUG
>>> Benchmark  Time(ns)CPU(ns) 
>>> Iterations
>>>
>>> -
>>> allocate_v8_integer_array/1 190190   
>>>  3688287 
>>> allocate_v8_integer_array/10   1061   1061   
>>>   659836 
>>> 

[v8-users] Potentially removing global interpreter lock in future?

2015-07-13 Thread Isiah Meadows
Is there any practical way that, in the future, the global interpreter lock 
in V8 could be removed? I don't see it happening easily in the short term 
given the massive overhaul in ES2015, but in the long term, it would be 
really nice to have, and would *really* benefit the Node community 
(especially) and other embedders that require parallelism in their 
applications to be accessible from JavaScript.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] ES2015 module support?

2015-06-07 Thread Isiah Meadows
How much of the ES2015 module syntax/semantics are implemented in the 
bleeding_edge branch? I know that this is definitely the farthest along, 
with only parsing support for the legacy `module` version in SpiderMonkey 
and 0% in the rest.

I know a lot of work has already gone in 
https://code.google.com/p/v8/issues/detail?id=1569, but I've seen little 
outside of that one bug in this area. Also, is there any idea if what the 
import/export hooks will be? Or is that waiting for the WHATWG Loader API 
https://whatwg.github.io/loader/ to be completed?

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: DOM strings size increasing continuously

2015-03-11 Thread Isiah Meadows
Could you give a code example? 

(P.S. not technically part of the team, but just enjoy hacking with the engine) 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Strong mode

2015-02-18 Thread Isiah Meadows
@Andreas, thanks. That explains it. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Strong mode

2015-02-17 Thread Isiah Meadows
What's the point of strong mode? And that are the differences between it
and strict/sloppy mode? Something that's just been confusing me.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Using C++11 lambda to model a JS callback -- thoughts?

2015-02-13 Thread Isiah Meadows
You might be able to get away with a macro to initialize everything here. It 
should clean a few things up. My experience in C++ is admittedly limited, 
though. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Share an immutable object/function in a multi-threaded environment? (embedded v8)

2015-02-13 Thread Isiah Meadows
Which is enough for JSON message passing. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Thoughts on this type inferrer in development?

2015-01-30 Thread Isiah Meadows
https://github.com/sinelaw/inferno/blob/master/README.md

Inferno is an in dev type inferrer and checker for JavaScript I found in 
Haskell. There is also Flow, a stable type inferrer in OCaml. How much would 
this kind of thing (not necessarily Inferno or Flow) help V8 performance-wise 
in the end? I'm just curious. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] memory allocation in old space?

2015-01-30 Thread Isiah Meadows
No offense, but I've never heard of any JavaScript VM that allows such fine 
grained control. Even Java doesn't AFAIK. I think you would need C++ for that 
amount of control. Sorry. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] `make quickcheck` runs 32-bit tests when I'm on a 64-bit OS

2014-12-14 Thread Isiah Meadows
@Caitlin, thank you! 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] `make quickcheck` runs 32-bit tests when I'm on a 64-bit OS

2014-12-12 Thread Isiah Meadows
I'm not set up for cross-compilation, so I get all kinds of errors in 
building for IA32. But, when I run `make quickcheck`, it starts 
building/testing for IA32 instead of my native architecture x86_64. How can 
I fix this?

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] What exactly is the implementation status of the ES6 module semantics?

2014-11-23 Thread Isiah Meadows
I'm specifically asking about the bleeding_edge branch here. Apparently 
Google sucks at finding this kind of information, as even StartPage, an 
anonymizing search engine that uses Google's search API to generate its 
results, brought nothing useful at all (can't blame search bubble).

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] C/C++ library to run an external program that works with V8

2014-11-11 Thread Isiah Meadows
Have you seen this? 

https://developers.google.com/v8/embed

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Turbo Fan target

2014-11-08 Thread Isiah Meadows
Makes sense. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Turbo Fan target

2014-11-07 Thread Isiah Meadows
I know this is probably a dumb question, but is Turbo Fan a general purpose
VM level, or is it specifically for asm.js?

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] WILL BE DEPRECATED SOON V8 github repo

2014-10-23 Thread Isiah Meadows
True, and LGTM. I'm probably pretty insignificant in that decision, though. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Intent to Implement Symbol.toStringTag in V8

2014-10-20 Thread Isiah Meadows
Outside of strings, numbers, and O.p.toString.call(foo), the rest of the use 
cases are exceptionally rare AFAIK. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] PSA: New ES6 draft came out yesterday.

2014-10-15 Thread Isiah Meadows
This might be relevant for some of us, considering that there have been a few 
major changes 
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts as of 
late. A few highlights to mention:

1. @@iterator was moved to an %IteratorPrototype% intrinsic class, of which 
the native iterators (and generators) indirectly inherit from.
2. @@create no longer exists (potential for memory issues/access to 
uninitialized natives/etc.)
3. ToNumber now can do 0o10 - 8, 0b10 - 2, etc.
4. Reflect.Loader API no longer exists (wasn't implemented yet, anyways)

I know that this list is far from complete, but these are what I found to 
be the most significant at this point for us.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Compilation errors in `make quickcheck` (incorrect architecture?)

2014-10-03 Thread Isiah Meadows
Thank you...much better. Maybe after I get this piece done, I could take a 
look at the build script.

On Friday, September 26, 2014 10:33:42 AM UTC-4, Ben Noordhuis wrote:

 On Fri, Sep 26, 2014 at 3:15 PM, Isiah Meadows impi...@gmail.com 
 javascript: wrote: 
  For some reason, `make native.check` is trying to compile for IA32 
  architecture on my system (and thus is running into errors). I'm not set 
 up 
  for cross-compilation on my system, so I'm getting errors. Here's the 
  message I'm getting: 
  
  ``` 
  make[1]: Entering directory `dir/v8/out' 
CXX(target) 
 dir/v8/out/ia32.release/obj.target/v8_base/src/accessors.o 
  In file included from /usr/include/stdio.h:27:0, 
   from .././include/v8stdint.h:11, 
   from .././include/v8.h:18, 
   from .././src/v8.h:29, 
   from ../src/accessors.cc:5: 
  /usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file 
 or 
  directory 
   #  include sys/cdefs.h 
   ^ 
  compilation terminated. 
  make[1]: *** 
 [dir/v8/out/ia32.release/obj.target/v8_base/src/accessors.o] 
  Error 1 
  make[1]: Leaving directory `dir/v8/out' 
  make: *** [ia32.release] Error 2 
  ``` 

 You can tell the Makefile to run the tests for a specific arch/build 
 combo: `make x64.debug.check extrachecks=on` 


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How can I kill a JS function at runtime for a V8 unit test?

2014-10-02 Thread Isiah Meadows
It is primarily a perf patch, where str.repeat(2^20), etc. no longer hangs
the engine's execution thread.

I'm wanting to assert the following two things:
1. Large numbers as arguments must not hang the engine in the normal case.
The patch provides a reduction in the worst case of algorithmic runtime
complexity.
2. Repeating an empty string should be near instantaneous. The patch also
includes a special case where repeating an empty string should be near
instantaneous, regardless of the number of repeats. This case should take
no longer than a few milliseconds on an old, excessively bogged down
machine (even to the point the desktop is hanging), almost ready to fry
itself.
On Sep 29, 2014 12:11 PM, Jakob Kummerow jkumme...@chromium.org wrote:

 I don't understand what you're saying. Do you mean your testcase should,
 when all is well, finish in a second or two? That's much too slow. Or do
 you mean that after 1-2 seconds it would be OK to cancel it and treat it as
 a failure, because in the good case it finishes much faster? As I said
 before, there's no need to test this specifically, just make sure all
 affected code paths are tested for correctness.

 Can you provide more detail about what precisely it is that you're trying
 to do? I'm getting a bit tired of the guesswork.


 On Mon, Sep 29, 2014 at 5:42 PM, Isiah Meadows impinb...@gmail.com
 wrote:

 Problem then, it should take no more than a second or two. Basically it
 is a this should not hang the engine test.
 On Sep 26, 2014 9:56 AM, Jakob Kummerow jkumme...@chromium.org wrote:

 On Fri, Sep 26, 2014 at 3:18 PM, Isiah Meadows impinb...@gmail.com
 wrote:



 On Thursday, September 25, 2014 2:01:03 PM UTC-4, Jakob Kummerow wrote:

 That depends entirely on the kind of performance delta we're talking
 about.

 If a particular testcase went from actually hanging (endless loop, or
 running for hours) to finishing quickly (say, in 1 millisecond), then by
 all means land that testcase. (You don't have to detect the hang yourself,
 the test driver already has a timeout for each test.)


 Okay. That's pretty much what I needed. My test case would be for the
 former case there (actually hanging). I was more looking for a specific
 case that shouldn't hang. How long is the timeout?


 It's chosen dynamically based on a variety of factors, IIRC between a
 couple seconds and a few minutes. Do not depend on it. Make sure your
 testcase finishes fast (1 millisecond is a good target to aim for).

  --
 --
 v8-users mailing list
 v8-users@googlegroups.com
 http://groups.google.com/group/v8-users
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups v8-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/v8-users/AMVUNpV-xLw/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 v8-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How can I kill a JS function at runtime for a V8 unit test?

2014-10-02 Thread Isiah Meadows
I'll just leave it out, then. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Intent to ship: ES6 generator functions (V8)

2014-09-22 Thread Isiah Meadows
This may also make some library devs happy (link http://koajs.com/ as an 
example)

On Wednesday, September 17, 2014 6:39:40 AM UTC-4, Andy Wingo wrote:

 [FYI +blink-dev] 

 ES6 defines a new language feature, generator functions [1]. 

 ES6 generator functions have been shipping in Firefox since version 26 
 (December 2013) [2].  Although IE and Safari developers participated 
 actively in the design of generator functions, and so we expect 
 generator functions to be implemented by them, we don't know when. 

 V8 has had generator functions since June 2013, under the 
 --harmony-generators flag.  The specification has undegone minor changes 
 since then, to which we have adapted.  To our knowledge, the V8 
 implementation of generators is specification-compliant, with a few 
 known bugs that will be fixed [3].  Work to nicely integrate generator 
 objects with devtools is ongoing [4]. 

 Owners: wi...@igalia.com javascript:, ross...@chromium.org javascript: 

 [1] 
 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-function-definitions
  
 [2] https://developer.mozilla.org/en-US/Firefox/Releases/27#JavaScript 
 [3] http://code.google.com/p/v8/issues/detail?id=3565 
 [4] http://code.google.com/p/v8/issues/detail?id=3292 


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Could someone please verify if I have signed the CLA?

2014-09-22 Thread Isiah Meadows
Once again, I'm not sure either way about if I have a CLA signature on 
record. So far, I have heard two different stories, and this is the main 
reason I've kinda trailed off in my interest in this project. Could I get 
some verification either way, conclusively?

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Integer Optimization in Chrome 64-bit

2014-09-22 Thread Isiah Meadows
It optimizes integers for 32 bits because there is little reason to 
optimize integers for anything else when the ECMAScript specification 
itself makes no mention of 64-bit integers, only 32-bit ones beyond smaller 
sizes for typed arrays.

On Sunday, September 21, 2014 12:03:18 PM UTC-4, Si Robertson wrote:

 Hi guys,

 When working with integers and V8 I have always been aware of keeping 
 integer values within a 31-bit range for performance reasons. Does the 
 introduction of Chrome 64-bit affect the bit-length of integer values? In 
 other words, can V8 in Chrome 64-bit handle 63-bit integer values 
 performantly or does it still prefer 31-bit integer values?

 Thanks.



-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: PSA - V8 is migrating to Git

2014-09-22 Thread Isiah Meadows
Once everything gets migrated, what all needs changed on the local side?

On Tuesday, September 16, 2014 3:09:42 AM UTC-4, Michael Achenbach wrote:

 Hi!

 We're planning to migrate the V8 sources from Svn to Git. The estimated 
 timeline for this is 1-2 month.

 We won't migrate before all known blocking issues are resolved. If you 
 have anything in mind that blocks this migration, please report it to me.

 The meta-bug for tracking the migration process can be found here: 
 crbug.com/350909

 I'll keep you posted.

 Best
 Michael


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] How can I kill a JS function at runtime for a V8 unit test?

2014-09-22 Thread Isiah Meadows
What I need to do for a specific unit test is to run a specific method + 
arguments, and if it takes too long, stop the call mid-cycle and fail the 
test. This is for a performance-related unit test for my patch (which is a 
perf patch itself, anyways). Is this possible, and if so, how would I do 
it? I'm not nearly as well versed in C++ as I am in JavaScript, but I could 
write it in C++ if I had to.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Re: Array#join - better to special case for Array/etc.?

2014-09-01 Thread Isiah Meadows
On Mon, Sep 1, 2014 at 9:12 AM, Vyacheslav Egorov vego...@chromium.org wrote:
 Array#[push|pop]() is easily optimized for array instances, because
 they each compile down to a single common assembly instruction

 Last time I checked Intel manual it did not have jsapop/jsapush
 instructions.

 You need to do a bit of checks (length underflow, lack holes in the array,
 etc). So a single instruction is unlikely (though potentially possible in a
 loop under certain conditions --- but those conditions require sophisticated
 optimizations to achieve, e.g. you need to hoist bounds checks and sink
 update of length out of the loop, etc.).

I'll recind that statement. It still is easily optimizable to a low
level. An array of numbers can
be compiled eventually to push/pop (pushf/popf for floats).


 but to make a special case (or more optimal case) for Arrays in
 Array#join(), and especially if it is an array of Strings.

 There is such case. It's called _FastAsciiArrayJoin.

Is there a reason why the special case is faster in JS than native
(even taking into account coercion)?


 This is a relatively fast snippet of C++ code:

 This might have O(n^2) runtime complexity or waste memory for result (if
 library does capacity doubling on appends, which is common strategy)
 depending on how your C++ library reserves capacity for std::string.

 std::string join(const std::vectorstd::string array) {
   size_t total_length = 0;
   for (auto s : array) total_length += s.length();

   std::string str;
   str.reserve(total_length);
   for (auto s : array) str.append(s);
   return str;
 }

Amend that to simple. I'm not usually coding in C++.


 which is btw exactly what _FastAsciiArrayJoin attempts to do.




 Vyacheslav Egorov


 On Mon, Sep 1, 2014 at 11:20 AM, Isiah Meadows impinb...@gmail.com wrote:

 That library rarely does type checking. This contributes a lot of
 speed to their overall algorithm. If you look at my benchmarks,
 clearly, removing type checking helps, but it doesn't help for all
 applications. Another thing is that they use 99% C-style for loops
 with numerical indices instead of for-in loops (which always require
 some type checking because they work with all Objects and Arrays). The
 code actually resembles Asm.js in its heavy use of numbers.

 Array#[push|pop]() is easily optimized for array instances, because
 they each compile down to a single common assembly instruction. Also,
 in the case of Array#pop(), if the value isn't used, then it can
 simply pop to the same register over and over again, making it easily
 surpass 100 million operations per second if properly optimized.

 Back to the initial topic, my main request isn't to remove
 type-checking, but to make a special case (or more optimal case) for
 Arrays in Array#join(), and especially if it is an array of Strings.
 This is a relatively fast snippet of C++ code:

 std::string join(std::string* array, int len) {
   std::string str = '';
   while (len) {
 str += *(array + --len);
   }
   return str;
 }

 The Fast library could speed up some of their methods easily by
 reversing the iteration order for some methods (and I'm about to draft
 a quick patch to it).

 On Sun, Aug 31, 2014 at 9:22 AM, Jacob G kurtext...@gmail.com wrote:
  You should take a look at this too: https://github.com/codemix/fast.js -
  Functions written in JS are faster than the native functions. Is there
  something to be done?
 
  Am Sonntag, 31. August 2014 02:16:37 UTC+2 schrieb Isiah Meadows:
 
  I profiled various native methods, comparing them to equivalent
  polyfills
  and special-cased ones. I compared the following functions:
 
  Math.abs(x)
  Array.prototype.pop()
  Math.ceil(x)
  Array.prototype.join(sep)
 
  I found the following things from testing in various browsers:
 
  Math.abs(x)
 
  Webkit is about twice as fast as V8 in the native implementation.
  Webkit's performance in the rest is on par with V8's.
  Similar performance between type-ignorant polyfills and native
  implementation (on all browsers)
 
  Array.prototype.pop()
 
  Firefox clearly hasn't optimized the special case for arrays natively.
  JS polyfills are insanely slow, with type checking making little
  difference.
 
  Math.ceil(x)
 
  JS polyfills significantly slower, but that is explainable with the
  better
  bitwise ability with floats/doubles/etc. in C/C++.
 
  Mine does it without branching, but a potentially better way is to
  decrement if less than 0 and truncate it.
 
  Webkit is a little faster, but not a lot.
 
  Array.prototype.join(sep)
 
  JS standards polyfill rather slow
  JS polyfill assuming an array is over twice as fast as the native
  implementation (If it optimizes for this case, it should structurally
  resemble a Java Object[] internally).
 
  This really needs a special case (or better special case) for Arrays.
 
  I can't a patch for this yet, because of current CLA confusion
  (off-topic), but it should be relatively simple.
 
  --
  --
  v8-users mailing

[v8-users] Array#join - better to special case for Array/etc.?

2014-08-30 Thread Isiah Meadows
I profiled various native methods, comparing them to equivalent polyfills 
and special-cased ones. I compared the following functions:

   - Math.abs(x)
   - Array.prototype.pop()
   - Math.ceil(x)
   - Array.prototype.join(sep)

I found the following things from testing in various browsers:

   - Math.abs(x)
  - Webkit is about twice as fast as V8 in the native implementation.
  - Webkit's performance in the rest is on par with V8's.
  - Similar performance between type-ignorant polyfills and native 
  implementation (on all browsers)
   - Array.prototype.pop()
  - Firefox clearly hasn't optimized the special case for arrays 
  natively.
  - JS polyfills are insanely slow, with type checking making little 
  difference.
   - Math.ceil(x)
  - JS polyfills significantly slower, but that is explainable with the 
  better bitwise ability with floats/doubles/etc. in C/C++.
 - Mine does it without branching, but a potentially better way is 
 to decrement if less than 0 and truncate it.
  - Webkit is a little faster, but not a lot.
   - Array.prototype.join(sep)
  - JS standards polyfill rather slow
  - JS polyfill assuming an array is over twice as fast as the native 
  implementation (If it optimizes for this case, it should structurally 
  resemble a Java Object[] internally).
 - This really needs a special case (or better special case) for 
 Arrays.
  
I can't a patch for this yet, because of current CLA confusion (off-topic), 
but it should be relatively simple.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] My CLA submission

2014-08-05 Thread Isiah Meadows
Has my CLA been successfully submitted yet? I have tried 3 times already,
but am unsure.

-- 
Isiah Meadows

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Inherit prototype in C++

2014-08-05 Thread Isiah Meadows
You would probably get better help in the Node.js 
https://groups.google.com/forum/#!forum/nodejs mailing list.

On Saturday, August 2, 2014 10:18:42 AM UTC-4, Ingwie Phoenix wrote:

 Hey there.

 I am trying to write a nodejs extension in C++ and would like to use the 
 EventEmitter. However, I can see that its written completely in JS, so I 
 would have to somehow inherit the prototype of that. There is a JS way, but 
 it doesnt look very clean to me, since I would like to make it pure C++.

 So how can I:
 - Get the prototype of a JS thing?
 - Inherit my object from that prototype?

 The example I found is here: 
 https://github.com/bnoordhuis/node-event-emitter

 Hope you can help me there!

 Kind regards,
 Ingwie


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] CL about a week old with no input...

2014-07-26 Thread Isiah Meadows
I submitted my first CL about six days ago (as of today), and I'm worried
it got lost in the shuffle. I know v8-dev gets consistently flooded with
all the forwards from CR. Could I get some input?

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: CL about a week old with no input...

2014-07-26 Thread Isiah Meadows
Forgot the link... https://codereview.chromium.org/401783003/
On Jul 26, 2014 2:41 AM, Isiah Meadows impinb...@gmail.com wrote:

 I submitted my first CL about six days ago (as of today), and I'm worried
 it got lost in the shuffle. I know v8-dev gets consistently flooded with
 all the forwards from CR. Could I get some input?


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Re: CL about a week old with no input...

2014-07-26 Thread Isiah Meadows
No problem. Thank you! 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] PSA: Updated ES6 Draft out (as of yesterday)

2014-07-19 Thread Isiah Meadows
There are several significant changes to this draft, ranging from the 
ability to use spread operators on strings to `for (let i of null)` and 
`for (let i of undefined)` throwing a TypeError now. Here's a link:

http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] First-time committers using git-svn

2014-06-27 Thread Isiah Meadows
Is the bleeding_edge branch there, or is only the stable there? I know for a 
fact the latter, but based on what I have read, the main development branch 
doesn't exist there. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] First-time committers using git-svn

2014-06-27 Thread Isiah Meadows
Never mind. Question answered (I may have misread something). 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] First-time committers using git-svn

2014-06-25 Thread Isiah Meadows
How would I get the bleeding_edge source code without a @chromium.org 
account? I have a potential patch for my first commit, small in scale, but 
I would have to first test it against that for speed.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Interested in helping develop

2014-06-17 Thread Isiah Meadows
I would say that it would take almost the same exact change to optimize that. 
Where is the code style documentation for V8

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Intent to ship: ES6 Map Set

2014-06-17 Thread Isiah Meadows
They do. I've already checked 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Intent to ship: ES6 Map Set

2014-06-17 Thread Isiah Meadows
More specifically, you can use the array comprehension to run void functions. 
You'll just end up with an equal length array of `undefined`s. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Interested in helping develop

2014-06-14 Thread Isiah Meadows
Actually, a fairly similar hack appears to already be in place, and likely more 
efficient as well. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Interested in helping develop

2014-06-13 Thread Isiah Meadows
I have some knowledge of JavaScript, and I was wondering what I could help with 
in the V8 project. I have no professional experience, but I'm going to start 
college this fall towards a bachelor's in CS. It would definitely help me in 
getting experience for later on. 

Another side question is how much of V8's standard JavaScript library is 
actually implemented in JavaScript? Obvious ones that could be would be 
Array.prototype.forEach()/every()/etc. as a `for (var i of ...)`

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Interested in helping develop

2014-06-13 Thread Isiah Meadows
Accidentally hit the post button... 

I also came up with an optimization of the algorithm for 
String.prototype.startsWith() that basically, after the check that the search 
string is longer than the instance string plus the offset, it is simpler and 
likely quicker to compare it to the equal length substring than to compare each 
character, starting at the offset, unless the check is coded in C or possibly 
C++. 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] GNU readline and the GPL license

2014-06-12 Thread Isiah Meadows
Also, if one was released with that support, you could just license *that* part 
under the GPL, with the rest under something else if the primary license isn't 
compatible. That kind of licensing is actually relatively common practice for 
proprietary projects using open source software as part of their distributed 
binaries (e.g. Apple with Safari and multiple parts of OSX, Google with their 
Drive apps). 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Intent to ship: ES6 Map Set

2014-06-12 Thread Isiah Meadows
I would also like to point out that the ES6 array and generator comprehensions 
are very similar to the already existent Array.prototype.forEach() and 
Array.prototype.map() methods, both of which are not the most optimal at this 
point. Here's some relatively simple examples of this in ES6:

var x = [1, 2, 3, 4, 5];
x = [for (let i of x) i*i];

// fat arrow function not implemented in any JS engine AFAIK
var x = [1, 2, 3, 4, 5];
x = x.map((i) = i*i);

// valid ES5 and ES6
var x = [1, 2, 3, 4, 5];
x = x.map(function (i) { return i*i; });

These syntax changes all but require more optimization of the algorithms for 
the Array.prototype.forEach() and Array.prototype.map() methods. 

I don't know, though, if array comprehensions allow for void returns inside the 
functions executed, because I haven't really gone in depth into that part of 
the spec. I know that Haskell does, but Python doesn't, and I don't know about 
any other languages for sure. Also, reading the spec doesn't really hint either 
way explicitly in the algorithm, but it implies that it should be possible. 
There is no mention of anything wrong with any return that the function called 
itself doesn't have errors (aka void and undefined returns might be 
permissible... I'll have to check with the mailing list). 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
v8-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.