Commit Graph

123 Commits

Author SHA1 Message Date
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
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
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
sgjesse@chromium.org
a470847226 Added better version information
The current version is now held in src/version.cc in a number of defines which needs to be modified when changing version.

The following defines make up the version information:

  MAJOR_VERSION
  MINOR_VERSION
  BUILD_NUMBER
  PATCH_LEVEL
  CANDIDATE_VERSION

The first four are numbers and the fifth is a boolean. Besides these five the define

  SONAME

can be used to set a specific soname when building the a shared library (see below). This will most likely be used on stable branches where binary compatibility is ensured between different versions. This define is a string.

This version information is now read by the SCons build to support setting the soname for a Linux shared library. This requires passing the option soname=on to the SCons build.

When soname=on is specified the soname for the shared library can be set in two different ways. Either it will be the full versioned library name (e.g. libv8-1.2.2.so) or a specific soname defined in src/version.cc. Whenever a shared library is build with an soname the filename of the library will hold the full version name (e.g. libv8-1.2.2.so).

I did not update the xcode project with the new files.

BUG=151
Review URL: http://codereview.chromium.org/100104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-30 09:29:15 +00:00
asargent@chromium.org
ec3beee2bf Make Object::GetIdentityHash() never return 0.
This is convenient when using identity hashes in data structures that
want to reserve 0 as a sentinel value, such as WebKit's WTF::HashMap.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1821 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-29 21:44:13 +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
ager@chromium.org
f6bafbfb09 Prepare push of version 1.2.1 to trunk. The main reason for this push
is to get the chromium V8-latest builder working again and to move the
gyp file used for the chromium build to V8 to make it easier to roll
V8 DEPS.
Review URL: http://codereview.chromium.org/99049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 09:14:19 +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
ager@chromium.org
35e78919eb Prepare to push version 1.2.0 to trunk. Now worker on version 1.2.1.
Review URL: http://codereview.chromium.org/92066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1779 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-23 07:32:25 +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
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
feng@chromium.org
19c95ff39a Fix style issues caught by presubmit script.
TBR = erikcorry

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-20 17:44:39 +00:00
feng@chromium.org
ea48d53bad Add ENABLE_DEBUGGER_SUPPORT macro.
ENABLE_DEBUGGER_SUPPORT is enabled by default unless it is on Android platform.
On Android platform, it can also enabled by passing -DENABLE_DEBUGGER_SUPPORT flag to the compiler.

This should not affect any existing build (I hope, cross my fingers) except the build in real Android environment (in other word, it only affects me now).

There are lot of room for code refactoring in stead of using #ifdef all over the place. I will leave this to v8 folks.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-20 16:36:13 +00:00
kasperl@chromium.org
e97c387ec8 Prepare a push to trunk (version 1.1.10).
Review URL: http://codereview.chromium.org/67167

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-15 13:16:51 +00:00
kasperl@chromium.org
383821854b Prepare a push to trunk (version 1.1.9).
Review URL: http://codereview.chromium.org/73031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1701 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 13:29:23 +00:00
kasperl@chromium.org
3b80ddac19 Prepare a push to trunk (version 1.1.8).
Review URL: http://codereview.chromium.org/71001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1691 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-11 09:01:45 +00:00
asargent@chromium.org
144cca7d3d Fix v8::Object::DeleteHiddenValue to not bail when there are no hidden properties.
Review URL: http://codereview.chromium.org/58016


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1687 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-08 21:05:29 +00:00
kasperl@chromium.org
9c8b187658 Prepare a push to trunk (version 1.1.7).
Review URL: http://codereview.chromium.org/62091

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-07 06:00:21 +00:00
kmillikin@chromium.org
339e2e5244 Add two more invocations of ENTER_V8 to places where we need to write
to V8's heap.
Review URL: http://codereview.chromium.org/60089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-03 10:30:21 +00:00
kmillikin@chromium.org
2c5ce41876 Move some more ENTER_V8 invocations. The biggest one is to move the
one in v8::V8::Initialize to after the early bailout.
Review URL: http://codereview.chromium.org/60083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-03 08:18:24 +00:00
kmillikin@chromium.org
35d6c8fb03 Remove ENTER_V8 from small API functions that do not need access to
V8's heap or only need read access.

This means that IsDeadCeck and EnsureInitialized could sometimes be
called without having already entered the VM.  To simplify things,
this is made always the case.  A couple of error callbacks do not need
to leave V8 because they haven't entered.

Consistently enter V8 after LOG_API (since LOG_API is sometimes before
EnsureInitialized or IsDeadCheck).

This all should have no effect unless V8 is built with
ENABLE_HEAP_PROTECTION and run with --protect-heap.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1672 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-03 07:49:20 +00:00
ager@chromium.org
9bc64e657a Prepare another push to trunk (version 1.1.6). We pushed an unsafe
compiler optimization which has now been reverted.
Review URL: http://codereview.chromium.org/60011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-01 10:41:37 +00:00
ager@chromium.org
185aa082c4 Prepare to push version 1.1.5 to trunk. This version contains a
number of bug fixes.
Review URL: http://codereview.chromium.org/60004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1661 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-01 06:39:18 +00:00
kmillikin@chromium.org
87d8bcf7ee Mark a bunch of places where we enter or leave V8 through the API.
Indiscriminately mark every place with EnsureInitialized, ON_BAILOUT,
or IsDeadCheck (even if they cannot write to V8's heap).  Also mark
callbacks, and one other place (Function::SetName) hit in Chromium.
Review URL: http://codereview.chromium.org/57049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1647 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 09:07:57 +00:00
kmillikin@chromium.org
d3ee29a7f6 Add just enough state changes from EXTERNAL (outside V8) to OTHER
(generic state inside V8) in the API to allow the V8 shell to run all
the mjsunit tests with heap protection on.

These state changes are only taken when built with
ENABLE_HEAP_PROTECTION.  The two states OTHER and EXTERNAL are treated
the same because we will not properly reenter OTHER through the API.
Review URL: http://codereview.chromium.org/56060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1643 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-30 13:32:28 +00:00
ager@chromium.org
ab845fd829 Prepare to push version 1.1.4 to trunk.
Review URL: http://codereview.chromium.org/56059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1640 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-30 12:58:45 +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
kasperl@chromium.org
898297b0b7 Preparing push of version 1.1.3 to trunk.
Review URL: http://codereview.chromium.org/53012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 14:42:35 +00:00
ager@chromium.org
efba01b86f Preparing push of version 1.1.2 to trunk.
Review URL: http://codereview.chromium.org/42556

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 11:07:09 +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
iposva@chromium.org
ea653021fc - Allow hidden properties to be set on any JSObject through the V8 C++ API.
- Use the hidden properties to expose a IdentityHash accessor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 18:50:00 +00:00
mike@belshe.com
c5d777338a Expose Cloning through API.
Review URL: http://codereview.chromium.org/42339

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-18 19:24:15 +00:00
erik.corry@gmail.com
608a99a90c Remove all uses of StringShape variables, since that has proven
to be error-prone and of little benefit in terms of performance.
Review URL: http://codereview.chromium.org/45010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 09:33:06 +00:00
davemoore@chromium.org
46f753a184 - Added ability to call histograms from within v8
- Changed the StatsRates to use the new HistogramTimers

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 16:06:31 +00:00
ager@chromium.org
a4d60dd463 Prepare to push V8 version 1.1.1 to trunk.
Review URL: http://codereview.chromium.org/42122

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1500 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 14:10:44 +00:00
kasperl@chromium.org
765a3804a9 Prepare push to trunk. Now working on version 1.1.1.
Review URL: http://codereview.chromium.org/43123

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1494 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 07:11:15 +00:00