Commit Graph

164 Commits

Author SHA1 Message Date
mike@belshe.com
bec08c35ca The error cases were returning false instead of true.
So if the caller does something like:
while(!IdleNotification())
it could spin forever if v8 were not initialized.

I'd like to further remove the is_high_priority flag,
because it is not in use. Mads - is there any reason
not to remove it?


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3014 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 17:26:50 +00:00
erik.corry@gmail.com
4b19c36068 When allocation is forced because we already did two GCs we need to force GCs
even if we are attempting to allocate in young space.  There were a few cases
where this wasn't done.  Also misc. changes to make diagnosis of errors like
this one easier.
Review URL: http://codereview.chromium.org/251072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 13:35:37 +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
antonm@chromium.org
0db55a9456 Do not flatten the string, but just write it out.
In DOM bindings in many cases the string would be externalized immediately.  For other cases
I am going to add explicit flattening.  Overall, it looks like if user wants to flat string
before writing, it should be an explicit method invocation (going to add TryFlattenIfNotFlat
into public V8 API).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-30 14:25:21 +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
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
erik.corry@gmail.com
ae882b44e7 * Fix memory leaks caused by thread local data being lost.
* Rename some instance variables and accessors to fit code style.
* Don't overwrite existing thread ID.
Review URL: http://codereview.chromium.org/251014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-28 12:25:21 +00:00
ager@chromium.org
3da53e3e5c Add missing null check to Context::GetCalling().
Review URL: http://codereview.chromium.org/248017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-28 10:21:08 +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
ager@chromium.org
69a877c2d7 Initialize the can_continue_ field in the TryCatch constructor.
Review URL: http://codereview.chromium.org/227001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-23 07:55:48 +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
77ff957f58 Implemented Object.keys.
Review URL: http://codereview.chromium.org/201114


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-15 11:51:40 +00:00
christian.plesner.hansen@gmail.com
9f7fabeb68 Fix crash during error reporting during bootstrapping.
Instead of crashing or reporting a fatal v8 error if an error occurs
during context initialization we now survive and return an empty
handle.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-10 06:52:46 +00:00
christian.plesner.hansen@gmail.com
d03c277f5e Changed saved context stack to using direct pointers. Before we would
create a new persistent handle to hold the context to save when
entering another context, now we use a stack of direct pointers that
the gc knows about.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-04 07:34:25 +00:00
ager@chromium.org
d8af3528dd Fix the handling of termination exceptions thrown when creating error
objects in the runtime system.
Review URL: http://codereview.chromium.org/179062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-01 13:55:45 +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
ager@chromium.org
11b317d94f Only pass idle notifications on from the API if V8 has been
initialized.

Minor cleanups.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 08:13:27 +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
feng@chromium.org
1c70072f7f Streamline the scanner for external two byte string input.
Review URL: http://codereview.chromium.org/165403

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-18 07:14:02 +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
feng@chromium.org
f04005b576 Revert http://code.google.com/p/v8/source/detail?r=2670
Now we can pass '--expose_gc' to V8 in the layout test controller. This is probably a better option.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-13 22:13:45 +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
feng@chromium.org
de8c403f1c Revert my previous change r2654.
It has a similar impact on page cycler performance because now GC is randomly counted in page load time.

http://code.google.com/p/v8/source/detail?r=2654

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-12 21:30:13 +00:00
christian.plesner.hansen@gmail.com
8cc083d523 Fixed broken build.
Review URL: http://codereview.chromium.org/164395

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2665 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-12 11:08:10 +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
feng@chromium.org
1005fa3fbc Avoid calling GC in Context::New on Android devices.
Review URL: http://codereview.chromium.org/164153

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2654 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-07 18:17:01 +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
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
ager@chromium.org
ab59ea5a16 I will lint my code before submitting...
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2508 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 16:34:58 +00:00
ager@chromium.org
6d641a8131 Add missing handle scope in internal field code.
TBR=kasperl@chromium.org
Review URL: http://codereview.chromium.org/155691

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 16:00:42 +00:00
kasperl@chromium.org
21f44e8fd2 Make sure we don't crash if NewProxy returns an empty handle (only
happens when out of memory).
Review URL: http://codereview.chromium.org/155685

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 11:16:10 +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
iposva@chromium.org
1ea35a858f - Added missing braces in an if statement as a drive-by-edit.
- Removed executable bits from Xcode project file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-13 15:00:35 +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
sgjesse@chromium.org
f36c8574c9 Fix unload debugger.
Add a missing handle scope when clearing the debug message handler.

BUG=none
TEST=cctest/test-debug/DebuggerUnload 
Review URL: http://codereview.chromium.org/126271

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 13:14:51 +00:00
kasperl@chromium.org
ce7cdbd799 Change the implementation of Math.random to use George
Marsaglia's multiply-with-carry instead of mixing the
bits obtained from calling the system random() twice.

This seems to be a bit faster and gives a better 
distribution than the system random() in particular on 
Windows. 
Review URL: http://codereview.chromium.org/126113

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2159 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 08:04:47 +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
whesse@chromium.org
64bd87b8a8 Change handle creation to use Object*, to comply with strict aliasing rules.
Review URL: http://codereview.chromium.org/119177

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2115 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 07:16:04 +00:00
davemoore@chromium.org
62caa393b0 Changed the flags that indicate the status of running vs dead
This allows us to optimized the EnsureInitialized() function
so it doesn't require a function call when we're running

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2048 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 19:39:52 +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
iposva@chromium.org
8d091dc2d1 - Fix build break due to warning about control reaching end of non-void
function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 17:17:23 +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
lrn@chromium.org
0e76f83bfc X64: Made hash computation in serializer accept 64-bit pointers.
Also changed api Wrap function to only wrap suitably small pointers as Smis.
Added Smi validity check and factory meethod for intptr_t.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1875 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 07:53:08 +00:00