Commit Graph

753 Commits

Author SHA1 Message Date
erik.corry@gmail.com
118a421067 Simplify the transitions in the Binary Op ICs. Now a single call
to the runtime will both patch in the more specialized binary op
stub and calculate the answer.  This eliminates the need to call
both the rest of the binary op and the patching runtime call.  The
runtime routines are altered to be more agressive in returning
Smis so we don't get spurious heap numbers as inputs to binary ops
while we are patching the binary op ICs.
Review URL: http://codereview.chromium.org/2843049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-06 12:56:55 +00:00
erik.corry@gmail.com
8da222b010 Specialize GenericUnaryStub so that it knows whether it needs to
take negative zero into account.
Review URL: http://codereview.chromium.org/2850043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-05 11:03:16 +00:00
serya@chromium.org
c56b92d65d This change allows generating call-stubs for objects with normal (non-fast) objects in the prototype chain. StubCompiler::CheckPrototypes does ne
If the top level object is a normal object the stub is stored in its prototype map.

Lookup result of type NORMAL is not covered (since the normal stub currently doesn't check the prototype chain).
Review URL: http://codereview.chromium.org/2801018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 14:15:04 +00:00
whesse@chromium.org
94ae008739 Let relational comparison operators quickly compare a string with itself.
Review URL: http://codereview.chromium.org/2802028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5000 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-01 15:18:07 +00:00
whesse@chromium.org
b122fbd363 Decide that different detectable objects are not equal without calling runtime, on all platforms.
Review URL: http://codereview.chromium.org/2805046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4992 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 13:24:47 +00:00
ager@chromium.org
6044b33766 Implement IC for storing to dictionary case objects.
The IC stub is completely generic, so there will only be one such stub
in the system.

Added a new overloaded version of the macro assembler RecordWrite
method for cases where we have the address we store to computed up
front.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4991 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 12:27:49 +00:00
whesse@chromium.org
363060ca23 Ensure that ToPrimitive is called on all objects involved in comparisons <, <=, >, >=. Ensures that ToPrimitive is called when comparing an object to undefined. Fixes bugs on all platforms.
Review URL: http://codereview.chromium.org/2834022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-29 06:47:19 +00:00
lrn@chromium.org
49c4718443 Fix bug in CheckBothPositiveSmi macro.
Fix lint.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4952 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-25 12:31:49 +00:00
lrn@chromium.org
f0529878d1 Add special case of taking a substring that is the entire string to stub.
Review URL: http://codereview.chromium.org/2800027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4951 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-25 11:24:41 +00:00
vitalyr@chromium.org
8ab6832203 Add "has fast elements" bit to maps and use it in inlined keyed loads.
A potential issue with this change is creating lots of maps when
objects flip between fast/slow elements modes.  We could add special
transitions to avoid this.  Yet testing this on our benchmarks, gmail,
and wave seems to indicate that this is not a real problem.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 13:56:35 +00:00
kaznacheev@chromium.org
1e3743a4dd Fixing the regression introduced in r4716.
The regression made 2 tests fail on ia32 with --always-full-compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 12:31:49 +00:00
kaznacheev@chromium.org
927750571c Remove redundant checks in and around GenerateDictionaryLoad.
Similar or duplicate checks are scattered around the code before doing the dictionary load. 
Also the entire branch in GenerateCallNormal that handles global/builtin receiver is 
guaranteed to bail out from GenerateDictionaryLoad, so there is no point in generating it at all.

The purpose of the patch is:
- making C++ code more compact and transparent,
- not generating dead code. 

There is a tiny performance gain. The patch is ia32 only for now.

Please tell me if I am missing anything.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4926 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-23 09:10:21 +00:00
lrn@chromium.org
2bd8d3323b X64: Change strategy for spilling to match ia32. It's just better.
Align deferred code blocks to 16-byte address boundaries.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-22 10:07:57 +00:00
antonm@chromium.org
078d285353 Push AccessorInfo data directly if they reside in old space.
Review URL: http://codereview.chromium.org/2840004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4896 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 17:13:40 +00:00
vitalyr@chromium.org
3cafa65462 Track ascii-ness of data in externalized strings.
If a two-byte string only contains ascii characters, then we can save
memory when flattening a cons string containing it. Similarly we can
use this in Array.prototype.join implementation. To track this a new
bit is added to instance type. This bit is used as a hint in generated
code and in runtime functions.

To enable testing a new V8 extension is added controlled by
--expose-externalize-string flag.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 16:19:28 +00:00
ager@chromium.org
6702ace935 Move definition of NegateConditon from assembler*-inl.h files to
assembler*.h files to make clang happy. There was no reason for having
the definition in the -inl.h files in the first place.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4888 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 08:41:48 +00:00
ager@chromium.org
2043956c54 Remove the comisd instruction from the ia32 and x64 assemblers. We
should always use ucomisd.

Add missing pop from floating-point stack in case of allocation failure.
Review URL: http://codereview.chromium.org/2831009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4878 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 12:32:34 +00:00
kaznacheev@chromium.org
b251f14782 Port KeyedCallIC implementation to x64 and ARM.
Also edited ic-ia32.cc for clarity and better formatting.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 10:03:47 +00:00
ager@chromium.org
ed0fc41723 Change hash computation for transcendental cache to use arithmetic
shifts. Leads to fewer collisions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4872 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 08:29:25 +00:00
ager@chromium.org
9a34337066 Remove direct reference from builtins code to global object. Load the
global object through the context instead.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 12:08:39 +00:00
sgjesse@chromium.org
1c5a9435ab ARM: Change code generation for function return
Generating code for function return on ARM is now aligned with the other platforms. The first non-shadowed return statement encountered will emit code for function return and all other returns including the fall through at the bottom of a function will jump to that.
Review URL: http://codereview.chromium.org/2815003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 11:37:05 +00:00
whesse@chromium.org
317dcabe84 Change tests for string type in RegExpExecStub on all platforms.
Review URL: http://codereview.chromium.org/2772004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 10:21:24 +00:00
ager@chromium.org
89ffd6c2f2 Implement transcendental cache probing in generated code on ARM.
Fixed hash code computation on ia32 and x64 to match the runtime
system (change arithmetic shift right to logical shift right).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-11 10:18:44 +00:00
sgjesse@chromium.org
e045ca6898 Better handling of stepping out of a function
With the change in r4820 all return statements are now breakable like any statement, so stepping will stop before the return statement actually returning from a function. With this change the position when breaking in the function return (after executing the return statement) will be the actual end of the function. At this point the return value is available as it saved to the stack by the debug break at return handling. Added information on the actual value returned from the function to the debugger.
Review URL: http://codereview.chromium.org/2783002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-10 09:02:16 +00:00
kaznacheev@chromium.org
1dec9199ca Add logic from KeyedLoadIC generic stub to KeyedCallIC megamorphic stub.
This should make access faster for arrays of functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4834 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-10 05:06:39 +00:00
whesse@chromium.org
e1e4d985f9 Use static type information on x64 in LikelySmiBinaryOperation.
Refactor check for smi operands, using type information, on ia32 and x64.
Review URL: http://codereview.chromium.org/2771001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-09 11:15:54 +00:00
whesse@chromium.org
b93382d9ff Add test_b(Operand, imm8) to ia32 disassembler.
Review URL: http://codereview.chromium.org/2765001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4822 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:44:24 +00:00
sgjesse@chromium.org
baf100fc48 Add parenthesis around '&&' within '||'
Warning by some gcc versions. Adding the parenthesis made the condition correct.

TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2725003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4821 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:20:24 +00:00
sgjesse@chromium.org
634fb9152c More precise break points and stepping when debugging
Added support for more precise break points when debugging and stepping. To achieve that additional nop instructions are inserted where breaking would otherwise be impossible. The number of nop instructions inserted are sufficient to make place for patching with a call to a debug break code stub. On Intel that is 5 nop's for 32-bit and 13 for 64-bit. Om ARM 3 nop instructions (12 bytes) are required.

In order to avoid inserting nop's in to many places a simple ast checker have been added to check whether there are breakable code in a statement or expression. If it is possible to break in an expression no additional break enabeling code is inserted.

Added break locations to the true and false part of a conditional expression.

Added stepping tests to cover more constructs.

These changes are only in the full compiler.

Changed the default value for the option --debugger in teh d8 shell from true to false. The reason for this is that with --debugger turned on the full compiler will be used for all code in when running d8, which can be unexpeceted.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:04:49 +00:00
whesse@chromium.org
3c42d18a44 Revert change 4812 due to performance problems. This was a change in string addition on ia32.
Review URL: http://codereview.chromium.org/2706001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 13:16:05 +00:00
whesse@chromium.org
dd278e634e Improve generated code for string encoding tests on ia32.
Review URL: http://codereview.chromium.org/2673001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 12:15:10 +00:00
vegorov@chromium.org
53923e9233 Revert r4782. Fix issues 728, 732.
Review URL: http://codereview.chromium.org/2701003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4806 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 09:36:30 +00:00
kaznacheev@chromium.org
ff61618c4b Extend CallIC to support non-constant names.
This speeds up constructs like this: 
var zz='replace'; '123'[zz]('3','4');

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:27:32 +00:00
vitalyr@chromium.org
8689b3bcea Direct load of global function prototype.
As most of call IC code is tied to a context anyway we can save a few dependent loads by having a direct reference to an initial map of a global function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4802 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 16:20:34 +00:00
lrn@chromium.org
d3d295efa7 Add optimized version of memcpy on ia32.
Only used in one place right now.
Still room for tweaking.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 11:30:55 +00:00
whesse@chromium.org
0fc3dca698 Add test_b(Operand, immediate) to ia32 assembler, and use it where possible. Improve comparison to a constant one-character string. Use CmpInstanceType in more places on ia32. Add IsObjectJSObjectType and IsInstanceJSObjectType to ia32 macro assembler, using a single branch for a range test.
Review URL: http://codereview.chromium.org/2586001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4795 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 10:46:04 +00:00
ager@chromium.org
723bed3105 Optimize calls to evals. Most of the time there is no reason to
perform a context lookup in the runtime system for the 'eval'
function. Instead load the 'eval' function from the global context in
generated code if it is not shadowed.

Will port to other platforms as a separate change.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4794 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-04 10:19:19 +00:00
whesse@chromium.org
ebc21fc958 Change keyed load IC interface on x64 to pass arguments in registers.
Review URL: http://codereview.chromium.org/2470001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4787 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 14:37:47 +00:00
sgjesse@chromium.org
33973b7d13 ARM: Add more logic to the generic keyed load stub
The generic keyed load stub was missing converting string keys to numberign keys and lookup in the keyed lookup cache. This is now added together with an additional counter on all platforms.
Review URL: http://codereview.chromium.org/2441002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 21:11:38 +00:00
vitalyr@chromium.org
26be30912d Fix generated code for String.charCodeAt.
Review URL: http://codereview.chromium.org/2468001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 14:08:19 +00:00
whesse@chromium.org
019b8c4511 Change the interface of LoadIC on the x64 platform to take its arguments in registers.
Review URL: http://codereview.chromium.org/2330003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4759 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-31 13:26:12 +00:00
whesse@chromium.org
527c7972c7 Refactor GenerateLoadInterceptor, removing LoadInterceptorCompiler class and CompileLoadInterceptor static function.
All platforms (x64, ia32, and ARM) changed.
Review URL: http://codereview.chromium.org/2251003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4747 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 14:14:46 +00:00
vegorov@chromium.org
fc7c5f789a Cardmarking writebarrier.
Reapply r4715 with fixes reviewed in http://codereview.chromium.org/2276002.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 12:30:45 +00:00
antonm@chromium.org
0dd031aa01 Move assertions to not take case to check that it's safe to omit CheckPrototypes in this case.
Review URL: http://codereview.chromium.org/2279005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4740 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 11:16:04 +00:00
vitalyr@chromium.org
64bc39a726 Fix: make string indexing work with Infinity.
NumberToUint32 that I was trying to use maps -0 to +0 (as desired) but
also maps +/-Infinity to +0, which made +/-Infinity a valid string
index. I fixed it by introducing a new runtime function with the right
semantics.

TEST=LayoutTests/fast/js/char-at.html,mjsunit/string-charat.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 16:11:30 +00:00
vitalyr@chromium.org
ad0e38909f Custom call IC-s for String.prototype.{charAt,charCodeAt}.
These string methods can be composed from two basic blocks: charCodeAt
and fromCharCode, both of which have fast cases for certain types of
inputs. In this patch these two blocks are refactored to allow
generating the fast cases without having to jump around the slow
cases. In the slow cases since they can now be invoked both from
inline runtime functions and from IC stubs we either have to
save/restore state of the current frame or enter/leave a new internal
frame. This is handled by new RuntimeCallHelper interface. Its
implementation for virtual frame is based on FrameRegisterState class
extracted from DeferredCode class.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4733 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 14:23:19 +00:00
antonm@chromium.org
3e88d0d2af Various refactorings in interceptor calling and loading.
1) do not push receiver early---that simplifies tail call preparation
on ia32/x64 and renders special cleanup unnecessary;
2) do not do second map check if interceptor's and cached holder
are the same;
3) do not push/pop receiver if receiver and holder registers are the same
(means that receiver is interceptor's holder);
4) do batch pushes on arm;
5) minor cosmetic improvements.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 14:04:37 +00:00
whesse@chromium.org
fcc3d19321 Refactor x64 named loads to agree with ia32 implementation. Remove dead code and flag is_global from x64 keyed loads.
Review URL: http://codereview.chromium.org/2121022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 11:38:33 +00:00
vegorov@chromium.org
e268fbdaba Revert r4715.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2274001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 09:24:44 +00:00
erik.corry@gmail.com
e66f276e46 The way reloc entries are visited by the ObjectVisitor is architecture
dependent, so we push it down to the architecture dependent files.
Currently all architectures visit in almost the same way, but this is
about to change on ARM with movw/movt.
Review URL: http://codereview.chromium.org/2218002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 08:34:07 +00:00
antonm@chromium.org
f6ec1b4f26 Comment the code for loading and calling with interceptor.
Review URL: http://codereview.chromium.org/2124021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 14:59:11 +00:00
sgjesse@chromium.org
22e4847fde ARM: Update the full compiler to handle all code
The full compiler is now complete on ARM as well. The syntax checker is still used to determine whether to use it for top level code or not during normal execution. When debugging is enabled all code will be compiled with the full compiler.

This change removes the temporary flag --force-full-compiler and now the flag --always-full-compiler enables the full compiler for all code on all platforms.

This also fixes building on Intel platform without debugger support (ENABLE_DEBUGGER_SUPPORT not defined) and adds full check for the full compiler for lazily compiled code.
Review URL: http://codereview.chromium.org/2163006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 14:08:17 +00:00
vegorov@chromium.org
675e711f1c Cardmarking writebarrier.
- New сardmarking write barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).
- Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by
Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on
arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not
computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special
way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 13:15:16 +00:00
vegorov@chromium.org
2241d2af45 Reverting r4703.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2073018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 17:37:47 +00:00
vegorov@chromium.org
8879691793 Cardmarking writebarrier.
Reapplication of r4685 (reviewed http://codereview.chromium.org/2101002) with minor modifications:

- Fix compilation problems on Win64.
- Improve heap verification pass: search for garbage pointers to new space not only in dirty regions but in all regions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 15:52:38 +00:00
whesse@chromium.org
d2c390b03c Revert change 3849. On ia32, LoadFromSlot again returns its result on the top of the expression stack, not as a Result return value.
Review URL: http://codereview.chromium.org/2121014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 12:58:02 +00:00
whesse@chromium.org
ac60f498d2 Change keyed store IC interface on x64 to take value, key, and receiver in registers rather than on the stack.
Review URL: http://codereview.chromium.org/2111011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4692 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 15:09:21 +00:00
ager@chromium.org
1d5eb6517f Reapply r4686: Complete version of full codegen for x64.
Already reviewed at: http://codereview.chromium.org/2078022/show

TBR=vegorov@chromium.org
Review URL: http://codereview.chromium.org/2137008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4689 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:33:02 +00:00
vegorov@chromium.org
955828e437 Reverting r4685, r4686, r4687
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2071020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:02:51 +00:00
erik.corry@gmail.com
52cef3f0e1 Orthogonalize the byte codes used for the snapshot so that
the issue of how the pointee is found and how the pointer
is encoded are separated out.  This will make it simpler to
support various pointers from and to code in the future.
Review URL: http://codereview.chromium.org/2069013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4687 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:54:31 +00:00
ager@chromium.org
355d3166e1 Complete the full codegenerator on x64.
Review URL: http://codereview.chromium.org/2078022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:50:09 +00:00
vegorov@chromium.org
b38a0a719a - Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special way.
- Cardmarking write barrier. New barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:10:38 +00:00
sgjesse@chromium.org
19d98493fc Add complete implementation of full compiler for the ia32 architecture
This makes the full compiler handle all constructs on ia32. However the syntax checker for the full compiler is still the same so for both normal operation and with the flag --always-full-compiler the coverage of the full compiler will be the same.

This is on preparation for improving the debugger break point experience where the plan is to only use code from full code generator when debugging JavaScript.

Runs all tests on all three platforms in release and debug mode. The tests also run with both the following flags to the test runner

  --special-command="@ --nofull-compiler"
  --special-command="@ --always-full-compiler"

The changes to the x64 and ARM architectures are mainly structural due to the change to EmitVariableAssignment to handle initialization of const variables.
Review URL: http://codereview.chromium.org/1989012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4676 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-19 07:32:32 +00:00
erik.corry@gmail.com
73b2fc29b7 Remove unused relocation mode.
Review URL: http://codereview.chromium.org/2136012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4672 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 13:39:16 +00:00
whesse@chromium.org
cd6afbc617 Spill arguments for a function call from the virtual frame as they are produced.
Review URL: http://codereview.chromium.org/2103007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4671 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 11:19:34 +00:00
sgjesse@chromium.org
2b1e19fe45 Fix presubmit error.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2117010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4669 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 06:59:23 +00:00
mark@chromium.org
e9b5d7855b Allow build-time selection between ia32 and x86_64 in the GYP/Xcode Mac
Chromium build.

v8.gyp no longer sets any V8_TARGET_ARCH_* macro on the Mac. Instead, the
proper V8_TARGET_ARCH_* macro will be set by src/globals.h in the same way as
the V8_HOST_ARCH_* macro when it detects that no target macro is currently
defined. The Mac build will attempt to compile all ia32 and x86_64 .cc files.
#ifdef guards in each of these target-specific source files prevent their
compilation when the associated target is not selected. For completeness,
these #ifdef guards are also provided for the arm and mips .cc files.

BUG=706
TEST=x86_64 Mac GYP/Xcode-based Chromium build (still depends on other changes)
Review URL: http://codereview.chromium.org/2133003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-17 15:41:35 +00:00
antonm@chromium.org
c7b2af37ba Use direct loop when filling small arrays.
r3995 (http://code.google.com/p/v8/source/detail?r=3995) introduce performance
regression for the case when arrat size is small (think new Array(4)).

It turns out that in those cases rep stos is slower than plain loop (apprently
due to ecx increment, but I didn't check this hypothesis.)  The next thing
to try could be direct jump into right place of long sequence of stos'es.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-17 14:14:34 +00:00
erik.corry@gmail.com
a31c578f25 Push/pop is just one peephole optimization. Puth them all
under one flag.  Also other cosmetic changes to peephole
optimization.
Review URL: http://codereview.chromium.org/2104006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-17 11:19:10 +00:00
antonm@chromium.org
d24efe5348 Remove unused labels.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4652 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-12 16:42:51 +00:00
ager@chromium.org
75cd61a912 Refactor the fast-case code for loading local/global variables and
arguments in the presence of eval to avoid code duplication. Almost
the same code was duplicated for loading properties and calling
properties.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-12 09:12:23 +00:00
sgjesse@chromium.org
48d38e3063 ia32: Helper function for getting an element of a fixed array from object pointer and smi index.
Review URL: http://codereview.chromium.org/1990012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4643 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-11 12:38:30 +00:00
lrn@chromium.org
e867e63281 RegExp: Remove use of 16-bit immediates on ia32/x64.
Also check more than one character at a time.
16-bit immediates requires a prefix that changes the length of the instruction.
This causes predecoder mispredictions and subsequent pipeline stalls.
Also removed redundant "atStart" local variable which is equivalent to startIndex == 0.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4639 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-11 07:29:10 +00:00
ager@chromium.org
f54b7767c6 Implement fast load and call of arguments in the presence of eval.
Load the arguments object from the context if there are no extensions
objects on the way. Then load the argument with a keyed load ic.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4633 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 12:20:06 +00:00
lrn@chromium.org
9f859fef26 Make X64 double-to-int32 conversion use the 64-bit version of cvttsd2si.
Use type info to allow ia32 to use the 32-bit versions in some cases.
Remove sse3-specific code from X64 GenericBinaryOpStub.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 11:38:58 +00:00
erik.corry@gmail.com
fa7c92eaf5 First step towards making JumpTarget work on ARM. Instead
of having a list of virtual frame pointers in the jump
target we have one virtual frame, which is the frame that
all have to merge to to branch to that frame.  The virtual
frame in the JumpTarget is inside the JumpTarget, rather than
being an allocated object that is pointed to.  Unfortunately
this means that the JumpTarget class has to be able to see
the size of a VirtualFrame object to compile, which in turn
lead to a major reorganization of related .h files.  The
actual change of functionality in this change is intended
to be minimal (we now assert that the virtual frames match
when using JumpTarget instead of just assuming that they do).
Review URL: http://codereview.chromium.org/1961004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4631 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 11:32:25 +00:00
sgjesse@chromium.org
ae4cc3c287 Add a flag to the ARM version of new space allocation in generated code
The flag SIZE_IN_WORDS indicate that the requested size is in words and not in bytes, The default is to specify the size in bytes.
Review URL: http://codereview.chromium.org/2047002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4617 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 14:06:55 +00:00
antonm@chromium.org
a83a88cd58 Moving more code to lookup an item from the native cache into code generator.
To bypass expensive invocation of JS functions from C++ and omit runtime
call overhead for searching the cache, more elaborate deferred code is generated.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 12:48:18 +00:00
sgjesse@chromium.org
9f583d05a2 Remove unused function in ia32 code generator
Review URL: http://codereview.chromium.org/1996006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 11:55:24 +00:00
lrn@chromium.org
876c3e06b5 Synchronizing Comparison codegen between X64 and ia32.
Review URL: http://codereview.chromium.org/2010007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 11:25:29 +00:00
ager@chromium.org
856135af42 Implement fast calls of functions in the presence of eval (if the eval
calls do not introduce new bindings).

The infrastructure is already in place for fast loads from context
slots in the presence of eval.  This change simply uses that
infrastructure for calls as well as loads.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4609 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 10:25:11 +00:00
vitalyr@chromium.org
4724826f4a Refactored custom call IC generators:
* All generators are listed in a single place.
 * Generators are installed as a separate pass in the bootstrapper.
 * Replaced pointers to generator functions with integer ids.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4606 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 13:21:53 +00:00
serya@chromium.org
9c245f168a Fixing a performance bug introduced in r4581.
Review URL: http://codereview.chromium.org/1910005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 12:57:11 +00:00
erik.corry@gmail.com
d18b73c2fe Add a single-element global positive and negative cache to
the implementation of instanceof.
Review URL: http://codereview.chromium.org/1765012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4599 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 09:35:18 +00:00
whesse@chromium.org
cbcec49cd7 Make sure that type info of results is correctly recorded when results are moved to registers by generated code.
Review URL: http://codereview.chromium.org/1905002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 08:56:16 +00:00
sgjesse@chromium.org
5a3ea1c83e Add some comments to the ia32 code generator
Review URL: http://codereview.chromium.org/1918002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4586 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 06:57:41 +00:00
serya@chromium.org
16d3811d50 Changing string length field type from int to SMI. It will make it be a regular field. Code generated in EmitNamedLoad could be patched for faster access to string.length.
Review URL: http://codereview.chromium.org/1706013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 14:49:50 +00:00
lrn@chromium.org
4fdf57ace0 X64: Faster push/pop implementation.
Also snuck in an intended optimization for fast api call preparation and a few indentation fixes.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 13:23:58 +00:00
whesse@chromium.org
852cebb1cb Improve static type information in (constant SHL smi) computation.
Review URL: http://codereview.chromium.org/1910002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 11:17:45 +00:00
ager@chromium.org
6230f5397d Port inline swapping of elements for the sort function in array.js
from ia32 to arm.

Original change: http://codereview.chromium.org/1709008


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 11:06:59 +00:00
sandholm@chromium.org
5affd79e77 Reverting 2635
Review URL: http://codereview.chromium.org/1940001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4572 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 08:41:26 +00:00
whesse@chromium.org
1f9fef3d51 Add inlined code for (constant SHL smi), ported from ia32 to x64. Improve type information on ia32 version of code.
Review URL: http://codereview.chromium.org/1869001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 08:10:05 +00:00
ager@chromium.org
cf54120a58 Port inlined version of swap primitive for sorting from ia32 to x64.
Original code review for ia32 version: http://codereview.chromium.org/1709008
Review URL: http://codereview.chromium.org/1858002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 18:18:25 +00:00
whesse@chromium.org
130d6adf78 Change calling convention of BinaryOperation code generation functions on x64 platform to match ia32 platform.
Review URL: http://codereview.chromium.org/1844002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4568 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 10:53:03 +00:00
ager@chromium.org
b83486c5f6 Port handling of heap numbers in deferred code for binary ops from
ia32 to x64.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 08:46:23 +00:00
antonm@chromium.org
55e32d2f3b Introduce faster swapping primitives.
Keyed store stub sits high in sorting profiles.

Swapping allows to save us additional type checks as we could both read and
write elmenets (on fast path) without them.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 15:14:39 +00:00
sgjesse@chromium.org
0b4c1efd18 Improve the success rate for inline keyed store on x64
Added a simple new space check on the elements fixed array which can allow
updating with other values than smis without updating the remembered set.

Also combined the positive smi and range check so that a separate smi check can be avoided when the key is known to be a smi.

This is a port of r4543.
Review URL: http://codereview.chromium.org/1702013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4547 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 12:52:09 +00:00
sgjesse@chromium.org
22a8a1e770 Improve the success rate for inline keyed store
Added a simple new space check on the elements fixed array which can allow updating with other valies than smis without updating the remembered set.
Review URL: http://codereview.chromium.org/1692014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 07:47:56 +00:00
podivilov@chromium.org
1872574f4d Port string keyed load IC improvements (r4444) to x64.
http://compute1.aar:9013/golem/r4502-v8-podivilov-string-char-at2-x64-vs-4502-v8-x64.html
Review URL: http://codereview.chromium.org/1750017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4542 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 17:16:51 +00:00
ager@chromium.org
62e8d5a789 Port inline version of Math.sqrt and Math.pow from ia32 to x64.
Review URL: http://codereview.chromium.org/1774010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 14:43:51 +00:00