[v8-users] Re: Build error in trunk

2012-06-16 Thread mschwartz
This is definitely an issue.

MaybeObject* JSObject::OptimizeAsPrototype() {
  if (IsGlobalObject()) return this;

  // Make sure prototypes are fast objects and their maps have the bit set
  // so they remain fast.
//  Map* proto_map = map();
  if (!HasFastProperties()) {
MaybeObject* new_proto = TransformToFastProperties(0);
if (new_proto->IsFailure()) return new_proto;
ASSERT(new_proto == this);
//proto_map = map();
  }
  return this;
}

Note the two lines I had to comment out to make this compile.



On Friday, June 15, 2012 9:34:57 AM UTC-7, mschwartz wrote:
>
> make[3]: Entering directory 
> `/home/mschwartz/src/SilkJS/src/v8-read-only/out'
>   LINK(target) 
> /home/mschwartz/src/SilkJS/src/v8-read-only/out/x64.release/preparser
>   CXX(target) 
> /home/mschwartz/src/SilkJS/src/v8-read-only/out/x64.release/obj.target/v8_base/src/objects.o
> ../src/objects.cc: In member function ‘v8::internal::MaybeObject* 
> v8::internal::JSObject::OptimizeAsPrototype()’:
> ../src/objects.cc:7517:8: error: variable ‘proto_map’ set but not used 
> [-Werror=unused-but-set-variable]
> cc1plus: all warnings being treated as errors
> make[3]: *** 
> [/home/mschwartz/src/SilkJS/src/v8-read-only/out/x64.release/obj.target/v8_base/src/objects.o]
>  
> Error 1
> make[3]: Leaving directory 
> `/home/mschwartz/src/SilkJS/src/v8-read-only/out'
> make[2]: *** [x64.release] Error 2
> make[2]: Leaving directory `/home/mschwartz/src/SilkJS/src/v8-read-only'
> make[1]: *** 
> [v8-read-only/out/x64.release/obj.target/tools/gyp/libv8_base.a] Error 2
> make[1]: Leaving directory `/home/mschwartz/src/SilkJS/src'
> make: *** [all] Error 2
>
>

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

[v8-users] ArrayBuffer fast access

2012-06-16 Thread Pablo Sole
Hello there,

I'm embedding v8 into a binary instrumentation framework and I'm trying
to use an ArrayBuffer/TypedBuffer for fast memory operations (like
Tamarin/ActionScript does for the Memory object operations), but I
couldn't find any fast access defined in the JIT compiler, so I suppose
that a read/write to a TypedBuffer goes all the way of an object and
property resolution. Although, for this case it could just be a range
check and a memory load/store operation.

So, would it be faster to use a regular array of SMIs (SMIs in the
indexes and in the values) without holes faster than an ArrayBuffer? Is
there any plan to provide a fast path for this case?

Thanks,

pablo.

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users


Re: [v8-users] ArrayBuffer fast access

2012-06-16 Thread Jakob Kummerow
Accessing TypedArrays is at least as fast as accessing regular JSArrays,
since they never contain holes and the optimizing compiler knows what types
to expect from their elements. Basically the recently introduced special
handling of SMI arrays without holes is an attempt to get them closer to
TypedArray performance.

Note that TypedArrays (a.k.a. "external arrays") are not defined in V8
itself. They are implemented by the embedder, e.g. the developer shell "d8"
or the WebKit V8 bindings. Look at these two examples for how to do that.


On Sat, Jun 16, 2012 at 5:44 PM, Pablo Sole  wrote:

> Hello there,
>
> I'm embedding v8 into a binary instrumentation framework and I'm trying
> to use an ArrayBuffer/TypedBuffer for fast memory operations (like
> Tamarin/ActionScript does for the Memory object operations), but I
> couldn't find any fast access defined in the JIT compiler, so I suppose
> that a read/write to a TypedBuffer goes all the way of an object and
> property resolution. Although, for this case it could just be a range
> check and a memory load/store operation.
>
> So, would it be faster to use a regular array of SMIs (SMIs in the
> indexes and in the values) without holes faster than an ArrayBuffer? Is
> there any plan to provide a fast path for this case?
>
> Thanks,
>
> pablo.
>
>

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

Re: [v8-users] gen-postmortem-metadata.py

2012-06-16 Thread Jakob Kummerow
Yeah, I agree that this should use "open" instead of "file". Note, however,
that http://docs.python.org/library/functions.html#file says that using
open() is "preferable", but not required.

As for the process how to contribute, check out
https://code.google.com/p/v8/wiki/Contributing .


On Sat, Jun 16, 2012 at 1:44 AM, Nicolai Willems  wrote:

> Hello
>
> I was a bit in doubt how I should report this issue(maybe this should go
> to the contributors list?). But I found a minor thing in one of the build
> scripts:
>
> http://code.google.com/p/v8/source/browse/branches/bleeding_edge/tools/gen-postmortem-metadata.py#434
>
> Says
> out = file(sys.argv[1], 'w');
> Should
> out = open(sys.argv[1], 'w');
>
> I hope this helps. I would be happy to commit/send something, but for now
> I'm a bit in doubt about how.
>
> /Nicolai Willems
>
>

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

Re: [v8-users] ArrayBuffer fast access

2012-06-16 Thread Vyacheslav Egorov
> I couldn't find any fast access defined in the JIT compiler

There are fast paths for typed arrays inside V8, they are just not
called typed arrays :-) Look for "external arrays" instead.

For them V8 has both specialized IC stubs (e.g. load stub:
https://github.com/v8/v8/blob/master/src/ia32/stub-cache-ia32.cc#L3508
) and support in optimizing compiler pipeline (see IR instructions:
LoadExternalArrayPointer, LoadKeyedSpecializedArrayElement,
StoreKeyedSpecializedArrayElement).

I always use typed arrays when they are available (this communicates
my intent both to the JIT compiler and to a person reading my code).

--
Vyacheslav Egorov


On Sat, Jun 16, 2012 at 5:44 PM, Pablo Sole  wrote:
> Hello there,
>
> I'm embedding v8 into a binary instrumentation framework and I'm trying
> to use an ArrayBuffer/TypedBuffer for fast memory operations (like
> Tamarin/ActionScript does for the Memory object operations), but I
> couldn't find any fast access defined in the JIT compiler, so I suppose
> that a read/write to a TypedBuffer goes all the way of an object and
> property resolution. Although, for this case it could just be a range
> check and a memory load/store operation.
>
> So, would it be faster to use a regular array of SMIs (SMIs in the
> indexes and in the values) without holes faster than an ArrayBuffer? Is
> there any plan to provide a fast path for this case?
>
> Thanks,
>
> pablo.
>
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users


Re: [v8-users] Re: [SIGSEGV] v8::HandleScope::HandleScope()

2012-06-16 Thread Vyacheslav Egorov
This assertion indeed indicates that your are trying to use V8 from a
thread that does not own an isolate.

You should get exclusive access to the isolate you are going to use with Locker:

https://github.com/v8/v8/blob/master/include/v8.h#L3638

--
Vyacheslav Egorov


On Fri, Jun 15, 2012 at 1:16 PM, Serega  wrote:
> #
> # Fatal error in ../src/isolate.h, line 440
> # CHECK(isolate != __null) failed
> #
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> [Switching to Thread 0x74d56700 (LWP 8551)]
> v8::internal::OS::DebugBreak () at ../src/platform-linux.cc:389
> 389     }
> (gdb) step
> v8::internal::OS::Abort () at ../src/platform-linux.cc:373
> 373       abort();
> (gdb) step
>
> Program received signal SIGABRT, Aborted.
> 0x76cbd445 in raise () from /lib/x86_64-linux-gnu/libc.so.6
> (gdb) step
> Single stepping until exit from function raise,
> which has no line number information.
> [Thread 0x74d56700 (LWP 8551) exited]
> [Thread 0x7fffef7fe700 (LWP 8552) exited]
> [Thread 0x7fffe700 (LWP 8550) exited]
> [Thread 0x75d58700 (LWP 8548) exited]
> [Thread 0x76559700 (LWP 8547) exited]
> [Thread 0x77ff7700 (LWP 8546) exited]
> [Thread 0x77fd5740 (LWP 8519) exited]
>
> Program terminated with signal SIGABRT, Aborted.
> The program no longer exists.
>
> Thank you!
> One Question more, can you show example, how to isolate v8?
>
> On 15 июн, 13:38, Vyacheslav Egorov  wrote:
>> Hello,
>>
>> Please link against debug version of V8 to get more information about the 
>> crash.
>>
>> Also ensure that the thread that invokes your even_handler owns V8
>> Isolate if you have multiple threads using V8 concurrently.
>>
>> --
>> Vyacheslav Egorov
>>
>>
>>
>>
>>
>>
>>
>> On Fri, Jun 15, 2012 at 8:28 AM, Serega  wrote:
>> > Hellow! I'm having a little trouble.
>>
>> > Program received signal SIGSEGV, Segmentation fault.
>> > [Switching to Thread 0x75f66700 (LWP 21828)]
>> > 0x772bcff7 in v8::HandleScope::HandleScope() () from /usr/lib/
>> > libv8.so
>> > (gdb) step
>> > Single stepping until exit from function _ZN2v811HandleScopeC2Ev,
>> > which has no line number information.
>> > [Thread 0x75f66700 (LWP 21828) exited]
>> > [Thread 0x7fffe77fe700 (LWP 21832) exited]
>> > [Thread 0x7fffe7fff700 (LWP 21831) exited]
>> > [Thread 0x74f64700 (LWP 21830) exited]
>> > [Thread 0x75765700 (LWP 21829) exited]
>> > [Thread 0x76767700 (LWP 21827) exited]
>> > [Thread 0x77ff7700 (LWP 21826) exited]
>>
>> > Program terminated with signal SIGSEGV, Segmentation fault.
>> > The program no longer exists.
>>
>> > Why i can't create HandleScope in function that is runing thrue
>> > pointer?
>>
>> > void *event_handler(...) {
>>
>> >      HandleScope handle_scope;
>>
>> > ...
>> > }
>>
>> > --
>> > v8-users mailing list
>> > v8-users@googlegroups.com
>> >http://groups.google.com/group/v8-users
>
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users