From 40ea061c30a9f6be21a35239341a259847f8cac5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 29 Mar 2010 01:04:53 -0700 Subject: Upgrade V8 to 2.2.0 --- deps/v8/ChangeLog | 7 +++ deps/v8/src/SConscript | 1 + deps/v8/src/bootstrapper.cc | 62 +++++++++++++++++++++++++- deps/v8/src/builtins.cc | 4 +- deps/v8/src/frame-element.h | 2 +- deps/v8/src/heap.cc | 24 +++++++++- deps/v8/src/heap.h | 5 +++ deps/v8/src/objects-inl.h | 10 +++++ deps/v8/src/objects.cc | 29 +++++++++++- deps/v8/src/objects.h | 14 ++++++ deps/v8/src/regexp.js | 26 +---------- deps/v8/src/register-allocator.h | 2 +- deps/v8/src/runtime.cc | 56 +++++++++++++++++++++++ deps/v8/src/runtime.h | 1 + deps/v8/src/type-info-inl.h | 55 ----------------------- deps/v8/src/type-info.cc | 51 +++++++++++++++++++++ deps/v8/src/type-info.h | 2 +- deps/v8/src/v8-counters.h | 1 + deps/v8/src/version.cc | 4 +- deps/v8/test/mjsunit/mirror-regexp.js | 4 +- deps/v8/test/mjsunit/regexp.js | 48 ++++++++++++++++++++ deps/v8/tools/gyp/v8.gyp | 2 +- deps/v8/tools/visual_studio/v8_base.vcproj | 2 +- deps/v8/tools/visual_studio/v8_base_arm.vcproj | 2 +- deps/v8/tools/visual_studio/v8_base_x64.vcproj | 2 +- 25 files changed, 320 insertions(+), 96 deletions(-) delete mode 100644 deps/v8/src/type-info-inl.h create mode 100644 deps/v8/src/type-info.cc (limited to 'deps') diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 0de330847..a15cce80d 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,10 @@ +2010-03-29: Version 2.2.0 + + Fixed a few minor bugs. + + Performance improvements for string operations. + + 2010-03-26: Version 2.1.10 Fixed scons build issues. diff --git a/deps/v8/src/SConscript b/deps/v8/src/SConscript index a1d4796b7..1f1c1c183 100755 --- a/deps/v8/src/SConscript +++ b/deps/v8/src/SConscript @@ -102,6 +102,7 @@ SOURCES = { stub-cache.cc token.cc top.cc + type-info.cc unicode.cc utils.cc v8-counters.cc diff --git a/deps/v8/src/bootstrapper.cc b/deps/v8/src/bootstrapper.cc index 8a9fa4bf6..82a63f0ae 100644 --- a/deps/v8/src/bootstrapper.cc +++ b/deps/v8/src/bootstrapper.cc @@ -723,8 +723,68 @@ void Genesis::InitializeGlobal(Handle inner_global, InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize, Top::initial_object_prototype(), Builtins::Illegal, true); - global_context()->set_regexp_function(*regexp_fun); + + ASSERT(regexp_fun->has_initial_map()); + Handle initial_map(regexp_fun->initial_map()); + + ASSERT_EQ(0, initial_map->inobject_properties()); + + Handle descriptors = Factory::NewDescriptorArray(5); + PropertyAttributes final = + static_cast(DONT_ENUM | DONT_DELETE | READ_ONLY); + int enum_index = 0; + { + // ECMA-262, section 15.10.7.1. + FieldDescriptor field(Heap::source_symbol(), + JSRegExp::kSourceFieldIndex, + final, + enum_index++); + descriptors->Set(0, &field); + } + { + // ECMA-262, section 15.10.7.2. + FieldDescriptor field(Heap::global_symbol(), + JSRegExp::kGlobalFieldIndex, + final, + enum_index++); + descriptors->Set(1, &field); + } + { + // ECMA-262, section 15.10.7.3. + FieldDescriptor field(Heap::ignore_case_symbol(), + JSRegExp::kIgnoreCaseFieldIndex, + final, + enum_index++); + descriptors->Set(2, &field); + } + { + // ECMA-262, section 15.10.7.4. + FieldDescriptor field(Heap::multiline_symbol(), + JSRegExp::kMultilineFieldIndex, + final, + enum_index++); + descriptors->Set(3, &field); + } + { + // ECMA-262, section 15.10.7.5. + PropertyAttributes writable = + static_cast(DONT_ENUM | DONT_DELETE); + FieldDescriptor field(Heap::last_index_symbol(), + JSRegExp::kLastIndexFieldIndex, + writable, + enum_index++); + descriptors->Set(4, &field); + } + descriptors->SetNextEnumerationIndex(enum_index); + descriptors->Sort(); + + initial_map->set_inobject_properties(5); + initial_map->set_pre_allocated_property_fields(5); + initial_map->set_unused_property_fields(0); + initial_map->set_instance_size( + initial_map->instance_size() + 5 * kPointerSize); + initial_map->set_instance_descriptors(*descriptors); } { // -- J S O N diff --git a/deps/v8/src/builtins.cc b/deps/v8/src/builtins.cc index 122fbba2c..feb912f41 100644 --- a/deps/v8/src/builtins.cc +++ b/deps/v8/src/builtins.cc @@ -495,7 +495,9 @@ BUILTIN(ArrayShift) { } if (Heap::new_space()->Contains(elms)) { - array->set_elements(LeftTrimFixedArray(elms)); + // As elms still in the same space they used to be (new space), + // there is no need to update remembered set. + array->set_elements(LeftTrimFixedArray(elms), SKIP_WRITE_BARRIER); } else { // Shift the elements. AssertNoAllocation no_gc; diff --git a/deps/v8/src/frame-element.h b/deps/v8/src/frame-element.h index 83db5c334..48bb354aa 100644 --- a/deps/v8/src/frame-element.h +++ b/deps/v8/src/frame-element.h @@ -28,7 +28,7 @@ #ifndef V8_FRAME_ELEMENT_H_ #define V8_FRAME_ELEMENT_H_ -#include "type-info-inl.h" +#include "type-info.h" #include "macro-assembler.h" #include "zone.h" diff --git a/deps/v8/src/heap.cc b/deps/v8/src/heap.cc index 1f1599a79..5421dcc19 100644 --- a/deps/v8/src/heap.cc +++ b/deps/v8/src/heap.cc @@ -1961,8 +1961,9 @@ Object* Heap::AllocateConsString(String* first, String* second) { return MakeOrFindTwoCharacterString(c1, c2); } - bool is_ascii = first->IsAsciiRepresentation() - && second->IsAsciiRepresentation(); + bool first_is_ascii = first->IsAsciiRepresentation(); + bool second_is_ascii = second->IsAsciiRepresentation(); + bool is_ascii = first_is_ascii && second_is_ascii; // Make sure that an out of memory exception is thrown if the length // of the new cons string is too large. @@ -1997,6 +1998,25 @@ Object* Heap::AllocateConsString(String* first, String* second) { for (int i = 0; i < second_length; i++) *dest++ = src[i]; return result; } else { + // For short external two-byte strings we check whether they can + // be represented using ascii. + if (!first_is_ascii) { + first_is_ascii = first->IsExternalTwoByteStringWithAsciiChars(); + } + if (first_is_ascii && !second_is_ascii) { + second_is_ascii = second->IsExternalTwoByteStringWithAsciiChars(); + } + if (first_is_ascii && second_is_ascii) { + Object* result = AllocateRawAsciiString(length); + if (result->IsFailure()) return result; + // Copy the characters into the new object. + char* dest = SeqAsciiString::cast(result)->GetChars(); + String::WriteToFlat(first, dest, 0, first_length); + String::WriteToFlat(second, dest + first_length, 0, second_length); + Counters::string_add_runtime_ext_to_ascii.Increment(); + return result; + } + Object* result = AllocateRawTwoByteString(length); if (result->IsFailure()) return result; // Copy the characters into the new object. diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h index 2a0de236e..494c99b1f 100644 --- a/deps/v8/src/heap.h +++ b/deps/v8/src/heap.h @@ -149,6 +149,11 @@ class ZoneScopeInfo; V(number_symbol, "number") \ V(Number_symbol, "Number") \ V(RegExp_symbol, "RegExp") \ + V(source_symbol, "source") \ + V(global_symbol, "global") \ + V(ignore_case_symbol, "ignoreCase") \ + V(multiline_symbol, "multiline") \ + V(last_index_symbol, "lastIndex") \ V(object_symbol, "object") \ V(prototype_symbol, "prototype") \ V(string_symbol, "string") \ diff --git a/deps/v8/src/objects-inl.h b/deps/v8/src/objects-inl.h index a26da7dd6..6d7bad751 100644 --- a/deps/v8/src/objects-inl.h +++ b/deps/v8/src/objects-inl.h @@ -255,6 +255,16 @@ bool String::IsTwoByteRepresentation() { } +bool String::IsExternalTwoByteStringWithAsciiChars() { + if (!IsExternalTwoByteString()) return false; + const uc16* data = ExternalTwoByteString::cast(this)->resource()->data(); + for (int i = 0, len = length(); i < len; i++) { + if (data[i] > kMaxAsciiCharCode) return false; + } + return true; +} + + bool StringShape::IsCons() { return (type_ & kStringRepresentationMask) == kConsStringTag; } diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index a1fbc9927..02ea5b045 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -4660,13 +4660,38 @@ bool String::IsEqualTo(Vector str) { } +template +static inline uint32_t HashSequentialString(const schar* chars, int length) { + StringHasher hasher(length); + if (!hasher.has_trivial_hash()) { + int i; + for (i = 0; hasher.is_array_index() && (i < length); i++) { + hasher.AddCharacter(chars[i]); + } + for (; i < length; i++) { + hasher.AddCharacterNoIndex(chars[i]); + } + } + return hasher.GetHashField(); +} + + uint32_t String::ComputeAndSetHash() { // Should only be called if hash code has not yet been computed. ASSERT(!(hash_field() & kHashComputedMask)); + const int len = length(); + // Compute the hash code. - StringInputBuffer buffer(this); - uint32_t field = ComputeHashField(&buffer, length()); + uint32_t field = 0; + if (StringShape(this).IsSequentialAscii()) { + field = HashSequentialString(SeqAsciiString::cast(this)->GetChars(), len); + } else if (StringShape(this).IsSequentialTwoByte()) { + field = HashSequentialString(SeqTwoByteString::cast(this)->GetChars(), len); + } else { + StringInputBuffer buffer(this); + field = ComputeHashField(&buffer, len); + } // Store the hash code in the object. set_hash_field(field); diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h index 01977f092..9197466e8 100644 --- a/deps/v8/src/objects.h +++ b/deps/v8/src/objects.h @@ -3667,6 +3667,13 @@ class JSRegExp: public JSObject { FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize; static const int kIrregexpCaptureCountOffset = FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize; + + // In-object fields. + static const int kSourceFieldIndex = 0; + static const int kGlobalFieldIndex = 1; + static const int kIgnoreCaseFieldIndex = 2; + static const int kMultilineFieldIndex = 3; + static const int kLastIndexFieldIndex = 4; }; @@ -3919,6 +3926,13 @@ class String: public HeapObject { inline bool IsAsciiRepresentation(); inline bool IsTwoByteRepresentation(); + // Check whether this string is an external two-byte string that in + // fact contains only ascii characters. + // + // Such strings may appear when the embedder prefers two-byte + // representations even for ascii data. + inline bool IsExternalTwoByteStringWithAsciiChars(); + // Get and set individual two byte chars in the string. inline void Set(int index, uint16_t value); // Get individual two byte char in the string. Repeated calls diff --git a/deps/v8/src/regexp.js b/deps/v8/src/regexp.js index dc1b0429f..cc9723c81 100644 --- a/deps/v8/src/regexp.js +++ b/deps/v8/src/regexp.js @@ -71,32 +71,10 @@ function DoConstructRegExp(object, pattern, flags, isConstructorCall) { } } - if (isConstructorCall) { - // ECMA-262, section 15.10.7.1. - %SetProperty(object, 'source', pattern, - DONT_DELETE | READ_ONLY | DONT_ENUM); - - // ECMA-262, section 15.10.7.2. - %SetProperty(object, 'global', global, DONT_DELETE | READ_ONLY | DONT_ENUM); - - // ECMA-262, section 15.10.7.3. - %SetProperty(object, 'ignoreCase', ignoreCase, - DONT_DELETE | READ_ONLY | DONT_ENUM); - - // ECMA-262, section 15.10.7.4. - %SetProperty(object, 'multiline', multiline, - DONT_DELETE | READ_ONLY | DONT_ENUM); - - // ECMA-262, section 15.10.7.5. - %SetProperty(object, 'lastIndex', 0, DONT_DELETE | DONT_ENUM); - } else { // RegExp is being recompiled via RegExp.prototype.compile. - %IgnoreAttributesAndSetProperty(object, 'source', pattern); - %IgnoreAttributesAndSetProperty(object, 'global', global); - %IgnoreAttributesAndSetProperty(object, 'ignoreCase', ignoreCase); - %IgnoreAttributesAndSetProperty(object, 'multiline', multiline); - %IgnoreAttributesAndSetProperty(object, 'lastIndex', 0); + if (!isConstructorCall) { regExpCache.type = 'none'; } + %RegExpInitializeObject(object, pattern, global, ignoreCase, multiline); // Call internal function to compile the pattern. %RegExpCompile(object, pattern, flags); diff --git a/deps/v8/src/register-allocator.h b/deps/v8/src/register-allocator.h index 0fbc83b82..456453391 100644 --- a/deps/v8/src/register-allocator.h +++ b/deps/v8/src/register-allocator.h @@ -29,7 +29,7 @@ #define V8_REGISTER_ALLOCATOR_H_ #include "macro-assembler.h" -#include "type-info-inl.h" +#include "type-info.h" #if V8_TARGET_ARCH_IA32 #include "ia32/register-allocator-ia32.h" diff --git a/deps/v8/src/runtime.cc b/deps/v8/src/runtime.cc index c77d51837..7d104fa3b 100644 --- a/deps/v8/src/runtime.cc +++ b/deps/v8/src/runtime.cc @@ -1228,6 +1228,62 @@ static Object* Runtime_RegExpExec(Arguments args) { } +static Object* Runtime_RegExpInitializeObject(Arguments args) { + AssertNoAllocation no_alloc; + ASSERT(args.length() == 5); + CONVERT_CHECKED(JSRegExp, regexp, args[0]); + CONVERT_CHECKED(String, source, args[1]); + + Object* global = args[2]; + if (!global->IsTrue()) global = Heap::false_value(); + + Object* ignoreCase = args[3]; + if (!ignoreCase->IsTrue()) ignoreCase = Heap::false_value(); + + Object* multiline = args[4]; + if (!multiline->IsTrue()) multiline = Heap::false_value(); + + Map* map = regexp->map(); + Object* constructor = map->constructor(); + if (constructor->IsJSFunction() && + JSFunction::cast(constructor)->initial_map() == map) { + // If we still have the original map, set in-object properties directly. + regexp->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, source); + // TODO(lrn): Consider skipping write barrier on booleans as well. + // Both true and false should be in oldspace at all times. + regexp->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, global); + regexp->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, ignoreCase); + regexp->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex, multiline); + regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, + Smi::FromInt(0), + SKIP_WRITE_BARRIER); + return regexp; + } + + // Map has changed, so use generic, but slower, method. + PropertyAttributes final = + static_cast(READ_ONLY | DONT_ENUM | DONT_DELETE); + PropertyAttributes writable = + static_cast(DONT_ENUM | DONT_DELETE); + regexp->IgnoreAttributesAndSetLocalProperty(Heap::source_symbol(), + source, + final); + regexp->IgnoreAttributesAndSetLocalProperty(Heap::global_symbol(), + global, + final); + regexp->IgnoreAttributesAndSetLocalProperty(Heap::ignore_case_symbol(), + ignoreCase, + final); + regexp->IgnoreAttributesAndSetLocalProperty(Heap::multiline_symbol(), + multiline, + final); + regexp->IgnoreAttributesAndSetLocalProperty(Heap::last_index_symbol(), + Smi::FromInt(0), + writable); + return regexp; +} + + static Object* Runtime_FinishArrayPrototypeSetup(Arguments args) { HandleScope scope; ASSERT(args.length() == 1); diff --git a/deps/v8/src/runtime.h b/deps/v8/src/runtime.h index 42af3df88..a55a27135 100644 --- a/deps/v8/src/runtime.h +++ b/deps/v8/src/runtime.h @@ -154,6 +154,7 @@ namespace internal { F(RegExpCompile, 3, 1) \ F(RegExpExec, 4, 1) \ F(RegExpExecMultiple, 4, 1) \ + F(RegExpInitializeObject, 5, 1) \ \ /* Strings */ \ F(StringCharCodeAt, 2, 1) \ diff --git a/deps/v8/src/type-info-inl.h b/deps/v8/src/type-info-inl.h deleted file mode 100644 index 90d3f55f9..000000000 --- a/deps/v8/src/type-info-inl.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef V8_TYPE_INFO_INL_H_ -#define V8_TYPE_INFO_INL_H_ - -#include "type-info.h" -#include "objects-inl.h" - -namespace v8 { -namespace internal { - - -TypeInfo TypeInfo::TypeFromValue(Handle value) { - TypeInfo info; - if (value->IsSmi()) { - info = TypeInfo::Smi(); - } else if (value->IsHeapNumber()) { - info = TypeInfo::IsInt32Double(HeapNumber::cast(*value)->value()) - ? TypeInfo::Integer32() - : TypeInfo::Double(); - } else { - info = TypeInfo::Unknown(); - } - return info; -} - - -} } // namespace v8::internal - -#endif // V8_TYPE_INFO_INL_H_ diff --git a/deps/v8/src/type-info.cc b/deps/v8/src/type-info.cc new file mode 100644 index 000000000..b1bde599f --- /dev/null +++ b/deps/v8/src/type-info.cc @@ -0,0 +1,51 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "v8.h" +#include "type-info.h" +#include "objects-inl.h" + +namespace v8 { +namespace internal { + + +TypeInfo TypeInfo::TypeFromValue(Handle value) { + TypeInfo info; + if (value->IsSmi()) { + info = TypeInfo::Smi(); + } else if (value->IsHeapNumber()) { + info = TypeInfo::IsInt32Double(HeapNumber::cast(*value)->value()) + ? TypeInfo::Integer32() + : TypeInfo::Double(); + } else { + info = TypeInfo::Unknown(); + } + return info; +} + + +} } // namespace v8::internal diff --git a/deps/v8/src/type-info.h b/deps/v8/src/type-info.h index 15bc12802..1d8263409 100644 --- a/deps/v8/src/type-info.h +++ b/deps/v8/src/type-info.h @@ -130,7 +130,7 @@ class TypeInfo { return false; } - static inline TypeInfo TypeFromValue(Handle value); + static TypeInfo TypeFromValue(Handle value); inline bool IsUnknown() { return type_ == kUnknownType; diff --git a/deps/v8/src/v8-counters.h b/deps/v8/src/v8-counters.h index a5f3594ca..bd671a13f 100644 --- a/deps/v8/src/v8-counters.h +++ b/deps/v8/src/v8-counters.h @@ -166,6 +166,7 @@ namespace internal { SC(generic_binary_stub_calls_regs, V8.GenericBinaryStubCallsRegs) \ SC(string_add_runtime, V8.StringAddRuntime) \ SC(string_add_native, V8.StringAddNative) \ + SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \ SC(sub_string_runtime, V8.SubStringRuntime) \ SC(sub_string_native, V8.SubStringNative) \ SC(string_compare_native, V8.StringCompareNative) \ diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index e3d088755..66e79013d 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -33,8 +33,8 @@ // NOTE these macros are used by the SCons build script so their names // cannot be changed without changing the SCons build script. #define MAJOR_VERSION 2 -#define MINOR_VERSION 1 -#define BUILD_NUMBER 10 +#define MINOR_VERSION 2 +#define BUILD_NUMBER 0 #define PATCH_LEVEL 0 #define CANDIDATE_VERSION false diff --git a/deps/v8/test/mjsunit/mirror-regexp.js b/deps/v8/test/mjsunit/mirror-regexp.js index 8c834bf38..d6a9d7102 100644 --- a/deps/v8/test/mjsunit/mirror-regexp.js +++ b/deps/v8/test/mjsunit/mirror-regexp.js @@ -70,8 +70,8 @@ function testRegExpMirror(r) { assertEquals('regexp', mirror.type()); assertFalse(mirror.isPrimitive()); for (var p in expected_attributes) { - assertEquals(mirror.property(p).attributes(), - expected_attributes[p], + assertEquals(expected_attributes[p], + mirror.property(p).attributes(), p + ' attributes'); } diff --git a/deps/v8/test/mjsunit/regexp.js b/deps/v8/test/mjsunit/regexp.js index 0a23d00ac..c8dcc6fe8 100644 --- a/deps/v8/test/mjsunit/regexp.js +++ b/deps/v8/test/mjsunit/regexp.js @@ -388,3 +388,51 @@ try { assertTrue(String(e).indexOf("Stack overflow") >= 0, "overflow"); } + +// Test that compile works on modified objects +var re = /re+/; +assertEquals("re+", re.source); +assertFalse(re.global); +assertFalse(re.ignoreCase); +assertFalse(re.multiline); +assertEquals(0, re.lastIndex); + +re.compile("ro+", "gim"); +assertEquals("ro+", re.source); +assertTrue(re.global); +assertTrue(re.ignoreCase); +assertTrue(re.multiline); +assertEquals(0, re.lastIndex); + +re.lastIndex = 42; +re.someOtherProperty = 42; +re.someDeletableProperty = 42; +re[37] = 37; +re[42] = 42; + +re.compile("ra+", "i"); +assertEquals("ra+", re.source); +assertFalse(re.global); +assertTrue(re.ignoreCase); +assertFalse(re.multiline); +assertEquals(0, re.lastIndex); + +assertEquals(42, re.someOtherProperty); +assertEquals(42, re.someDeletableProperty); +assertEquals(37, re[37]); +assertEquals(42, re[42]); + +re.lastIndex = -1; +re.someOtherProperty = 37; +re[42] = 37; +assertTrue(delete re[37]); +assertTrue(delete re.someDeletableProperty); +re.compile("ri+", "gm"); + +assertEquals("ri+", re.source); +assertTrue(re.global); +assertFalse(re.ignoreCase); +assertTrue(re.multiline); +assertEquals(0, re.lastIndex); +assertEquals(37, re.someOtherProperty); +assertEquals(37, re[42]); diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index d5bb0cb76..7d0e69952 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -388,7 +388,7 @@ '../../src/token.h', '../../src/top.cc', '../../src/top.h', - '../../src/type-info-inl.h', + '../../src/type-info.cc', '../../src/type-info.h', '../../src/unicode-inl.h', '../../src/unicode.cc', diff --git a/deps/v8/tools/visual_studio/v8_base.vcproj b/deps/v8/tools/visual_studio/v8_base.vcproj index 58bf92f8f..5fa08f703 100644 --- a/deps/v8/tools/visual_studio/v8_base.vcproj +++ b/deps/v8/tools/visual_studio/v8_base.vcproj @@ -945,7 +945,7 @@ >