Commit Graph

69 Commits

Author SHA1 Message Date
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
724f5648b9 Rewrites a ternary choice operator to fix a compiler
linkage bug.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 12:24:22 +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
kasperl@chromium.org
c128b8d9de Improve code for looking up in context slots in runtime.cc and
use safe casting operations to slot access on contexts when
possible.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@588 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 10:59:40 +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
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
erik.corry@gmail.com
dbc6dd66e4 Fix some style issues.
Review URL: http://codereview.chromium.org/8055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@563 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 07:28:21 +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
christian.plesner.hansen@gmail.com
85251f756c - Changed regexp logging to include the string being matched and to
escape commas.
- Fixed issue with block-comparing unaligned strings on arm.
- Added short documentation to one of the Persistent constructors.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 12:00:19 +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
648f6d21c6 Fix style issues.
TBR=iposva

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 20:08:49 +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
kasperl@chromium.org
ed08619bec Minor cleanups.
Review URL: http://codereview.chromium.org/8008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@536 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 14:11:22 +00:00
erik.corry@gmail.com
99f5ae88a3 Fix bug 1439135 (slicedstring on constring not flat)
Review URL: http://codereview.chromium.org/7809

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@530 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 08:08:17 +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
5bf3e4f527 - Eliminated superfluous type tests in IsMatch.
Review URL: http://codereview.chromium.org/7622

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-17 12:36:23 +00:00
kasperl@chromium.org
c63477df3d Fix issue 116 by returning the value from SetFastElement.
Review URL: http://codereview.chromium.org/7615

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@514 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-17 06:36:35 +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
8bfbe2c0aa Move const qualifies around to avoid GCC warnings. (GCC 4.3.2)
Patch by Seo Sanghyeon sanxiyn@gmail.com, reviewed by Erik Corry.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-10 08:33:06 +00:00
bak@chromium.org
015af31d5f - Optimized JSArray allocation in runtime system by using NewJSArrayWithElements.
Review URL: http://codereview.chromium.org/7013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 13:34:17 +00:00
christian.plesner.hansen@gmail.com
dc32c82ce9 Reverted the changes to jscre because the arm cross-compiler dies with
an internal error when compiling templateified jscre.  We really need
to update that damn arm compiler.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 12:18:48 +00:00
christian.plesner.hansen@gmail.com
a7230abb92 - Specialized jscre on the type of the string involved.
- Specialized jscre on the type of the string involved.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 10:30:33 +00:00
whesse@chromium.org
4f7b6654d4 This change rewrites some of the code to add properties to an object.
It removes the ReplaceConstantFunction code, and replaces it with
new ConvertDescriptorToField code, that is also used in other places.
Functions CopyRemove and CopyReplace on DescriptorArray are removed.
Function AddFastProperty is simplified by removing the 
CONSTANT_TRANSITION case.
Review URL: http://codereview.chromium.org/6528

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 08:57:32 +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
097d35065a Rolled back eager hash calculation during flattening. Introduced
eager flattening of really short strings and lookup of one-character
strings in the one-character symbol cache.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 13:04:56 +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
sgjesse@chromium.org
3a41911303 Removed some debug code related to issue 1308895 which was fixed in CL
http://codereview.chromium.org/6271.
Review URL: http://codereview.chromium.org/6299

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 07:23:24 +00:00
ager@chromium.org
70dcba4024 Exclude the bit-field bits from string hash codes. String hash codes
are always odd if the bit-field bits are included.

Modified a couple of debugger tests that relied on the ordering of
elements in descriptor arrays.  Descriptor arrays are sorted by
hash-code values, so the order changes if we change the hash code.
Review URL: http://codereview.chromium.org/6489

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 09:35:52 +00:00
whessev8
c1ac963e53 Replaces two non-private uses of AddProperty with IgnoreAttributesAndSetLocalProperty. Adds attributes parameter to IgnoreAtt..Property(). Makes IgnoreAtt..Property() an exact clone of SetProperty(), with explicit changes.
Review URL: http://codereview.chromium.org/5665

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@411 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-02 13:45:21 +00:00
erik.corry@gmail.com
aabe3ed736 Use -O9, tune for nocoma, assume at least a Pentium when generating code.
Review URL: http://codereview.chromium.org/4298

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@387 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-26 15:53:42 +00:00
bak@chromium.org
e05eba857e - Added a map cache for literal objects. This will
canonicalize maps for object literals. JSON objects
  with the same set of properties names will then
  share the same map.
  This reduces the amount of generated code associated 
  with object literals.
- Added a flag canonicalize_object_literal_maps.
  (default true)
- Changed the format of a function's literal array.
  Only the global context is now stored in the literal prefix.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-25 07:46:07 +00:00
christian.plesner.hansen@gmail.com
6d47b29765 - Added new object type, RegExp, for regular expressions.
- Renamed some ::kSizes to ::kHeaderSizes to avoid confusion.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-23 11:45:43 +00:00
sgjesse@chromium.org
8391b19b07 Refactor the enum RelocMode changing the naming scheme from lower case to
upper case. Moved it into the RelocInfo class together with the associated
is_xxx functions. Renamed is_xxx to IsXxx in the process.

Removed the exit_js_frame mode as it was no longer used.

Patch Set 2 renames RELOC_MODE_COUNT to NUMBER_OF_MODES and fixes a couple of lint errors.
Review URL: http://codereview.chromium.org/3186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-22 13:57:03 +00:00
ager@chromium.org
57e2aa1b26 Use null instead of undefined for deleted elements in code caches.
Update the lookup and update code for code caches to deal with deleted
elements.

Do not clear the code cache for the builtins object.  If there was a
matching element in the code cache, we would have hit the monomorphic
prototype failure case and removed it.
Review URL: http://codereview.chromium.org/3140

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 11:18:27 +00:00
ager@chromium.org
6a3d1868e4 Revert revision 331. The propagation of monomorphic prototype failure
information does not work.  In certains situations, it will keep
alternating between unrelated monomorphic states instead of going
megamorphic.
Review URL: http://codereview.chromium.org/2959

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 10:22:46 +00:00
sgjesse@chromium.org
b568d7a17b Defer the writing of the source position data to the relocation information
until a possible debug break location is reached. Currently this is call sites
with calls to code objects and JS return. Source position information in the
code therefore no longer refers to the "first" instruction generated for a
given source position (which was not the case defered code anyway) but to the
first break location after that source position was passed (again defered code
always start with source position information). This doesn't make a difference
for the debugger as it will always be stopped only at debug break locations.
However, this makes the life of the peep-hole optimizer much easier as many
oportunities for posh/pop eliminations where previosly blocked by relocation
information already written to the code object.

Two types of source positions are still collected. Statement positions indicate
the position of the start of the statement leading to this code and (plain)
positions indicate other places typically call sites to help indicate current
position in backtraces. The two different types of positions are also used to
distinguish between step next and step in.

Runs all the tests (including debugger tests) as before.

Moved the checking for the FLAG_debug_info to one place.

I will do the same changes to the ARM codegenerator in a seperate changelist.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 08:51:43 +00:00
ager@chromium.org
950ad34a94 Propagate the information that a monomorphic prototype failure has
occured.  After a monomorphic prototype failure has been detected,
other monomorphic inline caches for the same type will have a code
object in the map's code cache which is not the current target.  We
recognize this case and use the code object that is in the cache
instead of going megamorphic.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 06:55:14 +00:00
sgjesse@chromium.org
390b5cb185 Changed the disassembler formatting
Changed the formatting of the comment in the disassembler output to contain
more information on code targets.
Review URL: http://codereview.chromium.org/3099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-17 12:38:50 +00:00
ager@chromium.org
a0257ca1a0 Only remove the code object that caused the monomorphic prototype
failure instead of clearing the cache.  Clearing the cache makes us
miss subsequent monomorphic prototype failures.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-16 12:41:36 +00:00
deanm@chromium.org
77196c5771 This is a new static flag system, designed to have all flags in a central place, and compiled into the binary without requiring static constructors for registration. All flags are moved out of the specific modules and into flags.defs, with different sections for debug, release, etc. The flag variables are always defined. For example, a debug flag in release mode still exists, but is read only and set to the default value.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@296 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-12 10:19:33 +00:00
christian.plesner.hansen@gmail.com
32cf7fd9a1 Replaced calls to functions that msvc consider deprecated. Used
Vector<...> in more places to be sure that buffers have a length
associated with them.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 14:34:48 +00:00