[v8-users] porting a squirrelfish JavaScript extention to v8

2012-06-16 Thread Ashish S
Hi,

i am a newbie in v8..
We have a squirrelfish javascript extension that we need to port for v8 
engine.
We register our classes in squirrelfish engine using the  JSClassDefinition 
type.. and thereby creating the class instance by JSClassCreate(ClassRed);

Can anyone point me to some guide or code that will help me to do the same 
for v8 engine..

Thanks.

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

[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

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 pablo.s...@gmail.com 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 skripac...@gmail.com 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 vego...@chromium.org 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 skripac...@gmail.com 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