Commit Graph

36 Commits

Author SHA1 Message Date
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
sgjesse@chromium.org
8b4cfc3768 Fix the source position recorded for funtion return
Record the function return position as the end of the function source. Don't record function entry and return positions as statement positions.

Added a test for source position for break at function return.
Review URL: http://codereview.chromium.org/67109

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1706 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 14:56:03 +00:00
mikhail.naganov@gmail.com
3c2a7bdf21 Add name inference for anonymous functions to facilitate debugging and profiling of JS code.
Currently function name inference is wired with AST optimization pass to avoid introducing another pass over AST. A better solution would be to rewrite AST visitors so they can be naturally combined together in a single pass, as their current implementation doesn't allow it.

For examples of cases where function names can be inferred, see the tests file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 00:51:59 +00:00
kmillikin@chromium.org
06860982a9 Clean up return statements in the code generator by explicitly
counting the reference to the return value and passing it to the
return label.  This requires threading it through try/catch and
try/finally.  The return value is loaded into eax more lazily than
before.

Also, perform some related refactoring of jump targets.
Review URL: http://codereview.chromium.org/56172

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1669 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-02 08:58:18 +00:00
kmillikin@chromium.org
d0b7f84ec0 Use the AST optimizer on the bodies of function literals. Notify the
oprofile agent when we compile the body of a function literal.
Review URL: http://codereview.chromium.org/57048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 09:02:40 +00:00
kmillikin@chromium.org
6565243504 Inline the Result::Unuse member function and change the Result
destructor to no longer invalidate the result.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 12:58:14 +00:00
kmillikin@chromium.org
9752bf90b5 Remove a bunch of unnecessary includes from header files in favor of
forward declarations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1559 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 09:35:31 +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
kmillikin@chromium.org
82df32b78c Fix issue 268 by explicitly calling Unuse (to deallocate all contained
virtual frames) on zone-allocated jump targets.  These include jump
targets in AST nodes and the entry and exit targets of deferred code.

See http://code.google.com/p/v8/issues/detail?id=268

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1486 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 10:25:48 +00:00
kmillikin@chromium.org
1984f54a78 Assert in debug mode that we do not try to compile a function literal
more than once.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 14:48:34 +00:00
iposva@chromium.org
be0c1e26e9 Add a meaningful name when disassembling code. This makes it easier
to match generated code to the originating source.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1408 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-04 06:14:34 +00:00
kmillikin@chromium.org
f4735247cf Merge from experimental code generator branch to bleeding edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-27 13:00:32 +00:00
iposva@chromium.org
c093e94546 - Pass the knowledge whether the old GC is compacting to the GC prologue and epilogue. This allows us to skip frame cooking and uncooking when doing a mark-sweep GC.
- Add the ability for the code to refer to its code object by adding a handle to the code object in the MacroAssembler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:52:15 +00:00
christian.plesner.hansen@gmail.com
4e78736900 Fixed build with no ENABLE_LOGGING_AND_PROFILING
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-07 14:24:08 +00:00
christian.plesner.hansen@gmail.com
afcc36a417 Added runtime call to the logging infrastructure. Made some changes
to the way regexps are being logged.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-06 13:24:52 +00:00
sgjesse@chromium.org
b3dd6b686a Refactored the recording of source position in the generated code. The code generator now has two methods
void CodeForStatement(Node* node)
  void CodeForSourcePosition(int pos)

The first is used to indicate that code is about to be generated for the given statement and the second is used to indicate that code is about to be generated for the given source position.

Added position information for some statements which was missing whem.

Updated the code generator for ARM to emit source position the same way as for IA-32.

Added an assert to ensure that deferred code stubs will always have a source source position as if it has not it will take whatever source position before which makes no sense.

The passing test on ARM has only been tested using the simulator.
Review URL: http://codereview.chromium.org/14170

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-17 08:45:42 +00:00
kmillikin@chromium.org
291147e2f1 Enable printing code generated for builtins in release mode when the
disassembler is enabled.  It's convenient to be able to see them.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-04 08:26:08 +00:00
kasperl@chromium.org
7940adb1ec Track loop nesting across function calls when the function
is called through an IC the first time.
Review URL: http://codereview.chromium.org/10746

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@764 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 05:50:52 +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
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
kmillikin@chromium.org
ebd11b7382 Code formatting changes.
Review URL: http://codereview.chromium.org/7346

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-17 09:54:34 +00:00
iposva@chromium.org
89c762edf4 Simplify CodeGenerator hierarchy by not using a base class.
There is nothing virtual about a CodeGenerator since we
either generate code for one platform or for the other.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-10 00:00:52 +00:00
kasperl@chromium.org
892b0cac3c Refactor the arguments access code to make it easier to read.
Review URL: http://codereview.chromium.org/6491

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 11:04:03 +00:00
lrn@chromium.org
17dc503149 Added fast-case switch to ARM.
Refactored to reuse code between ia32 and ARM.
Added tests for switch.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 12:04:59 +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
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
kasperl@chromium.org
64923a6a83 Generalize the Function.prototype.call hooks in the
arguments adaptor code to allow builtins to work without
argument adaptor frames. Get rid of unused JavaScript
implementation of call and apply and the associated
code generation hooks.
Review URL: http://codereview.chromium.org/2850

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-15 15:02:38 +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
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
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
ager@chromium.org
d295ddd922 Fix the 'in' operator so it works correctly for negative indices.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-03 07:34:21 +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
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
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
212ac23f82 Fixed building on Mac OS X by recognizing i386 and friends as IA-32 platforms.
Added propagation of stack overflow exceptions that occur while compiling nested functions.

Improved debugger with support for recursive break points and handling of exceptions that occur in the debugger JavaScript code.

Renamed GetInternal to GetInternalField and SetInternal to SetInternalField in the API and moved InternalFieldCount and SetInternalFieldCount from FunctionTemplate to ObjectTemplate.


git-svn-id: http://v8.googlecode.com/svn/trunk@5 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-16 07:07:30 +00:00
christian.plesner.hansen
43d26ecc35 Initial export.
git-svn-id: http://v8.googlecode.com/svn/trunk@2 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-03 15:10:15 +00:00