Thanks Mads, I guess the documentation I was missing was reading all
the APIs within v8.h. Lesson learned!

n17991:
You can always build the platform and then find libv8.a in the out/,
but I ripped the make files from the platform and beat my head against
the wall for a bit until it worked. The platform build will always be
at least one step behind the v8 trunk. I hope to contribute it back to
v8 once I'm done with my project, if someone else hasn't done it
already.


On Jul 1, 3:54 pm, n179911 <[email protected]> wrote:
> Hi Kelly,
>
> Can you please tell me how do you build v8 for android?
>
> Thank you.
>
>
>
> On Wed, Jun 23, 2010 at 4:01 PM, Kelly <[email protected]> wrote:
> > Am I missing some simple step in properly building/using v8, or is
> > something else wrong?
>
> > I'm building v8 for android but the results differ from older v8
> > binaries. Whenever I call any function (native or local) I get bad
> > returns. These worked fine when I linked to the libv8.a in the android
> > platform.
>
> > I have a test function(javascript):
>
> > function test() = {
> > return "success";
> > }
>
> > and I call this through v8 after I have run a file containing it (with
> > no errors using persistent global context 'context_'):
>
> >    TryCatch tc;
> >    v8::Handle<v8::Value> arg = v8::String::New("argument");
>
> >    Handle<String> process_name = String::New("test");
> >    Handle<Value> process_val = context_->Global()->Get(process_name);
>
> >    LOGI("Test for valid function");
>
> >    if (!process_val->IsFunction())
> >    {
> >        LOGE("Failed to get test()!");
> >        return;
> >    }
> >    else
> >    {
> >        LOGI("Grabbed function test()!");
> >    }
>
> >    Handle<Function> process_fun =
> > Handle<Function>::Cast(process_val);
>
> >    // Store the function in a Persistent handle, since we want that
> > globally
> >    Persistent<Function> test =
> > Persistent<Function>::New(process_fun);
>
> >    LOGI("Calling test()");
> >    result = test->Call(context_->Global(), 0, &arg);
> >    LOGI("called! test()");
>
> > but my result is always empty. This happens on native javascript
> > functions as well. And if I write bad code within the function or pass
> > a bad arg to eval() it returns an empty result, with NO EXCEPTION! So
> > not only is it busted, but error reporting isn't happening.
>
> > I was previously linking to the libv8.a out of the android platform
> > and the same exact code works fine.
>
> > I added some logs in v8 to see what was going on. The 'file(line):'
> > info is probably much more useful than my text:
>
> > /v8test.cpp(295):    Calling test()
> > /api.cc(2769):         V8 ping
> > /execution.cc(124): Calling Invoke()
> > /parser.cc(1337):     result == NULL
> > /top.cc(690):           Stack overflow!!
> > /execution.cc(124): Calling Invoke()
> > /runtime.cc(7003):   stack overflow
> > /top.cc(690):           Stack overflow!!
> > /execution.cc(108):  Pending Exception!!
> > /top.cc(925):           external_caught!! Uncaught RangeError: Maximum
> > call stack size exceeded
> > /execution.cc(108):  Pending Exception!!
> > /top.cc(925):            external_caught!! Uncaught RangeError:
> > Maximum call stack size exceeded
> > /api.cc(2772):          V8 ping
> > /api.cc(2773):          We have pending exception!!
> > /v8test.cpp(299):     called! test()
>
> > And then the result and exception are empty..
>
> > I've been working on this for a while.. and /frustrated.. Anyone have
> > any info the help?
>
> > --
> > v8-users mailing list
> > [email protected]
> >http://groups.google.com/group/v8-users

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to