Commit Graph

71 Commits

Author SHA1 Message Date
lrn@chromium.org
c8c5d9820d Test a few assertions that should hold.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 10:16:30 +00:00
olehougaard
a8c50151fc Reapply revisions 1432, 1433, 1469 and 1472 while fixing issue 279.
Review URL: http://codereview.chromium.org/48006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 07:27:47 +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
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
olehougaard
74722e199f Implementing __defineSetter__ and __defineGetter__ with an array index as argument as described in issue 242. For performance reasons, the change is not applied to arrays. This conforms to the behavior of Safari.
Review URL: http://codereview.chromium.org/46030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 11:40:09 +00:00
lrn@chromium.org
e2af4529c3 String.replace implemented in C++.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 10:22:38 +00:00
erik.corry@gmail.com
912c8eb03a * Reapply revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge, reverted in 1429.
* Fix of $1 accessor on sliced strings.
* Fix of lastParen method when last parenthesis did not match.
Review URL: http://codereview.chromium.org/43075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 14:00:55 +00:00
sgjesse@chromium.org
9d17b0d4c8 Whenever a script object is created it is assigned a unique id. Currently this id is assigned from an 32 bit integer counter.
Changed the script break points to be able to handle both break points based on script names and script ids. When break points are set through a script id the position is relative to the script itself. This is different from the script break points set through script names where the line/coulmn offset is taken into account.

This has the side effect that function break points are not converted into script break points for named scripts.

Show the script id in the D8 shell debugger when listing all scripts using the 'scripts' command.
Review URL: http://codereview.chromium.org/40317

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 08:10:50 +00:00
kasperl@chromium.org
e9e8628380 Revert revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge until we have a fix
for the crashers we see on the distributed test infra-
structure.

We know that revision 1383 is causing issues, but I 
had to revert some of the other recent RegExp changes
in order to get this part out.
Review URL: http://codereview.chromium.org/39186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 15:23:17 +00:00
lrn@chromium.org
50e042dfcd All RegExp data are set on a single FixedArray instead of nesting them three deep.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-02 13:58:37 +00:00
iposva@chromium.org
f5966c3815 Align code entry points to 32 bytes.
Review URL: http://codereview.chromium.org/27269

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1386 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-27 11:19:31 +00:00
iposva@chromium.org
1bf2c7405e Allow the morphing of strings to external strings to avoid having to
create copies in the embedding code (aka WebKit V8 bindings) on every
external use.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-11 23:52:52 +00:00
mikhail.naganov@gmail.com
3835e915c4 Adding src_file_name:line_number into perf log entries for compiled JS functions.
Thus, instead of the following profiler records:
   1.5%    1.5%   LazyCompile: <anonymous>
we'll now have these:
   1.5%    1.5%   LazyCompile: <anonymous> richards.js:309

Basically, I translated two functions from messages.js into C++.
In the next CL I will update messages.js to use added native functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 10:52:02 +00:00
erik.corry@gmail.com
50e5ad72cb Fix bug where strings were not flattened before regexp.
Review URL: http://codereview.chromium.org/18552

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 08:35:41 +00:00
deanm@chromium.org
b7c1200462 Fix a bunch of spelling mistakes :\
Review URL: http://codereview.chromium.org/18094


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1088 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 19:08:34 +00:00
ager@chromium.org
d4dae20a12 Fix issue 186:
http://code.google.com/p/v8/issues/detail?id=186

Create a new instance type for context extension objects.  Use it to
not use the __proto__ accessor for context extension objects.
Review URL: http://codereview.chromium.org/18044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-14 12:13:26 +00:00
olehougaard
392e6f849b Fixing a subtle bug in receiver resolution when a thrown and caught function is called from a catch-block.
Second attempt - now with better memory efficiency.
Review URL: http://codereview.chromium.org/14834

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-18 11:28:13 +00:00
sgjesse@chromium.org
bbbab4821c Refactor the convertion of a target address into a code object from the debugger to the Code class.
Review URL: http://codereview.chromium.org/13285

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@952 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-09 12:53:59 +00:00
christian.plesner.hansen@gmail.com
b57b4a15cd Merge regexp2000 back into bleeding_edge
Review URL: http://codereview.chromium.org/12427

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-25 11:07:48 +00:00
erik.corry@gmail.com
c390485090 Fix place where linter complains about lonely {
Fix place where ARM compiler loses track of whether variables were initialized.
Review URL: http://codereview.chromium.org/9244

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-03 12:08:01 +00:00
erik.corry@gmail.com
eca89dc765 Create an abstraction for the string type flags so that they can be cached.
Read the objects.h change first to understand what's going on here.
Review URL: http://codereview.chromium.org/9038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-03 10:16:05 +00:00
ager@chromium.org
2013421859 Add support for API accessors that prohibit overwriting by accessors
defined in JavaScript code by using __defineGetter__ and
__defineSetter__.

Also, disable access checks when configuring objects created from
templates.
Review URL: http://codereview.chromium.org/8914

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-30 12:51:06 +00:00
whessev8
28cee257b6 Remove unused maps during marking garbage collections.
Review URL: http://codereview.chromium.org/8831

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@637 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-29 10:37:14 +00:00
ager@chromium.org
44340e39c5 Change the order of two assignments, to make sure that the script type
field is always initialized to a Smi before we get any GCs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-28 13:46:04 +00:00
ager@chromium.org
721b7298e2 Allow inline caching for getting the length of string wrapper objects.
Review URL: http://codereview.chromium.org/8620

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@608 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 14:36:08 +00:00
whesse@chromium.org
d08b095bce Revert changes 601 and 602. TBR
Review URL: http://codereview.chromium.org/8190

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 12:45:24 +00:00
erik.corry@gmail.com
0fc72f2b4e Serendipitously arrange the tags so that String.length() becomes a branch-free
operation.  I have another version of this change that does not remove the
special inline caches for difference sized strings.  The other version is ever
so slightly faster, but the nice thing about this version is that it removes
253 lines of code.
Review URL: http://codereview.chromium.org/8187

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 12:39:34 +00:00
whesse@chromium.org
6941a4f389 Collects unused maps that are only kept alive by map transitions.
If a map has descendents in the map transition tree that are alive,
it is kept.  Only maps such that they and all their descendants
have no live objects are collected.  This happens in mark-sweep and
mark-compact garbage collections.
Review URL: http://codereview.chromium.org/8099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 11:55:31 +00:00
erik.corry@gmail.com
6e00a80354 You can't use BinarySearch on an unsorted array and other
sillinesses found while trying to get rid of medium-sized strings.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-26 20:50:05 +00:00
christian.plesner.hansen@gmail.com
9d9f608a38 - Added caching of regexp data in the compilation cache.
- Changed the structure of regexp objects from having two internal
  fields to having a single field containing a fixed array, since it's
  easier to store the whole fixed array in the cache.
- Move printing of the command to after printing std{err,out} in the
  compact progress indicators in the test framework.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 08:40:02 +00:00
bak@chromium.org
d296a22917 - Fixed performance regression caused by ComputeContextSlotReceiver.
- Eliminated a few write barriers.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 14:55:45 +00:00
bak@chromium.org
187879a25a - Added conditional write barrier to object accessors.
- Sped up allocation of Arguments object.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:46:32 +00:00
kasperl@chromium.org
b727198587 Fix issue 124 by computing the receiver correctly when
the property is found in a context slot.
Review URL: http://codereview.chromium.org/8097

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:42:22 +00:00
christian.plesner.hansen@gmail.com
c7ed0707a3 - Added const in a few places.
- Changed WeakReferenceCallback to take a Persistent<Value> instead of
  a Persistent<Object>.
- Removed Message::GetUnderline and Message::GetScriptData.
- Added Value::IsDate, Date::Cast and Date::Value.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:25:23 +00:00
ager@chromium.org
8e0979e2ff Introduce a lookup cache class in the runtime system and use it for
keyed loads that enter the runtime.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 07:04:56 +00:00
kasperl@chromium.org
b75da76a2b Apply Daniel's patch for array index strings.
Review URL: http://codereview.chromium.org/7869

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 06:20:57 +00:00
kasperl@chromium.org
50d9f5e256 Incorporate patches by Paolo Giarrusso to allow profiling
C++ functions in shared libraries, building in directories
containing spaces, and using named constants better.
Review URL: http://codereview.chromium.org/7864

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 09:46:09 +00:00
erik.corry@gmail.com
1aae797ddd Use direct copy and templates to speed up flattening of strings.
Review URL: http://codereview.chromium.org/8011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 09:09:07 +00:00
bak@chromium.org
bf948c8313 - Optimized CopyFixedArray and CopyJSObject.
- Refactored block copying.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 08:21:18 +00:00
feng@chromium.org
42ef2c3d77 Split window support from V8.
Here is a description of the background and design of split window in Chrome and V8:
https://docs.google.com/a/google.com/Doc?id=chhjkpg_47fwddxbfr

This change list splits the window object into two parts: 1) an inner window object used as the global object of contexts; 2) an outer window object exposed to JavaScript and accessible by the name 'window'. Firefox did it awhile ago, here are some discussions: https://wiki.mozilla.org/Gecko:SplitWindow. One additional benefit of splitting window in Chrome is that accessing global variables don't need security checks anymore, it can improve applications that use many global variables.

V8 support of split window:
  There are a small number of changes on V8 api to support split window:
Security context is removed from V8, so does related API functions;
A global object can be detached from its context and reused by a new context;
Access checks on an object template can be turned on/off by default;
An object can turn on its access checks later;

  V8 has a new object type, ApiGlobalObject, which is the outer window object type. The existing JSGlobalObject becomes the inner window object type. Security checks are moved from JSGlobalObject to ApiGlobalObject. ApiGlobalObject is the one exposed to JavaScript, it is accessible through Context::Global(). ApiGlobalObject's prototype is set to JSGlobalObject so that property lookups are forwarded to JSGlobalObject. ApiGlobalObject forwards all other property access requests to JSGlobalObject, such as SetProperty, DeleteProperty, etc.

  Security token is moved to a global context, and ApiGlobalObject has a reference to its global context. JSGlobalObject has a reference to its global context as well. When accessing properties on a global object in JavaScript, the domain security check is performed by comparing the security token of the lexical context (Top::global_context()) to the token of global object's context. The check is only needed when the receiver is a window object, such as 'window.document'. Accessing global variables, such as 'var foo = 3; foo' does not need checks because the receiver is the inner window object.

  When an outer window is detached from its global context (when a frame navigates away from a page), it is completely detached from the inner window. A new context is created for the new page, and the outer global object is reused. At this point, the access check on the DOMWindow wrapper of the old context is turned on. The code in old context is still able to access DOMWindow properties, but it has to go through domain security checks.


It is debatable on how to implement the outer window object. Currently each property access function has to check if the receiver is ApiGlobalObject type. This approach might be error-prone that one may forget to check the receiver when adding new functions. It is unlikely a performance issue because accessing global variables are more common than 'window.foo' style coding.

I am still working on the ARM port, and I'd like to hear comments and suggestions on the best way to support it in V8.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 19:07:58 +00:00
christian.plesner.hansen@gmail.com
2b7c9edbb1 Added string equality by reading int-sized blocks of characters for
flat strings with the same representation.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 11:38:32 +00:00
bak@chromium.org
9276b48a5b - Optimized copying of FixedArray.
Review URL: http://codereview.chromium.org/7516

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 06:35:28 +00:00
bak@chromium.org
884345a789 -Eliminated a excessive memory traffic in CopyObject.
Review URL: http://codereview.chromium.org/7432

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-16 07:17:26 +00:00
iposva@chromium.org
d09fcf70b7 Allocate room for expected number of properties based on the
constructor in the JSObject. This removes the need to allocate
a properties array if the object is never assigned any extra
properties.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-15 06:03:26 +00:00
bak@chromium.org
80098968d8 - Inlined JSArray::SetContent.
- Implemented Runtime_KeyedGetProperty to make slow case faster.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-10 10:27:44 +00:00
erik.corry@gmail.com
89ac41aff9 If an allocation is so huge that we cannot code the size needed in the failure
object then we just return an out of memory failure object (instead of a retry
after GC failure object).  Not all places that checked for retry-after-GC were
able to handle an immediate out of memory failure.

This fixes http://code.google.com/p/v8/issues/detail?id=70
Review URL: http://codereview.chromium.org/6340

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 11:26:37 +00:00
christian.plesner.hansen@gmail.com
76b1efea2d - Specialized slow-case string equality nine ways based on the
underlying string representation of the two strings involved.
- Renamed ascii and two byte string classes to sequential ascii and
  sequential two byte, and renamed IsAscii and friends to
  IsAsciiRepresentation.  This is to make a clear distinction between
  strings with an ascii/two-byte representation, of which there is
  four, and flat sequential ascii/two-byte string.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 08:08:04 +00:00
christian.plesner.hansen@gmail.com
17096cab78 Calculate string hash during flattening and convert flat strings to
symbols.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 10:10:03 +00:00
lrn@chromium.org
ca7668ee32 Fixed typo
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@454 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 09:04:23 +00:00
lrn@chromium.org
c7c7b8b0e7 Fast direct-access version of KPM string match.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 08:11:44 +00:00