Issue Details (XML | Word | Printable)

Key: SERVER-446
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Aaron Staple
Reporter: Eliot Horowitz
Votes: 7
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Core Server

finish v8 engine

Created: Nov 29 2009 10:14 PM UTC   Updated: Feb 12 2010 02:46 PM UTC
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 1.3.2

Issue Links:
Depends

Backport: No


 Description  « Hide
scons --usev8 builds all binaries with v8 instead of spider monkey.
scons --usev8 test && ./test js would be a good place to start


 All   Comments   Change History   git Commits      Sort Order: Ascending order - Click to sort in descending order
Eliot Horowitz made changes - Nov 29 2009 10:16 PM UTC
Field Original Value New Value
Link This issue is depended on by SERVER-326 [ SERVER-326 ]
Eliot Horowitz made changes - Dec 07 2009 05:11 PM UTC
Roadmap 1.4
Alexander Kellett added a comment - Dec 09 2009 10:21 AM UTC - edited
AFAIU v8 is still quite a bit slower than the C++ based engine in Safari. Have you considered using that instead?

Eliot Horowitz added a comment - Dec 09 2009 10:29 AM UTC
No - that APi is not really usable, and I think v8 and safari are neck and neck for speed.
safari also doesn't support a lot of the platforms we need.

Eliot Horowitz made changes - Dec 09 2009 09:03 PM UTC
Assignee Eliot Horowitz [ eliot ] aaron [ aaron ]
Eliot Horowitz made changes - Dec 09 2009 09:03 PM UTC
Link This issue is depended on by SERVER-470 [ SERVER-470 ]
Eliot Horowitz made changes - Dec 15 2009 11:28 AM UTC
Description scons --usev8 builds all binaries with v8 instead of spider monkey.
scons --usev8 test && ./test js would be a good place to start
auto added a comment - Dec 15 2009 06:53 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement readOnly mode in v8 engine
http://github.com/mongodb/mongo/commit/8add9a17b9fe9d4a0a647c982326a2279aac2d23

auto added a comment - Dec 15 2009 07:55 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 Implemented special db types round trip support for v8
http://github.com/mongodb/mongo/commit/ebdb8282a2150c22a280705e99240d97b68e46d0

auto added a comment - Dec 15 2009 08:41 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 simple int/double differentiation
http://github.com/mongodb/mongo/commit/bec620a87a8ea0974431952d0aba291372002558

Aaron Staple added a comment - Dec 15 2009 08:48 PM UTC
Right now in sm, if a double that could be represented as an int is moved to sm and back, it remains a double. Right now in v8, in the same situation, the double is returned as an int without loss of information. Is this ok?

I'm just asking because the jstests don't check this behavior in TypeConservation though they test several other cases (I added a commented out --D-- section to demonstrate this particular issue) and the implementation for the current v8 behavior is nicer than would be required if we needed to keep track of the original type.

Eliot Horowitz added a comment - Dec 15 2009 08:57 PM UTC
i think this is ok.
i can theoretically see a problem this would could cause, but don't think its relevant.

Repository Revision Date Author/Committer Message
server 8add9a1... Tue Dec 15 23:52:41 UTC 2009 Aaron / Aaron SERVER-446 implement readOnly mode in v8 engine
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/engine_v8.cpp
MODIFY scripting/v8_wrapper.cpp
MODIFY scripting/v8_wrapper.h

Repository Revision Date Author/Committer Message
server ebdb828... Wed Dec 16 00:54:39 UTC 2009 Aaron / Aaron SERVER-446 Implemented special db types round trip support for v8
Files Changed
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server bec620a... Wed Dec 16 01:40:53 UTC 2009 Aaron / Aaron SERVER-446 simple int/double differentiation
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY scripting/v8_wrapper.cpp

auto added a comment - Dec 16 2009 02:44 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 round trip array support
http://github.com/mongodb/mongo/commit/b9ddc3e9ef3b1e234bc84dd6a80326f0196a249d

auto added a comment - Dec 16 2009 02:44 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 support conversion of Code, CodeWScope to v8 function
http://github.com/mongodb/mongo/commit/25b56fbba919cba1c370fc3dd9ee72b7deeef7ef

auto added a comment - Dec 16 2009 02:44 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement old style dbref support in v8
http://github.com/mongodb/mongo/commit/df01c097d655133080dabb4b40f7c1bc8754b522

auto added a comment - Dec 16 2009 02:44 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 support bindata round trip
http://github.com/mongodb/mongo/commit/385bb326413e01ba27e62ab582e9b57f9251c269

Repository Revision Date Author/Committer Message
server b9ddc3e... Wed Dec 16 17:31:56 UTC 2009 Aaron / Aaron SERVER-446 v8 round trip array support
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY scripting/v8_wrapper.cpp

Aaron Staple added a comment - Dec 16 2009 05:32 PM UTC
It looks like it's impossible in v8 to implement access interceptors on a value which v8 represents internally as an array. Right now I'm using access interceptors to implement write protection, but to do so I am converting BSON arrays to v8 objects instead of v8 arrays (and then back into BSON arrays round-trip). However, with this implementation we can't treat the BSON arrays as arrays in js code (for example forEach() won't work, since v8 thinks it's dealing with a non-array object). I could conceivably use v8 arrays instead of v8 objects in cases where write protection isn't required, but then we'd have two different array formats and that could be confusing to a js programmer.

Inheriting from Array doesn't work correctly in v8, so that isn't an option for getting around this problem. I could post a question on the v8 user group, but I may not get any helpful feedback.

What should I do? Just disable write protection for arrays?

Eliot Horowitz added a comment - Dec 16 2009 05:35 PM UTC
Yeah - just don't worry about write protection for arrays
not that important.

auto added a comment - Dec 16 2009 05:50 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 don't attempt to write protect arrays in v8
http://github.com/mongodb/mongo/commit/78a9e77c33a0276893ec2412bc4305195a5b5665

Repository Revision Date Author/Committer Message
server 25b56fb... Wed Dec 16 18:36:17 UTC 2009 Aaron / Aaron SERVER-446 support conversion of Code, CodeWScope to v8 function
Files Changed
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server df01c09... Wed Dec 16 19:14:48 UTC 2009 Aaron / Aaron SERVER-446 implement old style dbref support in v8
Files Changed
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 385bb32... Wed Dec 16 19:42:46 UTC 2009 Aaron / Aaron SERVER-446 v8 support bindata round trip
Files Changed
MODIFY scripting/v8_wrapper.cpp

Aaron Staple added a comment - Dec 16 2009 09:00 PM UTC
It looks like the keySet() function is hardcoded in the spidermonkey engine currently. Would it make sense to write this in javascript instead?

auto added a comment - Dec 16 2009 09:04 PM UTC

Eliot Horowitz added a comment - Dec 16 2009 09:04 PM UTC
I believe its impossible.
i'm pretty sure keySet() is supposed to only return fields on the current object, not including prototype fields.
and i don't think there is a way to do that in pure js.
if there is - then sure.

auto added a comment - Dec 16 2009 09:04 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 fix v8 type() bug involving type hierarchy
http://github.com/mongodb/mongo/commit/4cf6964975f5e7a87c2ac4a0f1e59a98c07f1666

auto added a comment - Dec 16 2009 09:04 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 don't attempt to convert c++ backed 'external' objects to BSON
http://github.com/mongodb/mongo/commit/c3ea73736f3971adde40f41dfb7fdc9cff9b0a9a

Aaron Staple added a comment - Dec 16 2009 09:14 PM UTC
Would something like this work for grabbing the keys that would be in keyset?

for( i in z ) { if ( !( i in z.__proto__ ) || z[i] != z.__proto__[i] ) { print( i ); } }

Eliot Horowitz added a comment - Dec 16 2009 09:18 PM UTC
Yeah - probably can do something like that actually.
At least can't think of any problems right now.

auto added a comment - Dec 16 2009 09:38 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 test that BinData js object is being used
http://github.com/mongodb/mongo/commit/15971b9ad92f8c82897046c92b7bf55683f8c95b

Repository Revision Date Author/Committer Message
server 78a9e77... Wed Dec 16 22:49:22 UTC 2009 Aaron / Aaron SERVER-446 don't attempt to write protect arrays in v8
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 643ad02... Thu Dec 17 00:50:36 UTC 2009 Aaron / Aaron SERVER-446 add DBPointer to v8
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/v8_db.cpp
MODIFY scripting/v8_db.h
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 4cf6964... Thu Dec 17 01:33:30 UTC 2009 Aaron / Aaron SERVER-446 fix v8 type() bug involving type hierarchy
Files Changed
MODIFY scripting/engine_v8.cpp

Repository Revision Date Author/Committer Message
server c3ea737... Thu Dec 17 01:47:32 UTC 2009 Aaron / Aaron SERVER-446 v8 don't attempt to convert c++ backed 'external' objects to BSON
Files Changed
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 15971b9... Thu Dec 17 02:37:31 UTC 2009 Aaron / Aaron SERVER-446 test that BinData js object is being used
Files Changed
MODIFY dbtests/jstests.cpp

auto added a comment - Dec 21 2009 12:59 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 use js BinData type from v8 engine
http://github.com/mongodb/mongo/commit/455bf0c0492421f8467f88e1f2371cb3e29dc5d9

auto added a comment - Dec 21 2009 12:59 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 MINOR enhance BinData round trip test to check data strings containing null bytes
http://github.com/mongodb/mongo/commit/499cb647b65ca9d1b0cbdc27f72359b30bf2bf39

Aaron Staple added a comment - Dec 21 2009 02:01 PM UTC
I'm implementing a js version of keySet and adding it to Object rather than Object.prototype to avoid having a new and confusing 'keySet' key in all objects when doing manual iteration. This requires that keySet be called explicitly via Object.keySet() rather than simply doing obj.keySet().

Hopefully this new interface is ok.

auto added a comment - Dec 21 2009 02:21 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 js implementation of keySet()
http://github.com/mongodb/mongo/commit/81b7e051b2c42e47566b9005e3db13e6a59ea68b

auto added a comment - Dec 21 2009 02:34 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement keySet w/o array comprehension, since v8 doesn't support that
http://github.com/mongodb/mongo/commit/e7e790ee960c7e455b6655064f15a7547d38b039

Aaron Staple added a comment - Dec 21 2009 04:56 PM UTC
It appears that when spidermonkey is invoked to return a value from a native c++ callback, values which the callback returned as 'undefined' type are converted to 'null' type. As a result, undefined values are converted to null when the db is queried.

This conversion is not performed by v8, and as a result one (or more) of the js tests don't pass, producing obscure output.

Should I make v8 perform the same conversion undefined->null? Alternatively I could just fix the test(s) individually.

Aaron Staple added a comment - Dec 21 2009 05:05 PM UTC
An alternative solution would be to have both engines just drop undefined values.

Eliot Horowitz added a comment - Dec 21 2009 05:10 PM UTC
lets make v8 work like spider monkey for now

auto added a comment - Dec 21 2009 05:38 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 allow js client access to MaxKey and MinKey values
http://github.com/mongodb/mongo/commit/ad93048085caf8d79b7850a61b2d0669f2b972e1

Repository Revision Date Author/Committer Message
server 455bf0c... Mon Dec 21 17:55:20 UTC 2009 Aaron / Aaron SERVER-446 use js BinData type from v8 engine
Files Changed
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/v8_db.cpp
MODIFY scripting/v8_db.h
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 499cb64... Mon Dec 21 17:57:04 UTC 2009 Aaron / Aaron SERVER-446 MINOR enhance BinData round trip test to check data strings containing null bytes
Files Changed
MODIFY dbtests/jstests.cpp

Aaron Staple added a comment - Dec 21 2009 07:08 PM UTC
v8 reorders fields with numeric names

In v8:
> z = { "x":1,"4":2 };
{ "4" : 2, "x" : 1 }

while in sm:
> z = { "x":1,"4":2 }
{ "x" : 1, "4" : 2 }


I'm assuming this isn't a big deal for us. I'm just going to make the tests more flexible where they are failing currently.

auto added a comment - Dec 21 2009 07:10 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 don't drop undefined elements
http://github.com/mongodb/mongo/commit/ad8698567078da9b0d085dd33e02ca98147afe60

auto added a comment - Dec 21 2009 07:10 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 populate 'args' object on v8 invoke
http://github.com/mongodb/mongo/commit/5d9f70180b38379b45450fdf27ef97319e97745d

auto added a comment - Dec 21 2009 07:10 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 adjust test since v8 reorders numeric named fields
http://github.com/mongodb/mongo/commit/7c005a3fee2104ab00fb1c7c42c7cb5c0bd755b9

Repository Revision Date Author/Committer Message
server 81b7e05... Mon Dec 21 19:21:25 UTC 2009 Aaron / Aaron SERVER-446 js implementation of keySet()
Files Changed
MODIFY jstests/fm2.js
MODIFY jstests/jni4.js
MODIFY jstests/mr1.js
MODIFY jstests/mr3.js
MODIFY jstests/mr4.js
MODIFY jstests/mr5.js
MODIFY jstests/set1.js
MODIFY jstests/sharding/features2.js
MODIFY jstests/update6.js
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/engine_spidermonkey.cpp
MODIFY shell/collection.js
MODIFY shell/db.js
MODIFY shell/utils.js

Repository Revision Date Author/Committer Message
server e7e790e... Mon Dec 21 19:34:02 UTC 2009 Aaron / Aaron SERVER-446 implement keySet w/o array comprehension, since v8 doesn't support that
Files Changed
MODIFY shell/utils.js

Repository Revision Date Author/Committer Message
server ad93048... Mon Dec 21 22:37:23 UTC 2009 Aaron / Aaron SERVER-446 v8 allow js client access to MaxKey and MinKey values
Files Changed
MODIFY scripting/v8_db.cpp

auto added a comment - Dec 21 2009 10:52 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 handles NumberLong type
http://github.com/mongodb/mongo/commit/de9e185d3d0ce38da0da0ff82509a90c383c4870

auto added a comment - Dec 21 2009 10:52 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 extract object id string validation to general engine layer
http://github.com/mongodb/mongo/commit/bbcc6c1d0c80305396f051efdc34935505b614be

auto added a comment - Dec 21 2009 10:52 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 use generic object id validation in v8 engine ObjectId constructor
http://github.com/mongodb/mongo/commit/0e045e2fe1f9dede478a2980d6f4f75b6bc7b0ad

Aaron Staple added a comment - Dec 21 2009 11:11 PM UTC
Also getting rid of the bsonsize() function -- it's only used in one test, and can use the datasize command there instead.

If it's a problem, just let me know.

Eliot Horowitz added a comment - Dec 21 2009 11:14 PM UTC
we definitely need that and cannot get rid of it
used for client debugging in eval, etc...

Aaron Staple added a comment - Dec 21 2009 11:22 PM UTC
Gotcha. Is it ok if we change the syntax to Object.bsonsize( x ) ? That would be much easier to implement in v8 unless we don't care about polluting Object.prototype with an extra key.

Eliot Horowitz added a comment - Dec 21 2009 11:25 PM UTC
That's fine - just make sure to update the website docs with a note about 1.3

Repository Revision Date Author/Committer Message
server ad86985... Mon Dec 21 23:25:28 UTC 2009 Aaron / Aaron SERVER-446 v8 don't drop undefined elements
Files Changed
MODIFY scripting/v8_wrapper.cpp

auto added a comment - Dec 21 2009 11:27 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 save hostname in mongo object
http://github.com/mongodb/mongo/commit/793dfc134b24030ed19e29f4654077dfe56a75ce

Aaron Staple added a comment - Dec 21 2009 11:28 PM UTC
Thanks for letting me know - will do

auto added a comment - Dec 21 2009 11:59 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement bsonsize() in v8
http://github.com/mongodb/mongo/commit/643ec0261b21c8053dfabe9a9446d7bdc3ef788d

auto added a comment - Dec 21 2009 11:59 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement new Object.bsonsize( x ) syntax in sm engine
http://github.com/mongodb/mongo/commit/6c7cc48dcd1788a97878f7c7a9ee6e4ea3092f63

Repository Revision Date Author/Committer Message
server 5d9f701... Tue Dec 22 00:00:57 UTC 2009 Aaron / Aaron SERVER-446 populate 'args' object on v8 invoke
Files Changed
MODIFY scripting/engine_v8.cpp

Repository Revision Date Author/Committer Message
server 7c005a3... Tue Dec 22 00:09:47 UTC 2009 Aaron / Aaron SERVER-446 adjust test since v8 reorders numeric named fields
Files Changed
MODIFY jstests/json1.js

Repository Revision Date Author/Committer Message
server de9e185... Tue Dec 22 00:48:52 UTC 2009 Aaron / Aaron SERVER-446 v8 handles NumberLong type
Files Changed
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server bbcc6c1... Tue Dec 22 01:03:12 UTC 2009 Aaron / Aaron SERVER-446 extract object id string validation to general engine layer
Files Changed
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/engine.cpp
MODIFY scripting/engine.h
MODIFY scripting/sm_db.cpp

Repository Revision Date Author/Committer Message
server 0e045e2... Tue Dec 22 03:49:51 UTC 2009 Aaron / Aaron SERVER-446 use generic object id validation in v8 engine ObjectId constructor
Files Changed
MODIFY scripting/v8_db.cpp

Repository Revision Date Author/Committer Message
server 793dfc1... Tue Dec 22 04:27:09 UTC 2009 Aaron / Aaron SERVER-446 save hostname in mongo object
Files Changed
MODIFY scripting/v8_db.cpp

Repository Revision Date Author/Committer Message
server 643ec02... Tue Dec 22 04:40:04 UTC 2009 Aaron / Aaron SERVER-446 implement bsonsize() in v8
Files Changed
MODIFY jstests/objid5.js
MODIFY scripting/v8_db.cpp
MODIFY scripting/v8_db.h

Repository Revision Date Author/Committer Message
server 6c7cc48... Tue Dec 22 04:58:55 UTC 2009 Aaron / Aaron SERVER-446 implement new Object.bsonsize( x ) syntax in sm engine
Files Changed
MODIFY scripting/engine_spidermonkey.cpp

auto added a comment - Dec 22 2009 01:54 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 v8 support storefunc
http://github.com/mongodb/mongo/commit/39967b06090dab2e55d71ab520708e5900b4c3d2

auto added a comment - Dec 22 2009 01:54 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 make type1.js work with v8 double/int scheme as well as sm
http://github.com/mongodb/mongo/commit/76275b5a6bae403289ab0dba760a3f5022761362

auto added a comment - Dec 22 2009 01:54 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 support multi update mode v8
http://github.com/mongodb/mongo/commit/80bd8d169d617a90cd515fd720ba38720066617d

auto added a comment - Dec 22 2009 01:54 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 clean up whitespace when creating js function in v8 engine
http://github.com/mongodb/mongo/commit/556a55420536d63159c762e377d4d1f640e54340

Aaron Staple added a comment - Dec 22 2009 02:04 PM UTC
Last failure in the basic tests is that in mr1.js the db process runs out of memory with v8 engine. I can try to investigate myself, but please let me know first if you have any thoughts about the cause of this.

Eliot Horowitz added a comment - Dec 22 2009 02:09 PM UTC
Is it running out of v8 memory or total memory? Is the v8 memory configurable?
If its system memory, then its probably a leak in the v8 side...

Aaron Staple added a comment - Dec 22 2009 03:00 PM UTC
Updating my v8 code fixed the memory problem - must have gotten a bad rev. earlier.

auto added a comment - Dec 22 2009 03:05 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 implement gc() in v8 engine
http://github.com/mongodb/mongo/commit/770394a02d11fdf3b62be0c671083fb14826e1a0

Aaron Staple made changes - Dec 22 2009 03:22 PM UTC
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Repository Revision Date Author/Committer Message
server 39967b0... Tue Dec 22 17:52:11 UTC 2009 Aaron / Aaron SERVER-446 v8 support storefunc
Files Changed
MODIFY scripting/engine_v8.cpp
MODIFY scripting/engine_v8.h

Repository Revision Date Author/Committer Message
server 76275b5... Tue Dec 22 18:12:30 UTC 2009 Aaron / Aaron SERVER-446 make type1.js work with v8 double/int scheme as well as sm
Files Changed
MODIFY jstests/type1.js
MODIFY mongo.xcodeproj/project.pbxproj

Repository Revision Date Author/Committer Message
server 80bd8d1... Tue Dec 22 18:19:48 UTC 2009 Aaron / Aaron SERVER-446 support multi update mode v8
Files Changed
MODIFY scripting/v8_db.cpp

Repository Revision Date Author/Committer Message
server 556a554... Tue Dec 22 18:47:03 UTC 2009 Aaron / Aaron SERVER-446 clean up whitespace when creating js function in v8 engine
Files Changed
MODIFY jstests/where2.js
MODIFY scripting/engine_v8.cpp
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 770394a... Tue Dec 22 19:39:23 UTC 2009 Aaron / Aaron SERVER-446 implement gc() in v8 engine
Files Changed
MODIFY scripting/engine_v8.cpp
MODIFY scripting/engine_v8.h

Eliot Horowitz added a comment - Dec 23 2009 03:30 PM UTC
Need to get running in a buildbot environment.

Eliot Horowitz made changes - Dec 23 2009 03:30 PM UTC
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Assignee aaron [ aaron ] Eliot Horowitz [ eliot ]
Aaron Staple added a comment - Dec 28 2009 02:45 PM UTC
Is it ok if I disable the scope cache for v8? The current scope cache implementation doesn't work well with v8's management of entered/exited contexts.

Eliot Horowitz added a comment - Dec 28 2009 03:14 PM UTC
The scope cache is a very big deal for a lot of things.

What's the problem?

For using v8 for testing it ok, but to use v8 as a spidermonkey replacement we need the caches to work.

Aaron Staple added a comment - Dec 28 2009 03:44 PM UTC
I haven't investigated the details, but v8 expects v8::Context's to be entered in a hierarchical fashion and internally maintains a stack of the active contexts. When a v8::Context is exited, v8 automatically enters the next context in its stack. When we reuse V8Scope's, we can't completely reset the v8::Context's stored within them, and v8 asserts when the ordering relationships are not as expected.

I'm sure there's some way of making this work, I just wanted to make sure it's worth the time.

I assume scope caches were implemented because creating a scope is expensive in spidermonkey. Do we know the same is expensive in v8?

Eliot Horowitz added a comment - Dec 28 2009 03:56 PM UTC
Currently its definitely expensive because it has to re-run all the js-helpers.
If we could handle that differently, then we can probable remove the cache

Aaron Staple added a comment - Dec 28 2009 04:38 PM UTC
Ok, I'm trying to make it work and I'd like to know what the semantics of a Scope reset() are. It looks like in the sm engine reset() doesn't actually do anything:

        void reset(){
            smlock;
            assert( _convertor );
            return;
            <more lines after the return;>

Is that intentional? Is it ok to leave user data sitting in a scope in my v8 implementation?

Eliot Horowitz added a comment - Dec 28 2009 04:40 PM UTC
Yes - that's fine for now.
Its really a place holder in case there are things we need to do.

Eliot Horowitz made changes - Dec 28 2009 11:23 PM UTC
Fix Version/s 1.3.1 [ 10115 ]
Fix Version/s 1.3.x [ 10090 ]
auto added a comment - Dec 29 2009 02:38 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 use v8's raii objects correctly per documentation
http://github.com/mongodb/mongo/commit/91362b9e354970f54a2acab9cf7089bf603713e1

auto added a comment - Dec 29 2009 02:38 PM UTC
Author:{'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 MINOR refactor usage of v8 raii objects
http://github.com/mongodb/mongo/commit/453aa1977ebb8a897ae803bc093fa8d09a4afe26

Aaron Staple added a comment - Dec 29 2009 02:40 PM UTC
Okay, I believe I fixed the scope reuse issues with the above commits.

Repository Revision Date Author/Committer Message
server 91362b9... Tue Dec 29 19:04:00 UTC 2009 Aaron / Aaron SERVER-446 use v8's raii objects correctly per documentation
Files Changed
MODIFY dbtests/jstests.cpp
MODIFY scripting/engine_v8.cpp
MODIFY scripting/engine_v8.h
MODIFY scripting/v8_db.h
MODIFY scripting/v8_utils.cpp

Repository Revision Date Author/Committer Message
server 453aa19... Tue Dec 29 19:13:08 UTC 2009 Aaron / Aaron SERVER-446 MINOR refactor usage of v8 raii objects
Files Changed
MODIFY scripting/engine_v8.cpp
MODIFY scripting/engine_v8.h

Eliot Horowitz made changes - Jan 15 2010 03:56 PM UTC
Fix Version/s 1.3.x [ 10090 ]
Fix Version/s 1.3.1 [ 10115 ]
Aaron Staple added a comment - Jan 21 2010 07:29 PM UTC
Would be cool to have a v8 buildbot. I tried running the js tests yesterday and saw a failure, so there's already been a regression in the last few weeks.

Eliot Horowitz made changes - Jan 21 2010 10:08 PM UTC
Link This issue depends BUILDBOT-48 [ BUILDBOT-48 ]
Eliot Horowitz added a comment - Jan 29 2010 03:12 PM UTC
now a v8 64-bit linux buildbot slave
it does not seem to pass the tests yet

Eliot Horowitz made changes - Jan 29 2010 03:12 PM UTC
Assignee Eliot Horowitz [ eliot ] aaron [ aaron ]
Repository Revision Date Author/Committer Message
server ad8292a... Mon Feb 01 23:53:34 UTC 2010 Aaron / Aaron SERVER-446 make v8 undefined/null conversion same as sm
Files Changed
MODIFY jstests/group2.js
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 56c790c... Mon Feb 01 23:59:01 UTC 2010 Aaron / Aaron SERVER-446 fix v8 regex conversion
Files Changed
MODIFY jstests/regex6.js
MODIFY mongo.xcodeproj/project.pbxproj
MODIFY scripting/v8_wrapper.cpp

Repository Revision Date Author/Committer Message
server 4018461... Tue Feb 02 00:13:33 UTC 2010 Aaron / Aaron SERVER-446 add smokeParallel target
Files Changed
MODIFY SConstruct

auto added a comment - Feb 02 2010 01:10 PM UTC
Author:{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 make v8 undefined/null conversion same as sm
http://github.com/mongodb/mongo/commit/ad8292a9f7102a9a4f048710136f297419c5ab5a

auto added a comment - Feb 02 2010 01:10 PM UTC
Author:{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 fix v8 regex conversion
http://github.com/mongodb/mongo/commit/56c790cb76ba471f152317ba962c5894b0330e7e

auto added a comment - Feb 02 2010 01:10 PM UTC
Author:{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}
Message: SERVER-446 add smokeParallel target
http://github.com/mongodb/mongo/commit/40184615d5f10e8885b9927fce4a94964ca5f58a

Aaron Staple made changes - Feb 02 2010 04:40 PM UTC
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Eliot Horowitz added a comment - Feb 07 2010 10:46 AM UTC
passes all tests and is in bb

Eliot Horowitz made changes - Feb 07 2010 10:46 AM UTC
Fix Version/s 1.3.2 [ 10117 ]
Fix Version/s 1.3.x [ 10090 ]
Eliot Horowitz made changes - Feb 12 2010 02:46 PM UTC
Status Resolved [ 5 ] Closed [ 6 ]