Commit Graph

192 Commits

Author SHA1 Message Date
ager@chromium.org
652335b995 Implement support for reattaching a global object to a context. This
can be used to use the same global object for different contexts at
different points in time.

Review URL: http://codereview.chromium.org/1207003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-24 13:24:46 +00:00
pfeldman@chromium.org
54f0a5b221 Expose debug context into the native code. This change is doing several things:
1) Exposes Local<Context> v8::Debug::GetDebugContext().
Rationale: We can already get debugger context instance using various workarounds,
so exposing it explicitly in the API only makes things more clear.

2) Removes debugger.HasJavaScriptFrames() requirement for entering debugger context.
Rationale: Sometimes we'd like to call into debugger from the external native code.

3) Makes Debugger v8::Debug::Call execute on debugger context's global object.
Rationale: This is somewhat arguable, but temporary measure. We've agreed that we
should introduce a DebugAPI object that would expose necessary API in the debug-delay.
The problem is that it would take some time to define this API and it is not really
convenient to do that on the v8 land given the difference in v8 / host lifecycle.
The plan is to compose this API as a Debug.* wrapper outside v8 by means of exposing
debugger context's global object here, and once API settles down, upstream it to v8 and
start making Debug::Calls on this new DebugAPI object instead.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-24 13:09:02 +00:00
mikhail.naganov@gmail.com
4d1f8cbfd6 New GCCallbacks with additional parameters.
Author: Ilya Tikhonovsky <loislo@chromium.org>
Original issue: http://codereview.chromium.org/1094002

TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/1165004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4226 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 13:11:44 +00:00
kasperl@chromium.org
7d6a3b433f Merge the partial_snapshots branch back into bleeding_edge. For
now, the custom call generator stuff is disabled.
Review URL: http://codereview.chromium.org/1094014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 11:40:38 +00:00
mikhail.naganov@gmail.com
c413105da7 Make the assumption on the minimum buffer size for GetLogLines explicit.
Review URL: http://codereview.chromium.org/799008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4097 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 09:48:01 +00:00
kasperl@chromium.org
95964bd95f Let the callers of V8::ContextDisposedNoticication() know
how many pending context disposals there are.
Review URL: http://codereview.chromium.org/669266

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4049 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-08 11:19:20 +00:00
ager@chromium.org
fe3b875577 Add IsExecutionTerminating api method.
IsExecutionTerminating returns true if a termination exception is
currently being propagated.  C++ code should not reenter V8 when
IsExecutionTerminating returns true.

Review URL: http://codereview.chromium.org/668052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4016 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 12:13:04 +00:00
lrn@chromium.org
d51f2c96cb Added implementation if Uint32::Value.
Review URL: http://codereview.chromium.org/661275

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4008 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-03 13:44:20 +00:00
vitalyr@chromium.org
9f681fa9d6 Small API improvements:
* Added Get and Set taking uint32_t for faster and more convenient
   access to elements.

 * Added less verbose casting for handles. Now instead of
       v8::Local<v8::String>::Cast(args[0])
   one can write
       args[0].As<v8::String>().

Review URL: http://codereview.chromium.org/660243

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4002 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-02 18:47:03 +00:00
kasperl@chromium.org
a60beefd1b Tweak the new context disposal GC heuristic to cleanly separate
it from the old heuristic (disabled if the new notications are 
used) and make sure to not force a GC if one has already happened
after V8 received the last context disposal notification.
Review URL: http://codereview.chromium.org/660267

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 08:49:33 +00:00
kasperl@chromium.org
4abae7a728 Add an explicit API entry to notify V8 that one or more
contexts have been disposed. 
Review URL: http://codereview.chromium.org/661173

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 11:51:33 +00:00
mikhail.naganov@gmail.com
39e63f0aec Implement tagging of profiler log event blocks.
This change allows to associate integer tags with blocks of profiler
log events, and repeat calls to 'ResumeProfiler' / 'PauseProfiler' in
order to establsh nested (not necessary properly nested) blocks. By
supporting this, we will be able to match WebInspector's CPU profiler
abilities in DevTools.

I also refactored some testing code.

Review URL: http://codereview.chromium.org/619004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3889 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 13:23:46 +00:00
mikhail.naganov@gmail.com
dcef87af66 Enable passing of script data via script creation methods.
Patch by Andrey Kosyakov <caseq@chromium.org>
Original issue http://codereview.chromium.org/606053

TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/608013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:15:31 +00:00
mikhail.naganov@gmail.com
d3ce4347d9 Add GetScriptOrigin and GetScriptLineNumber functions for Timeline panel.
Patch by Ilya Tikhonovsky <loislo@chromium.org>.
Original issue: http://codereview.chromium.org/565007

TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/594058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:19:15 +00:00
antonm@chromium.org
5ecfd4bfe9 Refactor prototype setting code and expose SetPrototype to public V8 API.
Review URL: http://codereview.chromium.org/598020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3829 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 14:44:15 +00:00
peter.rybin@gmail.com
5d60fa7ac8 Implement issue 549 Make V8 call DebugMessageDispatchHandler with Locker locked
Review URL: http://codereview.chromium.org/505025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3634 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 15:48:41 +00:00
peter.rybin@gmail.com
ec86bea132 Implement issue 554 Add "ProcessDebuggerRequests" call to Debug Agent API
Review URL: http://codereview.chromium.org/549057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3623 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 21:14:56 +00:00
christian.plesner.hansen@gmail.com
41e1d6a6a5 Added ScriptData::HasError.
Review URL: http://codereview.chromium.org/542010


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-11 12:13:24 +00:00
peter.rybin@gmail.com
d3e63a319b Reapply "wait for connection" feature implementation
Review URL: http://codereview.chromium.org/491079


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3500 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 20:30:29 +00:00
sgjesse@chromium.org
f74429b917 Reverted r3457
Caused compilation errors in cctests and on ARM platform.

TBR=peter.rybin@gmail.com
Review URL: http://codereview.chromium.org/491074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-14 07:51:59 +00:00
peter.rybin@gmail.com
a8cab84e04 Implement "wait for connection" feature
Review URL: http://codereview.chromium.org/489005


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3457 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-13 21:15:02 +00:00
vitalyr@chromium.org
41eb2f22d0 External string table.
Instead of weak handles external strings use a separate table.  This
table uses 5 times less memory than weak handles.  Moreover, since we
don't have to follow the weak handle callback protocol we can collect
the strings faster and even on scavenge collections.

Review URL: http://codereview.chromium.org/467037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-09 14:32:45 +00:00
sgjesse@chromium.org
6d163d9fd0 Remove usage of JSArray in Script object
Storing a JSArray in the Script object could cause an indirect reference from the compilation cache to a global object to be created. Now the line ends are only stored as a FixedArrya and when that is needed in JavaScript a JSArray copy is created. Changed some of the JavaScript code to cache the line ends in a local variable for better performance.

BUG=http://code.google.com/p/v8/issues/detail?id=528
TEST=test/test-api/Bug528
Review URL: http://codereview.chromium.org/434117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-27 14:10:48 +00:00
sgjesse@chromium.org
eb4d261e24 Remove the different length string types
The different length string types was used to encode the string length and the hash in one field. This is now split into two fields one for length and one for hash. The hash field still encodes the array index of the string if it has one. If an array index is encoded in the hash field the string length is added to the top bits of the hash field to avoid a hash value of zero.

On 32-bit this causes an additional 4 bytes to be used for all string objects. On 64-bit this will be half on average dur to pointer alignment.
Review URL: http://codereview.chromium.org/436001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 14:10:06 +00:00
sgjesse@chromium.org
d55d3ce89a Add DebugMessageDispatchHandler
A callback on the debugger thread when a message is received. Allows the 
embedding application to wake up the main thread in order to handle the 
message. Useful when the embedding application is idle and sitting in a 
select() call.

Patch by Ryan Dahl <coldredlemur@gmail.com>

Review URL: http://codereview.chromium.org/395013


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 08:59:28 +00:00
ager@chromium.org
b5a19c1036 Rework the way we handle the fact that the ARM simulator uses a
separate JS stack.

In exception handling, we need to be able to compare addresses into
the JavaScript portion of the stack with the address of a C++ handler
on the stack.  Since the stacks are separate on the simulator, we need
a JavaScript stack address corresponding to a C++ try catch handler in
order to perform valid address comparisons.

On the simulator, we now link the C++ try catch handlers indirectly
through the JS stack and use the JS stack indirection address for
comparisons.

      JS                    C++
                           
                           handler
 [C++ address]   <------    next_
                \
                 \
                  \---->   handler
 [C++ address]   <------    next_


On actual hardware the C++ try catch handlers continue to be directly
linked.

BUG=http://code.google.com/p/v8/issues/detail?id=271
Review URL: http://codereview.chromium.org/360004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 13:27:21 +00:00
christian.plesner.hansen@gmail.com
850487401d Added TryCatch::ReThrow method.
Review URL: http://codereview.chromium.org/342078


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 08:53:34 +00:00
erik.corry@gmail.com
fb2317b63b New snapshot framework. Doesn't work on ARM yet (code targets
are different).  Is able to deserialize the whole heap and run
some stuff.  Not available as the primary snapshot system yet.
Review URL: http://codereview.chromium.org/335009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 11:54:01 +00:00
kbr@chromium.org
46e6297e3e Added infrastructure for optimizing new CanvasArray types in WebGL
specification under development. The optimizations are patterned after
those previously done for CanvasPixelArray. This CL adds all of the
necessary framework but continues to use the generic KeyedLoadIC and
KeyedStoreIC code, to create a baseline for benchmarking purposes. The
next CL will add the optimized ICs to ic-ia32.cc and ic-x64.cc.

These new CanvasArray types have different semantics than
CanvasPixelArray; out-of-range values are clamped via C cast
semantics, which is cheaper than the clamping behavior specified by
CanvasPixelArray. Out-of-range indices raise exceptions instead of
being silently ignored.

As part of this work, pulled FloatingPointHelper::AllocateHeapNumber
up to MacroAssembler on ia32 and x64 platforms. Slightly refactored
KeyedLoadIC and KeyedStoreIC. Fixed encoding for fistp_d on x64 and
added a few more instructions that are needed for the new ICs. The
test cases in test-api.cc have been verified by hand to exercise all
of the generated code paths in the forthcoming specialized ICs.

Review URL: http://codereview.chromium.org/293023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 15:26:17 +00:00
ager@chromium.org
390fd2a3b8 Add an API to V8 to get simple heap statistics.
Review URL: http://codereview.chromium.org/261037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 07:51:49 +00:00
antonm@chromium.org
5560d27764 Move implementation of Integer::NewFromUnsigned into api.cc.
Review URL: http://codereview.chromium.org/269105

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3084 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-16 12:51:18 +00:00
lrn@chromium.org
f4516c8bdd Remove dependency on V8_TARGET_ARCH in v8.h
Review URL: http://codereview.chromium.org/287004


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3080 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-16 10:29:10 +00:00
iposva@chromium.org
e0b8ab8815 - Add String::Concat(Handle<String> left, Handle<String> right) to the V8 API.
This is the first step to address http://crbug.com/23131 by creating
a series of V8 ConsStrings as more data arrives from the server.

Review URL: http://codereview.chromium.org/271085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3066 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-14 15:26:38 +00:00
antonm@chromium.org
1f8399bdda Partially revert r2761.
Do not create handles for values of internal fields---this operation is performance
critical and plain pointers are safe.

Appy the same approach to External wrapping and unwrapping.

Plus some minor refactorings.

Review URL: http://codereview.chromium.org/270085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3064 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-14 14:32:39 +00:00
lrn@chromium.org
5767628039 Removed 31-bit smis.
Review URL: http://codereview.chromium.org/267049


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-12 11:19:20 +00:00
antonm@chromium.org
82a231412d Introduce v8::Integer::NewFromUnsigned method.
Review URL: http://codereview.chromium.org/251100

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-08 12:54:29 +00:00
lrn@chromium.org
aed6a37c10 X64: Convert smis to holding 32 bits of payload.
Review URL: http://codereview.chromium.org/196139


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-08 12:36:12 +00:00
mike@belshe.com
5191c81dff Remove the high-priority flag from IdleNotification() since
it is a strange API and unused anyway.

When we roll this to Chrome, we'll need a small chrome patch
to fix Chrome's usage of the API.

Review URL: http://codereview.chromium.org/257035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-06 00:06:17 +00:00
whesse@chromium.org
bd1378eb20 Revert revisions 3013, 3014, and 3016. We need a better solution.
Review URL: http://codereview.chromium.org/251088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3017 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-05 10:50:55 +00:00
antonm@chromium.org
8925e8af0a Add a method to convert unsigned C integer into V8 Integer.
Review URL: http://codereview.chromium.org/260002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3013 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 15:51:07 +00:00
erik.corry@gmail.com
f2de3fd6d2 Fix the stack limits setting API so it is usable.
Review URL: http://codereview.chromium.org/242074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3005 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-01 10:33:05 +00:00
christian.plesner.hansen@gmail.com
87fbbd5dfc Changed structure of accessor arguments passing to allow accessor
callbacks to be called directly from native code.

Review URL: http://codereview.chromium.org/242050


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-30 12:25:46 +00:00
vitalyr@chromium.org
260c39270f API: added warning about FunctionTemplate::GetFunction lifetime.
Review URL: http://codereview.chromium.org/251042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2992 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-30 08:27:58 +00:00
vitalyr@chromium.org
00c15b7c8b API: added a few missing HandleScope-s.
Review URL: http://codereview.chromium.org/245024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-28 14:32:48 +00:00
antonm@chromium.org
228f4aee13 Add another method that allows to lookup for a real named property not only
in prototype chain, but in the object itself.

Review URL: http://codereview.chromium.org/235004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2969 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-25 12:29:24 +00:00
antonm@chromium.org
a0bf4c55c4 Fix documentation of security callbacks.
Actually 1st parameter could be any object in prototype chain from this to actual holder, not only a
the global object.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-18 12:18:08 +00:00
christian.plesner.hansen@gmail.com
87dab2f5cd Add Object::IsDirty function in the API.
Review URL: http://codereview.chromium.org/209013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-17 08:58:06 +00:00
christian.plesner.hansen@gmail.com
681e67b775 Make 'hidden' the default visibility for gcc. Add build option,
visibility=[hidden|default], that controls visibility and make
'hidden' the default.  Export a few variables that had been forgotten.

Review URL: http://codereview.chromium.org/206011


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-15 11:11:09 +00:00
christian.plesner.hansen@gmail.com
d391c5491e Made function prototype property DontEnum for compatibility with
Safari.  Fixed const error in api.

Review URL: http://codereview.chromium.org/200056


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2852 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-09 09:30:33 +00:00
christian.plesner.hansen@gmail.com
6a323d3afe Const Correctness for String::Value
Patch by Patrick Gansterer <paroga@paroga.com>.
Review at http://codereview.chromium.org/199043.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-07 07:54:51 +00:00
christian.plesner.hansen@gmail.com
af6c6a5533 Api inlining. Made some core functionality available in the api and
made inline versions of some hot functions.  Changed api to use
internal Object pointers rather than void pointers.

Speeds up getElementById by ~7%.
Review URL: http://codereview.chromium.org/173348

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 10:33:11 +00:00
mike@belshe.com
6f3c50460a Update the Idle collector to do a full GC
after being idle for some time.

Remove the default argument from CollectAllGarbage.

Review URL: http://codereview.chromium.org/174302

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-25 02:54:39 +00:00
feng@chromium.org
855c654b25 Add LowMemoryNotification to the API on Android platform.
Android system provides a unique feature that it sends a notification to the
browser in low memory condition, and the browser cleans up cache and frees
resources. Forcing a GC in low memory condition can free DOM objects and also
can shrink the old spaces.

This patch addresses the last comment in 
http://codereview.chromium.org/173016/show

	
Mads Ager 2009/08/19 17:24:23 
I would prefer to not use the flags to signal that a compacting collection is
requested.

TBR = ager
Review URL: http://codereview.chromium.org/173102

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-20 00:07:19 +00:00
ager@chromium.org
0efbd40baf Add support for forceful termination of JavaScript execution.
The termination is achieved by throwing an exception that is uncatchable by JavaScript exception handlers.
Review URL: http://codereview.chromium.org/174056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 15:14:11 +00:00
christian.plesner.hansen@gmail.com
e64bf9ad6c Added API for getting object mirrors
Added Debug::GetMirror call to get a mirror for a given object.

Review URL: http://codereview.chromium.org/172045


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-17 14:26:48 +00:00
christian.plesner.hansen@gmail.com
11e7f2a30b Added API call to get the stack trace for an exception
Added TryCatch::StackTrace that gets the stack trace for the thrown
exception.

Review URL: http://codereview.chromium.org/171042


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-17 13:34:41 +00:00
christian.plesner.hansen@gmail.com
570788b115 Context-independent script compilation.
Added Script::New calls that create a new context-independent
(boilerplate) script which can be executed in any context, unlike the
current scripts which bind the context in which they're compiled.

Review URL: http://codereview.chromium.org/172043


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2697 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-17 11:41:00 +00:00
bak@chromium.org
7f18bef0d2 Added idle notification to the API.
The implementation is still empty.

Review URL: http://codereview.chromium.org/165445

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-13 09:35:51 +00:00
christian.plesner.hansen@gmail.com
ba974ace1b Add api call to determine whether a string can be externalized.
Review URL: http://codereview.chromium.org/164393

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-12 10:27:35 +00:00
vitalyr@chromium.org
d6fcda0044 API: added function to find instance of template in prototype chain.
Also inlined Object::IsInstanceOf.

This new function is intended to be used to speed up DOM bindings.

Review URL: http://codereview.chromium.org/165044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-06 13:35:21 +00:00
sgjesse@chromium.org
27ffe641d6 On Linus don't force-export V8 symbols unless v8 is built as a shared library.
This lands: http://codereview.chromium.org/160556.

TBR=piman@chromium.org
Review URL: http://codereview.chromium.org/160634

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-05 07:59:46 +00:00
mikhail.naganov@gmail.com
5470f9b132 Add an ability to initiate GC through V8 API.
I'm planning to use it in DevTools heap profiler. It is a common scenario in debugging memory leaks to enforce GC, then perform an operation, then enforce GC again to check for non-collected (that is, leaked) objects. Using the existing GC extension isn't possible because it doesn't exposed in the normal operation mode of Chromium.

Review URL: http://codereview.chromium.org/159787

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2619 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-04 14:14:01 +00:00
mikhail.naganov@gmail.com
e97554ed10 Add generic V8 API functions for controlling profiling aspects.
As we'll have several aspects of heap profiling, it is more handy to control them using binary flags than by individual functions. CPU profiling represent just a particular aspect to control, so {Pause,Resume}Profiler and IsProfilerPaused are only left for compatibility.

For now, PROFILER_FLAG_HEAP_STATS and PROFILER_FLAG_JS_CONSTRUCTOR are equivalent, but later will be split.

Review URL: http://codereview.chromium.org/159581

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-29 11:23:36 +00:00
iposva@chromium.org
1ce28eda0b - Expose CanvasPixelArray functionality directly in JavaScript
indexed property accesses.
- The IC stubs have not been updated to handle these directly, but
  at least we do not have to leave the VM to access bytes.

Review URL: http://codereview.chromium.org/159263

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-28 08:43:51 +00:00
antonm@chromium.org
9acd081326 Force inlining of some handle methods.
Review URL: http://codereview.chromium.org/159236

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2529 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-23 13:36:28 +00:00
antonm@chromium.org
3c6c399381 Introduce faster utilty methods for storing and retrieving native pointers
in internal fields.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2498 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 10:35:15 +00:00
antonm@chromium.org
0402951844 A helper function to speed up creation of V8 wrappers for DOM Nodes.
Review URL: http://codereview.chromium.org/141044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-24 11:52:52 +00:00
antonm@chromium.org
d62f77fd21 Lars spotted that Handle::operator -> and * are not inlined. That apparently buys us almost ~10%
speedup for some DOM operations.

Review URL: http://codereview.chromium.org/122038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-11 19:44:48 +00:00
ager@chromium.org
24d22b567a Introduce an API to force the deletion of a property ignoring
interceptors and dont-delete attributes.

Minor change to the behavior of eval: throw exception when calling
eval in a context for which the global has been detached.  This
matches the behavior of both Firefox and Safari post navigation in the
browser.
Review URL: http://codereview.chromium.org/118374

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 09:46:09 +00:00
mikhail.naganov@gmail.com
064af4286e Expose IsProfilerPaused function on the public interface.
This is needed for DevTools Profiler because of its asynchronous and multi-client architecture.

Review URL: http://codereview.chromium.org/115761


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 12:34:47 +00:00
ager@chromium.org
10b8928e0e Expose the calling context through the API.
In C++ callbacks, we can now get the context of the javascript code
that called the callback.

Review URL: http://codereview.chromium.org/113622

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 07:44:59 +00:00
sgjesse@chromium.org
e3464bca9d Fix compilation on MinGW
On MinGW _WIN32_WINNT needs to be 0x501 (Windows XP) instead of 0x500 (Windows 2000) for some TCP/IP API's to be present.

MinGW uses stdint.h whereas Visual C++ does not.
Review URL: http://codereview.chromium.org/113576

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-19 09:59:41 +00:00
sgjesse@chromium.org
94879a93b0 Add a script cache to the debugger
When loaded scripts are requested this cache is filled with all the script objects in the heap. Hereafter its content is kept in sync with the active scripts in the heap through the notifications of new scripts compiled and by using weak handles to get notified when a script is collected.

Through the tracking of collected scripts the debugger event OnScriptCollected have been added to notify a debugger that a script previously returned through the scripts command is no longer in use.

Make the ComputeIntegerHash globally available.

Moved clearing of the mirror cache to when debugger is really left. Previously recursive invocations of the debugger cause the mirror cache to be cleared causing handles to become either stale or reference other objects.
Review URL: http://codereview.chromium.org/115462

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 13:14:37 +00:00
davemoore@chromium.org
9336f58fa2 Make check in GetExternalString a runtime check instead of ASSERT.
This will allow us to remove the separate call to IsExternal() from our
chrome client code, speeding up the combination.

Review URL: http://codereview.chromium.org/113035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1887 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 18:30:37 +00:00
mikhail.naganov@gmail.com
bf63b8f173 Introduce internal Log class that handles writing log messages, enable logging to memory buffer.
This will enable reading profiler log in Chrome. The current implementation of memory buffer is trivial (fixed size buffer, no memory recycling) but enough to start end-to-end DevTools Profiler implementation. Later it will be enhanced.

Review URL: http://codereview.chromium.org/108011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 15:57:47 +00:00
deanm@chromium.org
b432613622 Use our own macros for 64-bit constants.
Review URL: http://codereview.chromium.org/109017


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 10:21:28 +00:00
lrn@chromium.org
3fa2a67ffb Changed definition of INT64_C and UINT64_C to use the one in stdint.h.
Since Chromium build system appears to define __STDC_CONSTANT_MACROS, we might as well use the macro definitions from stdint.h in all cases.

Review URL: http://codereview.chromium.org/109016


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 09:50:29 +00:00
sgjesse@chromium.org
3cdb194c56 Add the ability to set embedder data on created contexts from the API.
Expose the active context where a break event occoured through the debug message handler.
Review URL: http://codereview.chromium.org/109013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 09:38:45 +00:00
deanm@chromium.org
eb906555fc Cleanup include guards:
- Fix some typos / guards that didn't match the filename.
- Fix some style inconsistencies.
- Add guards to files that were missing them.
- Add the directory name to the guard.

Review URL: http://codereview.chromium.org/99343


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1845 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-04 13:36:43 +00:00
whesse@chromium.org
aa5f53101f Include 64-bit pointer and constant types in include/v8.h.
Make some definitions in globals.h 64-bit safe
Review URL: http://codereview.chromium.org/100336

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-04 13:29:29 +00:00
asargent@chromium.org
9926c85e1f Add to documentation for GetIdentityHash
Review URL: http://codereview.chromium.org/99250

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1836 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-01 16:39:21 +00:00
sgjesse@chromium.org
2beedf1181 Create a transition API for the debug message handler.
Kept the previous message handler API to avoid breaking clients depending on it.

The new message handler API uses a new name ending with 2.
Review URL: http://codereview.chromium.org/100158

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 12:54:07 +00:00
sgjesse@chromium.org
37036ff446 Remove tab to satisfy lint
TBR=ager@chromium.org

Review URL: http://codereview.chromium.org/99180



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 11:12:58 +00:00
sgjesse@chromium.org
f8319c3cba Re-submit http://codereview.chromium.org/99122 after fixing compilation issues.
TBR=yurys@chromium.org
Review URL: http://codereview.chromium.org/100155

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 09:04:20 +00:00
sgjesse@chromium.org
974734bedb Reverting 1811.
Review URL: http://codereview.chromium.org/99175

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 08:33:01 +00:00
sgjesse@chromium.org
95288e916e Changed the debugger message API to receive an object instead of a JSON string.
The object delivered to the debug message handler contains additional information on the current break handling the messages.

Clients which require just JSON message parsing can simply get the JSON using the GetJSON message on the message object to still have the previous behaviour.

  NewMessageHangler(const v8::Debug::Message& message) {
    v8::String::Value val(message.GetJSON());
    OldMessageHandler(Vector<uint16_t>(const_cast<uint16_t*>(*val), val.length()));
  }

Refactored some of the debugger code to use internal handles instead of API handles. Also changed Object to JSObject is some places.

The access to the active context when the break occurred is still not implemented. I will add this in a new CL, as this one is quite big already.
Review URL: http://codereview.chromium.org/99122

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 08:23:58 +00:00
sgjesse@chromium.org
8fefc769f5 Removed the debug message thread.
The debug message thread was introduced to make it possible to have the message handler callback be called from a different thread than the thread running V8 where the debug event occoured, but it never had any practical use, and prevents providing information to the message handler which is only available from the V8 thread.

In the future any thread decoupling will have do be done by the embedder.

This also removes the queue used for outbound messages.

Renamed the class Message to CommandMessage as it is only used for debugger commands from the client. Related message queue classes has also been renamed.
Review URL: http://codereview.chromium.org/93118

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1788 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 12:05:40 +00:00
pfeldman@chromium.org
a3a0d64305 DevTools: Add support for eventless host message dispatching.
Review URL: http://codereview.chromium.org/87026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-22 14:16:50 +00:00
yurys@chromium.org
7fc551ecc3 As long as all debugger messages are handled by a single static method we need a way to identify request sender to route the response to the right handler. To accomplish this clients can send some additional data along with command text and debugger will later pass this data to the message handler along with the response text.
Review URL: http://codereview.chromium.org/67266

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1755 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 14:06:48 +00:00
christian.plesner.hansen@gmail.com
0d21e7b3b0 review
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 13:28:34 +00:00
christian.plesner.hansen@gmail.com
c47a188fae doc
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1752 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 13:28:22 +00:00
christian.plesner.hansen@gmail.com
d26e6dd0b4 force-set
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 13:28:11 +00:00
sgjesse@chromium.org
b8dc312b25 Make it possible to add a user data object to each script compiled.
Review URL: http://codereview.chromium.org/90003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 07:22:06 +00:00
erik.corry@gmail.com
b9c5232c1d Add os.chdir and os.setenv to d8. Move system() to os.system().
Protect os.chdir, os.setenv, os.system against string conversion
failures.  Add comment about the issue to include/v8.h.
Review URL: http://codereview.chromium.org/57005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1644 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 06:51:25 +00:00
sgjesse@chromium.org
8b7a288e48 Debugger message handler can be called from V8 thread.
The message handler function set through the debugger API is normally called in a different thread than the V8 thread where execution is stopped due to debugger event. This change adds an option to the API for specifying that the message handler should be called directly from the V8 thread. For an application like Chrome where thread dispatching is already in place this makes more sense.

Add an option to the message handler debugger API to process messages in the thread where V8 is running instead of posting it to a queue for processing on a additional thread.
Review URL: http://codereview.chromium.org/42643

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1627 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 09:56:53 +00:00
christian.plesner.hansen@gmail.com
9142c42df2 Fixed a bunch of memory leaks in tests, including:
- String traversal test data (now in a zone)
 - Debug message thread (now joined on exit)
 - Threading test threads (now joined on exit)
 - Changed message tests framework to cope with valgrind
Also, fixed a bug where we'd try to delete stack-allocated objects
when tearing down v8.  Good times.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 00:24:49 +00:00
sgjesse@chromium.org
d8e53cf150 Extend debugger agent protocol with a connect message.Added a name of the embedding application when enabeling the debugger agent.Send a connection message from the debugger agent to the remote debugger when connecting. This message contains the V8 version, the protcol version (currently 1) and the name of the embedding application. Currently this information is just printed raw as received.
Review URL: http://codereview.chromium.org/52012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 22:23:39 +00:00
iposva@chromium.org
7b50c072f9 Add a new C++ pointer wrapping API to External to not dilute the
External::Cast.

Review URL: http://codereview.chromium.org/52021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1578 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 19:51:10 +00:00
iposva@chromium.org
1db91bee34 - Do not allocate proxy objects if the pointer can be wrapped in a Smi representation.
Review URL: http://codereview.chromium.org/42466

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1568 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 22:13:50 +00:00
mike@belshe.com
318c9eed21 Add a public API for using an empty sring.
v8::String::Empty()


Review URL: http://codereview.chromium.org/42423

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1556 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 23:35:09 +00:00