Commit Graph

287 Commits

Author SHA1 Message Date
erik.corry@gmail.com
ad23017469 When strings can change from an ASCII representation to a
UC16 representation we need to be careful about flat strings.
Flat strings can be sliced or cons strings that have a flat
string under them, so when we ask a flat cons or a slice whether
it is ASCII or not we should ask the underlying string about
its representation.  This should fix
http://code.google.com/p/chromium/issues/detail?id=10971
Review URL: http://codereview.chromium.org/100249

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-01 11:16:29 +00:00
erik.corry@gmail.com
b1d09b32f9 Remove dependency on libstdc++ from test framework.
Review URL: http://codereview.chromium.org/99051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 10:52:44 +00:00
erik.corry@gmail.com
f08b2a8898 Fix bugs 145 and 323, preemption and apply on ARM.
Review URL: http://codereview.chromium.org/93121

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1794 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 07:03:10 +00:00
sgjesse@chromium.org
d8daf5f817 Changed the ASSERT's in the cctest's to CHECK's.
There are no ASSERTS left in the cctest's.
Review URL: http://codereview.chromium.org/93120

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 14:29:42 +00:00
erik.corry@gmail.com
561bd9861a Make a test that excercises the preemption code in apply().
Review URL: http://codereview.chromium.org/93015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-22 14:09:50 +00:00
christian.plesner.hansen@gmail.com
d26e6dd0b4 force-set
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 13:28:11 +00:00
sgjesse@chromium.org
b8dc312b25 Make it possible to add a user data object to each script compiled.
Review URL: http://codereview.chromium.org/90003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 07:22:06 +00:00
ager@chromium.org
72294ca735 Change the enumeration order for unsigned integer keys to always be
numerical order independently of the representation of the object.

Exchanged the order of enumeration of integer and string keys so
integer keys are first instead of string keys to better match
WebKit/JSC behavior.

Added test cases that document our enumeration order choice.
Review URL: http://codereview.chromium.org/75035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1722 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 11:30:55 +00:00
kasperl@chromium.org
3b7f631e86 Allow using with and eval in JS extensions in debug mode by
getting rid of bogus assertion error.
Review URL: http://codereview.chromium.org/73072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1710 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-15 06:28:07 +00:00
asargent@chromium.org
144cca7d3d Fix v8::Object::DeleteHiddenValue to not bail when there are no hidden properties.
Review URL: http://codereview.chromium.org/58016


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1687 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-08 21:05:29 +00:00
lrn@chromium.org
5dc51480c5 Quick pointer comparison, removed undetectable tests.
Special case for NaN in equality test.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1676 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-03 12:44:45 +00:00
ager@chromium.org
aacd90314f Reland exception propagation fix.
Fix exception propagation problem where undefined was returned instead
of an empty handle in case of an exception.  This problem can break
C++ programs that are not interested in catching exceptions and just
want to propagate them out by testing for empty handles.

The issue is that exceptions are not rescheduled if they are
externally caught.  Externally caught exceptions have to be
rescheduled if there is a JavaScript frame on the way to the C++ frame
that holds the external handler.

A couple of tests will fail on the ARM simulator because the simulator
has separate stacks for C++ and JavaScript.  I have marked the tests
as failing only on the simulator.
Review URL: http://codereview.chromium.org/56105

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-31 15:23:58 +00:00
christian.plesner.hansen@gmail.com
9142c42df2 Fixed a bunch of memory leaks in tests, including:
- String traversal test data (now in a zone)
 - Debug message thread (now joined on exit)
 - Threading test threads (now joined on exit)
 - Changed message tests framework to cope with valgrind
Also, fixed a bug where we'd try to delete stack-allocated objects
when tearing down v8.  Good times.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 00:24:49 +00:00
ager@chromium.org
d4e6613760 Fix bug in context stores, where the store was ignored if there was a
read-only property in the prototype chain.  Stores should only be
ignored if there is a read-only property on the object itself.
Review URL: http://codereview.chromium.org/42508

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 08:27:43 +00:00
iposva@chromium.org
7b50c072f9 Add a new C++ pointer wrapping API to External to not dilute the
External::Cast.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1578 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 19:51:10 +00:00
christian.plesner.hansen
3355c8130e Fixed windows build.
Review URL: http://codereview.chromium.org/52004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 02:25:40 +00:00
iposva@chromium.org
ce1fe3e465 - Fix constness in tests.
Review URL: http://codereview.chromium.org/42472

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 23:33:36 +00:00
iposva@chromium.org
1db91bee34 - Do not allocate proxy objects if the pointer can be wrapped in a Smi representation.
Review URL: http://codereview.chromium.org/42466

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1568 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 22:13:50 +00:00
lrn@chromium.org
6fa2f4f0c9 RegExps now restart if their input string changes representation during preemption.
Cleaned up the handling of strings moving, so strings moved by GC and strings changing representation are handled equivalently.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1562 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 13:26:16 +00:00
ager@chromium.org
4d6b3a54ad Fix lint.
TBR=iposva
Review URL: http://codereview.chromium.org/50026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 19:29:23 +00:00
iposva@chromium.org
ea653021fc - Allow hidden properties to be set on any JSObject through the V8 C++ API.
- Use the hidden properties to expose a IdentityHash accessor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 18:50:00 +00:00
ager@chromium.org
2ff097e17f Minor build and code style issues.
Review URL: http://codereview.chromium.org/42354

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-18 21:14:46 +00:00
mike@belshe.com
c5d777338a Expose Cloning through API.
Review URL: http://codereview.chromium.org/42339

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-18 19:24:15 +00:00
olehougaard
9149e4c8db Fixed some memory leaks in unit tests.
Review URL: http://codereview.chromium.org/46103

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1516 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-16 07:53:20 +00:00
ager@chromium.org
04cc9cfffd Revert the exception propagation fix. It leads to crashes because
Top::external_caught_exception_ and Top::try_catch_handler_ are no
longer in sync.  Pulling it out until I have the time to fix it.
Review URL: http://codereview.chromium.org/42117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1497 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-12 12:29:17 +00:00
ager@chromium.org
6eb3030479 Temporarily disable tests that no longer work on the ARM simulator.
Exclude the tests from the threaded tests because I don't want to
disable those on ARM.

The issue is that the simulator keeps the C++ and the JavaScript stack
separated.  This is not a problem on the real hardware and the tests
pass on our ARM box.
Review URL: http://codereview.chromium.org/42069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 14:29:21 +00:00
ager@chromium.org
90093ea868 Fix exception propagation problem where undefined was returned instead
of an empty handle in case of an exception.  This problem can break
C++ programs that are not interested in catching exceptions and just
want to propagate them out by testing for empty handles.

The issue is that exceptions are not rescheduled if they are
externally caught.  Externally caught exceptions have to be
rescheduled if there is a JavaScript frame on the way to the C++ frame
that holds the external handler.
Review URL: http://codereview.chromium.org/43070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 11:13:15 +00:00
ager@chromium.org
9f6adefa55 Fix test for building on 64-bit Linux.
TBR=sgjesse
Review URL: http://codereview.chromium.org/41007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 19:48:25 +00:00
sgjesse@chromium.org
994ea00dfe Changed a function in the internal debugger JavaScript to return the full source location instead of only the position.
Added an optional parameter to exclude/include the source line offset in source location.

Extended a message test to include a test with source offset.
Review URL: http://codereview.chromium.org/39342

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 17:59:25 +00:00
lrn@chromium.org
f8051275e0 Add test for GC during RegExp.
Fix bug found by test.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-20 13:03:54 +00:00
iposva@chromium.org
be6b490fb0 Remove experimental ExternalSymbolCallback feature. This is not needed
since we can now transform String objects to be external when needed.

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-11 23:52:52 +00:00
ager@chromium.org
db1896c253 Make sure that the prototype of the initial map is created in the
right context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1157 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 15:09:44 +00:00
feng@chromium.org
de06f3092c Avoid using sprintf_s, which is windows-only.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 19:42:51 +00:00
feng@chromium.org
2cb36759ba Fix issue 6264 with a test case.
The problem is that Disable/EnableAccessCheck on an object may chnage its constructor's behavior
if object's map is the same as constructor's initial map. By copying maps, the constructor's
initial map is not changed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 17:39:23 +00:00
ager@chromium.org
3f383346aa Inline array loads in loops directly in the code instead of always
calling a stub.  The map to check against is unknown when generating
the code, so we patch the map check in the IC initialization code.

Loop nesting is currently not tracked on ARM.  I'll file feature
request bug reports for implementing this on ARM and add the number to
the TODOs before I commit.
Review URL: http://codereview.chromium.org/16409

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1015 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-22 12:56:32 +00:00
ager@chromium.org
e8b56e6f95 Make sure that the API does not change templates pass in from the
user.  The API should never change templates behind the back of the
user.
Review URL: http://codereview.chromium.org/13741

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@963 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-11 11:09:51 +00:00
ager@chromium.org
4f15a008f6 Make sure that the generic stubs for keyed load and store and for
dictionary probing respects access check bit.
Review URL: http://codereview.chromium.org/13663

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@955 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-10 08:05:10 +00:00
olehougaard
90611c0ef7 Removed a few calls to Top::ReportPendingMessages() that caused the messages to be reported prematurely and not at the C++/JS boundary.
Review URL: http://codereview.chromium.org/13287

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-09 13:18:33 +00:00
olehougaard
ccf388fc64 Fixing a bug where a try-finally block obscured a try-catch block when registering an external try-catch handler.
Review URL: http://codereview.chromium.org/13658

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-09 10:16:38 +00:00
olehougaard
89855a08d9 Fixing exception reporting so that a verbose TryCatch handler works again.
Review URL: http://codereview.chromium.org/13173

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@924 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-05 13:30:55 +00:00
olehougaard
30204a0c00 Added reporting compilation errors.
Review URL: http://codereview.chromium.org/13125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-05 08:35:52 +00:00
ager@chromium.org
15e98d12e6 Pull out revision 915 and 916 to get a green builder. I believe the
issue has been resolved and these changes can go back in along with
the fix tomorrow.

TBR=olehougaard
Review URL: http://codereview.chromium.org/12945

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-04 14:35:31 +00:00
olehougaard
cb6a3e2f0a Reporting uncaught errors at the boundary between C++ and JS instead of trying to guess whether they get caught at the time of the throw.
Review URL: http://codereview.chromium.org/12901

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-04 08:47:31 +00:00
olehougaard
2b72eeedfb Change implementation of eval to make an exact distinction between direct eval and aliased eval.
Review URL: http://codereview.chromium.org/12673

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-27 13:55:06 +00:00
ager@chromium.org
95d1d40077 Revert r819, 821, and 822 which caused a big performance regression
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-21 15:01:41 +00:00
olehougaard
3877c91a19 Fixing the detection of aliased eval so that it is exact.
Fixing the semantics of aliased eval so that it is conformant.
Review URL: http://codereview.chromium.org/11563

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-21 12:49:57 +00:00
ager@chromium.org
4bd0667324 When probing a dictionary backing storage in generated code, make sure
not to return functions that have not been loaded.

This fixes crashes on expedia.com:

  http://code.google.com/p/chromium/issues/detail?id=4526
Review URL: http://codereview.chromium.org/11272

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-20 09:18:08 +00:00
olehougaard
27e4365aba Fixing wrong reference to this in eval.
Review URL: http://codereview.chromium.org/11227

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-18 10:02:37 +00:00
olehougaard
4c9102021d Changing the semantics of cross-frame eval to be compatible with Safari and Firefox.
Review URL: http://codereview.chromium.org/11601

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-18 08:43:58 +00:00
iposva@chromium.org
4a31a4b638 Add an API test for v8::ScriptData::PreCompile() to make sure
that v8::V8::Initialize() does not have to be called to allow
pre-compilation. Currently this test would fail, which is
why a workaround has been applied and a bug filed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@779 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-18 07:32:38 +00:00
ager@chromium.org
5737edb967 Remove assert that I accidentally committed
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 18:43:04 +00:00
feng@chromium.org
b4e17a2345 fix lint issue (from ager's commit)
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 17:54:15 +00:00
ager@chromium.org
954bda3c46 Fix external string test.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 16:00:58 +00:00
ager@chromium.org
96d15ef6b4 Add experimental support for external two-byte symbols.
This might be a big win in a browser setting where a lot of string
conversions can be avoided.  On the other hand it adds extra pressure
on the global handle system.
Review URL: http://codereview.chromium.org/11404

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 15:13:40 +00:00
olehougaard
2173d21458 Restrict application of eval so it can only be used in the context of the global object. For compatibility.
Review URL: http://codereview.chromium.org/10748

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-14 13:14:49 +00:00
olehougaard
bf3efa1c72 Fixing propertyIsEnumerable for properties that are *both* enumerable and read-only.
Review URL: http://codereview.chromium.org/8962

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-31 11:53:29 +00:00
olehougaard
77a92988d2 Introduce access control in propertyIsEnumerable.
Also, fix JSObject::getPropertyAttribute() so it deals correctly with access control modifiers.
Review URL: http://codereview.chromium.org/8834

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-30 12:51:06 +00:00
kasperl@chromium.org
91b19fcfe6 Fix lint issue.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 10:15:07 +00:00
sgjesse@chromium.org
5ffd290217 Changed the workarround for a GCC compiler bug to be only active for the GCC
version range for which the bug is known to exist.

Added include to compile with GCC 4.3.1.

BUG=122


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@583 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 09:35:27 +00:00
kasperl@chromium.org
b454b326a1 Fix lint issue.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 11:09:48 +00:00
christian.plesner.hansen@gmail.com
e08ce319ca Added v8::Object::GetProperties method that returns an array of all
the enumerable properties of an object.


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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 11:26:37 +00:00
sgjesse@chromium.org
6a5e5bc50a Removed the print, load, quit and version extensions from the VM. Moved the print extension to the compiler test as it was used there. Changed the serializer tests to only use the gc extension.
This also gets rid of 8 static initializers.
Review URL: http://codereview.chromium.org/6233

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 08:30:22 +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
feng@chromium.org
e048ec8c44 This is a fix of issue http://b/issue?id=1381845.
Check domain security on prototypes in for-in loop.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-24 15:47:34 +00:00
erik.corry@gmail.com
5312fc05be The OutOfMemory and OutOfMemoryNested tests set a heap limit that was too low.
A change in the way heap was allocated meant that the initial heap size was
sometimes not higher than the limit, which mean that the limit started having
and effect and prevented V8 from booting up.

Fixes http://code.google.com/p/v8/issues/detail?id=25
Review URL: http://codereview.chromium.org/2924

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-17 10:58:45 +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
kasperl@chromium.org
1daa61fe2d Fix issue 65 by making sure not to leak any of the cache
tables when doing compilation cache operations.
Review URL: http://codereview.chromium.org/1939

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@280 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 13:39:48 +00:00
olehougaard
d667ef8e00 Enabling a few tests when using snapshots.
Some of the tests that were disabled when using snapshot has been modified and reenabled.
Review URL: http://codereview.chromium.org/1937

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@277 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 12:33:31 +00:00
kasperl@chromium.org
eed1ab336c Don't run the string resource tests threaded for now.
I'm debugging the issue and will file an issue for it.
Review URL: http://codereview.chromium.org/2419

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@276 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 12:25:37 +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
ager@chromium.org
f77b1a872e Remove a test from threading tests that make them fail on Mac OS.
Review URL: http://codereview.chromium.org/2415

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@261 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 07:28:10 +00:00
christian.plesner.hansen@gmail.com
4d95ac7339 Added option for TryCatches to not capture the message object on
exceptions.

It turned out that the stack overflow fix from before had disabled
message storing in another test.  Previously, stack overflows would
actually cause a message object to start being created but cause
another exception which would not be reported and that's what stopped
the infinite regress.  This change resores that behavior.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-10 14:54:15 +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
christian.plesner.hansen@gmail.com
de607bd33e Added source info to TryCatches. Reorganized exception messaging
somewhat and folded stack traces into message.  Use of this in the
shell will follow in a separate changelist.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@235 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 18:55:41 +00:00
christian.plesner.hansen@gmail.com
cdae1c1af5 Fixed issue 54, under some circumstances internal field count set on
object templates did not take effect.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@226 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 07:57:43 +00:00
feng@chromium.org
5d0d354e09 Fix issue http://code.google.com/p/v8/issues/detail?id=32
Allows numberical strings as array index and make a call. e.g.,
callbacks['0']();

Added more test case for regexp (disabled by default, requires --call_regexp)
and call_as_function object created by API.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-08 16:47:23 +00:00
kasperl@chromium.org
c60fef3013 Fix issues with running some of our tests with an embedded
snapshot. Changed the debug-script.js test to ignore the
exact number of extension scripts.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-08 09:26:02 +00:00
kasperl@chromium.org
cd3bf78bca Fix broken build. Sorry about that.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-08 07:24:10 +00:00
feng@chromium.org
dcdf6ea394 These two tests are currently broken. Will file report to plesner.
Review URL: http://codereview.chromium.org/468

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 16:53:34 +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
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