Commit Graph

52 Commits

Author SHA1 Message Date
lrn@chromium.org
51c7fa95ce Boyer-Moore delayes computation of Good-Suffix table until bad-char has shown itself
to be insufficient.x
Changed order of tests in loop in simple text search.
Changed limit on pattern length for when we pick simple search.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-14 12:45:06 +00:00
christian.plesner.hansen@gmail.com
a601594796 Fixed bug 114
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-14 09:13:23 +00:00
lrn@chromium.org
9e0609db8e Most operations are faster than before.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-14 08:57:31 +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
kasperl@chromium.org
be8762564e Introduce a special kind of frames for construct frames, e.g.
the trampoline frames introduced for invoking functions through
the new keyword.
Review URL: http://codereview.chromium.org/7223

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-10 09:09:38 +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
erik.corry@gmail.com
079a607442 Fix incorrect short cut test that assumed ASCII strings could be Latin1.
Review URL: http://codereview.chromium.org/6542

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-08 08:05:14 +00:00
kasperl@chromium.org
d0b27552dc Fix broken build.
Review URL: http://codereview.chromium.org/6305

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@465 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 14:00:28 +00:00
lrn@chromium.org
5aac3a5b9c KMP algorithm is still left in the source. If this change checks out to be faster, it should be removed.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 13:25:49 +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
bak@chromium.org
5058924d85 - Added %IsArrayClass, %IsDateClass, and %IsStringClass.
- Added the FLOOR macro that only works on Number objects.
- Added LocalTimeNoCheck in the date code to eliminate some isNaN checks.
- Change computation of four_year_cycle_table to load time.
- Added fast case check to EQUALS and STRICT_EQUALS.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 10:54:50 +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
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
kmillikin@chromium.org
ca0924349d DeclareContextSlot took an extra completely random argument from the
stack which was returned and always pushed back.

Removed it.
Review URL: http://codereview.chromium.org/6802

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 16:57:38 +00:00
kasperl@chromium.org
35a7d677b0 Fix lint issue.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 13:37:27 +00:00
sgjesse@chromium.org
c0e04e1e86 Fixed unsafe code where a GC could occour after a Handle had been deferenced.
instances->set(i, *GetScriptWrapper(script));

GetScriptWrapper can call GC. The failure have only been seen on ARM, where
the g++ compiler pulls out the object from the instances handle to a register
before calling GetScriptWrapper causing set to be called on an object which
may have moved.

Marked a test on ARM as no longer flaky, whereas two other fails consistently
but that is no longer related to the problem fixed above.

BUG=1308895
Review URL: http://codereview.chromium.org/6271

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 13:20:27 +00:00
kasperl@chromium.org
5458eac183 Improve performance of arguments object allocation by taking
care of arguments adaptor frames in the generated code.
Review URL: http://codereview.chromium.org/6262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@434 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 06:08:15 +00:00
kasperl@chromium.org
2b3b31cf1c Fix lint issues.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 13:26:00 +00:00
whessev8
d2a8454d2f This change removes the %AddProperty native JavaScript function from V8.
All uses of %AddProperty are replaced by %SetProperty.  A few uses of
IgnoreAttributesAndSetLocalProperty are added, and the runtime version
of it adds a PropertyAttributes argument.  Only the JSObject class
in objects.cc now uses AddProperty, and it can become private.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 12:14:29 +00:00
sgjesse@chromium.org
12bc4034e0 Refactored the logic for entering the debugger into one abstraction EnterDebugger.
Removed the static initializer for Top::break_access_.
Review URL: http://codereview.chromium.org/6234

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 09:57:18 +00:00
ager@chromium.org
9da356eea6 Make sure that the name accessor on functions return the expected
names.

- Set the correct name of library functions.
- Set the name of C++ callback functions.
- Clean up a couple of out-dated comments related to literal creation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 07:14:31 +00:00
christian.plesner.hansen@gmail.com
06fa6d1cde - Case-sensitive atomic regular expressions now use the same code as
String.indexOf to do matching.
- The --log option is no longer automatically enabled by the other log
  options.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-02 15:35:28 +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
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
ager@chromium.org
ff4e9ea134 Make sure that the body of the function created by calling Function is
on a line of its own.  This allows the body to be terminated by a
single-line comment.

Also, make sure to set the name of the function to anonymous after the
fact so that recursion through the name anonymous is not allowed and
so that global variables called anonymous are not shadowed.

This is a fix for http://code.google.com/p/v8/issues/detail?id=85
Review URL: http://codereview.chromium.org/4248

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-25 07:35:45 +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
deanm@chromium.org
dc91b5f368 Avoid the KMP overhead for simple indexOf() operations. Will look into evaluating the best cutoff between a simple search and KMP in the future. This improves some simple operations ~1.5x.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-19 12:30:14 +00:00
whessev8
0d05c71db4 Flush the runtime %DebugPrint output. Should have no performance impact,
since %DebugPrint is not often used.  Needed for some performance testing
statistics outputting.

Fix the declaration of descriptor enumerated constants to be more readable.
Review URL: http://codereview.chromium.org/3100

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 07:31:37 +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
iposva@chromium.org
c5ee961882 Adapt to new calling convention on ARM:
- Simplified frame entry and frame exit code.
- Added ArgumentsAdaptorTrampoline and check for matching argument counts in the InvokePrologue.
- Removed definition and uses of USE_OLD_CALLING_CONVENTIONS.
- Changed MacroAssembler::InvokeBuiltin to match ia32 version.
- Start introducing convenience instructions in the ARM assembler as needed. These instructions take all Register parameters to avoid extra typing of "Operand(reg)".


To keep the architectures in sync these changes have been made to the ia32 files:
- Changed MacroAssembler::EnterFrame(StackFrame::Type type) to MacroAssembler::EnterInternalFrame().


These parts are still missing:
- unimplemented: Builtins::Generate_FunctionApply - large limit
- unimplemented: Builtins::Generate_ArgumentsAdaptorTrampoline - non-function call
- The files have not been lint'd yet.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-12 03:29:06 +00:00
kasperl@chromium.org
b5a72a1645 Generalized the EvalCache into a CompilationCache and enabled
it for scripts too. In the context of Chromium, this should 
have a very positive impact on memory consumption for web apps
that run multiple tabs from the same domain with a lot of the
same JavaScript code.

For now, the cache retirement policy is really simple:
Whenever a mark-sweep collection is started we clear the
cache. This guarantees that this change will not have a
huge negative impact on memory consumption, but it may
not be ideal. We should consider a more sophisticated LRU
scheme.
Review URL: http://codereview.chromium.org/1933

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 10:51:52 +00:00
whessev8
195a57b59b This change makes the runtime function %DebugPrint()
print the content of strings in release build, rather
than just a pointer.  This lets test_shell print to stdout.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-10 10:32:33 +00:00
christian.plesner.hansen@gmail.com
9bed566bdb Changed copyright header from google inc. to v8 project authors.
Added presubmit step to check copyright.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 20:08:45 +00:00
ager@chromium.org
fff120dbaa Use RUNTIME_ASSERT instead of CHECK in runtime.cc.
Remove unused function from array.js.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 08:40:25 +00:00
ager@chromium.org
4316e6c2d3 Fix the debug build.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 08:06:27 +00:00
ager@chromium.org
b3401cecc3 Move the contains check in array join from javascript to C++.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@224 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 07:38:00 +00:00
ager@chromium.org
e0b50dde0e Avoid string conversion when comparing Smis during sorting.
Avoid runtime calls for trivial object equality checks.

Minor style cleanups.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-08 06:17:38 +00:00
feng@chromium.org
ebfa9d37b6 Added a EvalCache that caches eval'ed scripts and compiled function boilerplate.
The cache is a hashtable that takes String as key and JSFunction as the value.

Caches are cleared before mark-compact GC's.

Currently I don't put caps on cache size, string size, etc.

This cuts date-parse-totfe.js runtime by half.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 16:27:56 +00:00
erik.corry@gmail.com
388c1094b7 * Split up code_space into old_data_space and code_space.
* Make old_data_space non-executable on OSs and hardware that support it.
* Rename old_space to old_pointer_space (can contain pointers, esp. to new space).
* Ensure that individual pages allocated for old_space are only executable when
they are for code objects.
* Ensure Space::Setup can cope with non-aligned memory.
* Make some methods on Spaces virtual.  Make a way to iterate over all spaces.
* Replace executability flag with Executability enum in order to make intent at
call site clearer.
* Fix serialization/deserialization to allocate write barrier memory for large
arrays.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 12:34:09 +00:00
mads.s.ager@gmail.com
9ef7673d82 Clean up a couple of runtime functions that mixed handles and raw
pointers.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@36 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-29 08:48:06 +00:00
mads.s.ager@gmail.com
dceb5f6a8f Improved test support.
Fixed issue with building samples and cctests on 64-bit machines.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@23 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-28 09:55:41 +00:00
christian.plesner.hansen
968facb9ff - Fixed issue when building samples and cctests on 64-bit machines.
- Fixed mozilla test breakage caused by python's obscure module
  loading rules.
- Made sure test.py propagates test failures out as the exit code of
  the script.
- Remove runtime calls to get number constants. Remove Heap roots for
  some special numbers.
- Fix typo in accessors.h.
- Changes CopyMap to not copy descriptors.  Adds
  CopyMapRemoveTransitions that copies non-transition descriptors.
  Changes interface of DescriptorArray::Copy operations to simplify
  them.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-27 13:47:52 +00:00
christian.plesner.hansen
05bbf90b3a Changed shell sample to take flags directly from the command-line. Added api call that implements this.
Added better test support.

Added load, quit and version functions to the shell sample so it's easier to run benchmarks and tests.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-27 10:11:39 +00:00
christian.plesner.hansen
c42f5829a1 Included mjsunit JavaScript test suite and C++ unit tests.
In the shell sample don't print the result of executing a script, only
evaluating expressions.

Fixed issue when building samples on Windows using a shared V8
library.  Added visibility option on Linux build which makes the
generated library 18% smaller.

Changed build system to accept multiple build modes in one build and
generate seperate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this
visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.
Without a stack guard preparsing always bails out with stack overflow.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-22 13:33:59 +00:00
mads.s.ager
cbaa060d28 Improved performance of garbage collection by moving the function that updates pointers during compacting collection into the updating visitor. This gives the compiler a better chance to inline and avoid a function call per (potential) pointer.
Extended the shell sample with a --runtime-flags option.

Added Visual Studio project files for the shell.cc and process.cc samples.



git-svn-id: http://v8.googlecode.com/svn/trunk@14 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-14 13:41:48 +00:00
mads.s.ager
31e7138e1a Improved performance of garbage collection by changing the way we use the marking stack in the event of stack overflow during full garbage collection and by changing the way we mark roots.
Cleaned up ARM version by removing top of stack caching and by introducing push/pop elimination.

Cleaned up the way runtime functions are called to allow runtime calls with no arguments.

Changed Windows build options to make sure that exceptions are disabled and that optimization flags are enabled.

Added first version of Visual Studio project files.



git-svn-id: http://v8.googlecode.com/svn/trunk@13 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-13 09:32:07 +00:00
mads.s.ager@gmail.com
769cc962a0 Improved performance of unary addition by avoiding runtime calls.
Fixed the handling of '>' and '<=' to use right-to-left conversion and left-to-right evaluation as specified by ECMA-262.

Fixed a branch elimination bug on the ARM platform where incorrect code was generated because of overly aggressive branch elimination.

Improved performance of code that repeatedly assigns the same function to the same property of different objects with the same map.

Untangled DEBUG and ENABLE_DISASSEMBLER defines.  The disassembler no longer expects DEBUG to be defined.

Added platform-nullos.cc to serve as the basis for new platform implementations.


git-svn-id: http://v8.googlecode.com/svn/trunk@9 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-06 10:02:49 +00:00
kasper.lund
7276f14ca7 Changed all text files to have native svn:eol-style.
Added a few samples and support for building them. The samples include a simple shell that can be used to benchmark and test V8.

Changed V8::GetVersion to return the version as a string.

Added source for lazily loaded scripts to snapshots and made serialization non-destructive.

Improved ARM support by fixing the write barrier code to use aligned loads and stores and by removing premature locals optimization that relied on broken support for callee-saved registers (removed).

Refactored the code for marking live objects during garbage collection and the code for allocating objects in paged spaces. Introduced an abstraction for the map word of a heap-allocated object and changed the memory allocator to allocate executable memory only for spaces that may contain code objects.

Moved StringBuilder to utils.h and ScopedLock to platform.h, where they can be used by debugging and logging modules. Added thread-safe message queues for dealing with debugger events.

Fixed the source code reported by toString for certain builtin empty functions and made sure that the prototype property of a function is enumerable.

Improved performance of converting values to condition flags in generated code.

Merged disassembler-{arch} files.


git-svn-id: http://v8.googlecode.com/svn/trunk@8 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-30 08:49:36 +00:00
kasper.lund
44510671e9 Fixed bug in JSObject::GetPropertyAttributePostInterceptor where map transitions would count as properties.
Allowed aliased eval invocations by treating them as evals in the global context. This may change in the future.

Added support for accessing the last entered context through the API and renamed Context::Current to Context::GetCurrent and Context::GetSecurityContext to Context::GetCurrentSecurityContext.

Fixed bug in the debugger that would cause the debugger scripts to be recursively loaded and changed all disabling of interrupts to be block-structured.

Made snapshot data read-only to allow it to be more easily shared across multiple users of V8 when linked as a shared library.


git-svn-id: http://v8.googlecode.com/svn/trunk@6 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-25 07:37:58 +00:00