diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-30 17:14:55 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-30 17:14:55 +0200 |
commit | 2fc47ab10bdbcfb39521d04cf5417520e0035163 (patch) | |
tree | 037359365f08c7ba1a7c3f3e5a4e8867b441553d | |
parent | b8c04b921b626edd4201f805d0feb384c8e91ea7 (diff) | |
download | node-new-2fc47ab10bdbcfb39521d04cf5417520e0035163.tar.gz |
v8: upgrade v8 to 3.20.11
210 files changed, 12282 insertions, 1656 deletions
diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index a4c486f9cf..2f524bed03 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -59,3 +59,4 @@ GTAGS GRTAGS GSYMS GPATH +/_* diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 7d00fb70f6..567afd290c 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,13 @@ +2013-07-30: Version 3.20.11 + + Performance and stability improvements on all platforms. + + +2013-07-29: Version 3.20.10 + + Performance and stability improvements on all platforms. + + 2013-07-26: Version 3.20.9 Check that ExternalString objects get aligned resources. diff --git a/deps/v8/build/toolchain.gypi b/deps/v8/build/toolchain.gypi index 95e2cd2ef5..36d60c28ab 100644 --- a/deps/v8/build/toolchain.gypi +++ b/deps/v8/build/toolchain.gypi @@ -60,7 +60,19 @@ 'v8_enable_backtrace%': 0, - # Turns on compiler optimizations in Debug builds (#defines are unaffected). + # Speeds up Debug builds: + # 0 - compiler optimizations off (debuggable) (default). This may + # be 5x slower than Release (or worse). + # 1 - turn on compiler optimizations. and #undef DEBUG/#define NDEBUG. + # This may be hard or impossible to debug. This may still be + # 2x slower than Release (or worse). + # 2 - Turn on optimizations, and also #undef DEBUG / #define NDEBUG + # (but leave V8_ENABLE_CHECKS and most other assertions enabled. + # This may cause some v8 tests to fail in the Debug configuration. + # This roughly matches the performance of a Release build and can + # be used by embedders that need to build their own code as debug + # but don't want or need a debug version of V8. This should produce + # near-release speeds. 'v8_optimized_debug%': 0, # Enable profiling support. Only required on Windows. @@ -435,7 +447,6 @@ 'configurations': { 'Debug': { 'defines': [ - 'DEBUG', 'ENABLE_DISASSEMBLER', 'V8_ENABLE_CHECKS', 'OBJECT_PRINT', @@ -449,41 +460,96 @@ }, { 'RuntimeLibrary': '1', # /MTd }], - ['v8_optimized_debug==1', { - 'Optimization': '1', + ['v8_optimized_debug==0', { + 'Optimization': '0', + }, { + 'Optimization': '2', 'InlineFunctionExpansion': '2', 'EnableIntrinsicFunctions': 'true', 'FavorSizeOrSpeed': '0', 'StringPooling': 'true', 'BasicRuntimeChecks': '0', - }, { - 'Optimization': '0', + 'conditions': [ + ['component=="shared_library"', { + 'RuntimeLibrary': '2', #/MD + }, { + 'RuntimeLibrary': '0', #/MT + }], + ['v8_target_arch=="x64"', { + # TODO(2207): remove this option once the bug is fixed. + 'WholeProgramOptimization': 'true', + }], + ], }], ], }, 'VCLinkerTool': { - 'LinkIncremental': '2', + 'conditions': [ + ['v8_optimized_debug==0', { + 'LinkIncremental': '2', + }, { + 'LinkIncremental': '1', + 'OptimizeReferences': '2', + 'EnableCOMDATFolding': '2', + }], + ], }, }, 'conditions': [ + ['v8_optimized_debug==2', { + 'defines': [ + 'NDEBUG', + ], + }, { + 'defines': [ + 'DEBUG', + ], + }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '<(wno_array_bounds)' ], 'conditions': [ + ['v8_optimized_debug==0', { + 'cflags!': [ + '-O0', + '-O3', + '-O2', + '-O1', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + ], + }], ['v8_optimized_debug==1', { 'cflags!': [ '-O0', + '-O3', # TODO(2807) should be -O1. '-O2', '-Os', ], 'cflags': [ '-fdata-sections', '-ffunction-sections', + '-O1', # TODO(2807) should be -O3. + ], + }], + ['v8_optimized_debug==2', { + 'cflags!': [ + '-O0', '-O1', + '-O2', + '-Os', + ], + 'cflags': [ + '-fdata-sections', + '-ffunction-sections', + '-O3', ], }], - ['v8_optimized_debug==1 and gcc_version==44 and clang==0', { + ['v8_optimized_debug!=0 and gcc_version==44 and clang==0', { 'cflags': [ # Avoid crashes with gcc 4.4 in the v8 test suite. '-fno-tree-vrp', @@ -512,11 +578,11 @@ ['OS=="mac"', { 'xcode_settings': { 'conditions': [ - ['v8_optimized_debug==1', { - 'GCC_OPTIMIZATION_LEVEL': '1', # -O1 - 'GCC_STRICT_ALIASING': 'YES', - }, { + ['v8_optimized_debug==0', { 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 + }, { + 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 + 'GCC_STRICT_ALIASING': 'YES', }], ], }, diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 36077402a2..eb166ab68d 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -2719,11 +2719,15 @@ class V8EXPORT Date : public Object { public: static Local<Value> New(double time); + // Deprecated, use Date::ValueOf() instead. + // TODO(svenpanne) Actually deprecate when Chrome is adapted. + double NumberValue() const { return ValueOf(); } + /** * A specialization of Value::NumberValue that is more efficient * because we know the structure of this object. */ - double NumberValue() const; + double ValueOf() const; V8_INLINE(static Date* Cast(v8::Value* obj)); @@ -2753,10 +2757,14 @@ class V8EXPORT NumberObject : public Object { public: static Local<Value> New(double value); + // Deprecated, use NumberObject::ValueOf() instead. + // TODO(svenpanne) Actually deprecate when Chrome is adapted. + double NumberValue() const { return ValueOf(); } + /** * Returns the Number held by the object. */ - double NumberValue() const; + double ValueOf() const; V8_INLINE(static NumberObject* Cast(v8::Value* obj)); @@ -2772,10 +2780,14 @@ class V8EXPORT BooleanObject : public Object { public: static Local<Value> New(bool value); + // Deprecated, use BooleanObject::ValueOf() instead. + // TODO(svenpanne) Actually deprecate when Chrome is adapted. + bool BooleanValue() const { return ValueOf(); } + /** * Returns the Boolean held by the object. */ - bool BooleanValue() const; + bool ValueOf() const; V8_INLINE(static BooleanObject* Cast(v8::Value* obj)); @@ -2791,10 +2803,14 @@ class V8EXPORT StringObject : public Object { public: static Local<Value> New(Handle<String> value); + // Deprecated, use StringObject::ValueOf() instead. + // TODO(svenpanne) Actually deprecate when Chrome is adapted. + Local<String> StringValue() const { return ValueOf(); } + /** * Returns the String held by the object. */ - Local<String> StringValue() const; + Local<String> ValueOf() const; V8_INLINE(static StringObject* Cast(v8::Value* obj)); @@ -2812,10 +2828,14 @@ class V8EXPORT SymbolObject : public Object { public: static Local<Value> New(Isolate* isolate, Handle<Symbol> value); + // Deprecated, use SymbolObject::ValueOf() instead. + // TODO(svenpanne) Actually deprecate when Chrome is adapted. + Local<Symbol> SymbolValue() const { return ValueOf(); } + /** * Returns the Symbol held by the object. */ - Local<Symbol> SymbolValue() const; + Local<Symbol> ValueOf() const; V8_INLINE(static SymbolObject* Cast(v8::Value* obj)); diff --git a/deps/v8/src/accessors.cc b/deps/v8/src/accessors.cc index 51db3615c3..a43eb78b87 100644 --- a/deps/v8/src/accessors.cc +++ b/deps/v8/src/accessors.cc @@ -292,7 +292,7 @@ const AccessorDescriptor Accessors::ScriptType = { MaybeObject* Accessors::ScriptGetCompilationType(Object* object, void*) { Object* script = JSValue::cast(object)->value(); - return Script::cast(script)->compilation_type(); + return Smi::FromInt(Script::cast(script)->compilation_type()); } @@ -388,8 +388,7 @@ MaybeObject* Accessors::ScriptGetEvalFromScriptPosition(Object* object, void*) { Handle<Script> script(raw_script); // If this is not a script compiled through eval there is no eval position. - int compilation_type = Smi::cast(script->compilation_type())->value(); - if (compilation_type != Script::COMPILATION_TYPE_EVAL) { + if (script->compilation_type() != Script::COMPILATION_TYPE_EVAL) { return script->GetHeap()->undefined_value(); } diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 91174d69e9..d587b81fd3 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -770,6 +770,7 @@ void Context::Exit() { i::Context* last_context = isolate->handle_scope_implementer()->RestoreContext(); isolate->set_context(last_context); + isolate->set_context_exit_happened(true); } @@ -779,8 +780,8 @@ static void* DecodeSmiToAligned(i::Object* value, const char* location) { } -static i::Smi* EncodeAlignedAsSmi(const void* value, const char* location) { - i::Smi* smi = const_cast<i::Smi*>(reinterpret_cast<const i::Smi*>(value)); +static i::Smi* EncodeAlignedAsSmi(void* value, const char* location) { + i::Smi* smi = reinterpret_cast<i::Smi*>(value); ApiCheck(smi->IsSmi(), location, "Pointer is not aligned"); return smi; } @@ -5930,6 +5931,23 @@ i::Handle<i::String> NewExternalAsciiStringHandle(i::Isolate* isolate, } +bool RedirectToExternalString(i::Isolate* isolate, + i::Handle<i::String> parent, + i::Handle<i::String> external) { + if (parent->IsConsString()) { + i::Handle<i::ConsString> cons = i::Handle<i::ConsString>::cast(parent); + cons->set_first(*external); + cons->set_second(isolate->heap()->empty_string()); + } else { + ASSERT(parent->IsSlicedString()); + i::Handle<i::SlicedString> slice = i::Handle<i::SlicedString>::cast(parent); + slice->set_parent(*external); + slice->set_offset(0); + } + return true; +} + + Local<String> v8::String::NewExternal( v8::String::ExternalStringResource* resource) { i::Isolate* isolate = i::Isolate::Current(); @@ -5937,10 +5955,6 @@ Local<String> v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); CHECK(resource && resource->data()); - // Resource pointers need to look like Smis since ExternalString objects - // are sometimes put into old pointer space (see i::String::MakeExternal). - CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()")); - CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()")); i::Handle<i::String> result = NewExternalStringHandle(isolate, resource); isolate->heap()->external_string_table()->AddString(*result); return Utils::ToLocal(result); @@ -5962,13 +5976,23 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { return false; } CHECK(resource && resource->data()); - // Resource pointers need to look like Smis since ExternalString objects - // are sometimes put into old pointer space (see i::String::MakeExternal). - CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()")); - CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()")); - bool result = obj->MakeExternal(resource); - if (result && !obj->IsInternalizedString()) { - isolate->heap()->external_string_table()->AddString(*obj); + + bool result; + i::Handle<i::String> external; + if (isolate->heap()->old_pointer_space()->Contains(*obj)) { + // We do not allow external strings in the old pointer space. Instead of + // converting the string in-place, we keep the cons/sliced string and + // point it to a newly-allocated external string. + external = NewExternalStringHandle(isolate, resource); + result = RedirectToExternalString(isolate, obj, external); + } else { + result = obj->MakeExternal(resource); + external = obj; + } + + ASSERT(external->IsExternalString()); + if (result && !external->IsInternalizedString()) { + isolate->heap()->external_string_table()->AddString(*external); } return result; } @@ -5981,10 +6005,6 @@ Local<String> v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); CHECK(resource && resource->data()); - // Resource pointers need to look like Smis since ExternalString objects - // are sometimes put into old pointer space (see i::String::MakeExternal). - CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()")); - CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()")); i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource); isolate->heap()->external_string_table()->AddString(*result); return Utils::ToLocal(result); @@ -6007,13 +6027,23 @@ bool v8::String::MakeExternal( return false; } CHECK(resource && resource->data()); - // Resource pointers need to look like Smis since ExternalString objects - // are sometimes put into old pointer space (see i::String::MakeExternal). - CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()")); - CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()")); - bool result = obj->MakeExternal(resource); - if (result && !obj->IsInternalizedString()) { - isolate->heap()->external_string_table()->AddString(*obj); + + bool result; + i::Handle<i::String> external; + if (isolate->heap()->old_pointer_space()->Contains(*obj)) { + // We do not allow external strings in the old pointer space. Instead of + // converting the string in-place, we keep the cons/sliced string and + // point it to a newly-allocated external string. + external = NewExternalAsciiStringHandle(isolate, resource); + result = RedirectToExternalString(isolate, obj, external); + } else { + result = obj->MakeExternal(resource); + external = obj; + } + + ASSERT(external->IsExternalString()); + if (result && !external->IsInternalizedString()) { + isolate->heap()->external_string_table()->AddString(*external); } return result; } @@ -6054,7 +6084,7 @@ Local<v8::Value> v8::NumberObject::New(double value) { } -double v8::NumberObject::NumberValue() const { +double v8::NumberObject::ValueOf() const { i::Isolate* isolate = i::Isolate::Current(); if (IsDeadCheck(isolate, "v8::NumberObject::NumberValue()")) return 0; LOG_API(isolate, "NumberObject::NumberValue"); @@ -6078,7 +6108,7 @@ Local<v8::Value> v8::BooleanObject::New(bool value) { } -bool v8::BooleanObject::BooleanValue() const { +bool v8::BooleanObject::ValueOf() const { i::Isolate* isolate = i::Isolate::Current(); if (IsDeadCheck(isolate, "v8::BooleanObject::BooleanValue()")) return 0; LOG_API(isolate, "BooleanObject::BooleanValue"); @@ -6099,7 +6129,7 @@ Local<v8::Value> v8::StringObject::New(Handle<String> value) { } -Local<v8::String> v8::StringObject::StringValue() const { +Local<v8::String> v8::StringObject::ValueOf() const { i::Isolate* isolate = i::Isolate::Current(); if (IsDeadCheck(isolate, "v8::StringObject::StringValue()")) { return Local<v8::String>(); @@ -6123,7 +6153,7 @@ Local<v8::Value> v8::SymbolObject::New(Isolate* isolate, Handle<Symbol> value) { } -Local<v8::Symbol> v8::SymbolObject::SymbolValue() const { +Local<v8::Symbol> v8::SymbolObject::ValueOf() const { i::Isolate* isolate = i::Isolate::Current(); if (IsDeadCheck(isolate, "v8::SymbolObject::SymbolValue()")) return Local<v8::Symbol>(); @@ -6152,7 +6182,7 @@ Local<v8::Value> v8::Date::New(double time) { } -double v8::Date::NumberValue() const { +double v8::Date::ValueOf() const { i::Isolate* isolate = i::Isolate::Current(); if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0; LOG_API(isolate, "Date::NumberValue"); diff --git a/deps/v8/src/arm/ic-arm.cc b/deps/v8/src/arm/ic-arm.cc index f43846ce58..511a3c74f2 100644 --- a/deps/v8/src/arm/ic-arm.cc +++ b/deps/v8/src/arm/ic-arm.cc @@ -1221,51 +1221,6 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { } -void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { - // ---------- S t a t e -------------- - // -- r2 : receiver - // -- r3 : target map - // -- lr : return address - // ----------------------------------- - // Must return the modified receiver in r0. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, - FAST_DOUBLE_ELEMENTS); - ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); - __ mov(r0, r2); - __ Ret(); - __ bind(&fail); - } - - __ push(r2); - __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); -} - - -void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( - MacroAssembler* masm) { - // ---------- S t a t e -------------- - // -- r2 : receiver - // -- r3 : target map - // -- lr : return address - // ----------------------------------- - // Must return the modified receiver in r0. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, - FAST_ELEMENTS); - ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); - __ mov(r0, r2); - __ Ret(); - __ bind(&fail); - } - - __ push(r2); - __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); -} - - void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, StrictModeFlag strict_mode) { // ---------- S t a t e -------------- diff --git a/deps/v8/src/arm/lithium-arm.cc b/deps/v8/src/arm/lithium-arm.cc index 00001460d9..b55679ee01 100644 --- a/deps/v8/src/arm/lithium-arm.cc +++ b/deps/v8/src/arm/lithium-arm.cc @@ -708,9 +708,9 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { LInstruction* LChunkBuilder::DoShift(Token::Value op, HBitwiseBinaryOperation* instr) { - if (instr->representation().IsSmiOrTagged()) { - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + if (instr->representation().IsTagged()) { + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), r1); LOperand* right = UseFixed(instr->right(), r0); @@ -718,25 +718,35 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, return MarkAsCall(DefineFixed(result, r0), instr); } - ASSERT(instr->representation().IsInteger32()); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->representation().IsSmiOrInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); HValue* right_value = instr->right(); LOperand* right = NULL; int constant_value = 0; + bool does_deopt = false; if (right_value->IsConstant()) { HConstant* constant = HConstant::cast(right_value); right = chunk_->DefineConstantOperand(constant); constant_value = constant->Integer32Value() & 0x1f; + // Left shifts can deoptimize if we shift by > 0 and the result cannot be + // truncated to smi. + if (instr->representation().IsSmi() && constant_value > 0) { + for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { + if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { + does_deopt = true; + break; + } + } + } } else { right = UseRegisterAtStart(right_value); } // Shift operations can only deoptimize if we do a logical shift // by 0 and the result cannot be truncated to int32. - bool does_deopt = false; if (op == Token::SHR && constant_value == 0) { if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); @@ -2085,6 +2095,8 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { return DefineAsRegister(new(zone()) LConstantI); } else if (r.IsDouble()) { return DefineAsRegister(new(zone()) LConstantD); + } else if (r.IsExternal()) { + return DefineAsRegister(new(zone()) LConstantE); } else if (r.IsTagged()) { return DefineAsRegister(new(zone()) LConstantT); } else { @@ -2312,21 +2324,12 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind( if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { LOperand* new_map_reg = TempRegister(); LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); + new(zone()) LTransitionElementsKind(object, new_map_reg); return result; - } else if (FLAG_compiled_transitions) { - LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, NULL, NULL); - return AssignPointerMap(result); } else { - LOperand* object = UseFixed(instr->object(), r0); - LOperand* fixed_object_reg = FixedTemp(r2); - LOperand* new_map_reg = FixedTemp(r3); LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, - new_map_reg, - fixed_object_reg); - return MarkAsCall(result, instr); + new(zone()) LTransitionElementsKind(object, NULL); + return AssignPointerMap(result); } } diff --git a/deps/v8/src/arm/lithium-arm.h b/deps/v8/src/arm/lithium-arm.h index 6faa7813d2..eecacec1a8 100644 --- a/deps/v8/src/arm/lithium-arm.h +++ b/deps/v8/src/arm/lithium-arm.h @@ -79,6 +79,7 @@ class LCodeGen; V(CmpMapAndBranch) \ V(CmpT) \ V(ConstantD) \ + V(ConstantE) \ V(ConstantI) \ V(ConstantS) \ V(ConstantT) \ @@ -268,7 +269,7 @@ class LInstruction: public ZoneObject { bool IsMarkedAsCall() const { return is_call_; } virtual bool HasResult() const = 0; - virtual LOperand* result() = 0; + virtual LOperand* result() const = 0; LOperand* FirstInput() { return InputAt(0); } LOperand* Output() { return HasResult() ? result() : NULL; } @@ -304,9 +305,9 @@ class LTemplateInstruction: public LInstruction { public: // Allow 0 or 1 output operands. STATIC_ASSERT(R == 0 || R == 1); - virtual bool HasResult() const { return R != 0; } + virtual bool HasResult() const { return R != 0 && result() != NULL; } void set_result(LOperand* operand) { results_[0] = operand; } - LOperand* result() { return results_[0]; } + LOperand* result() const { return results_[0]; } protected: EmbeddedContainer<LOperand*, R> results_; @@ -1232,6 +1233,17 @@ class LConstantD: public LTemplateInstruction<1, 0, 0> { }; +class LConstantE: public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") + DECLARE_HYDROGEN_ACCESSOR(Constant) + + ExternalReference value() const { + return hydrogen()->ExternalReferenceValue(); + } +}; + + class LConstantT: public LTemplateInstruction<1, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") @@ -2236,19 +2248,16 @@ class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { }; -class LTransitionElementsKind: public LTemplateInstruction<0, 1, 2> { +class LTransitionElementsKind: public LTemplateInstruction<0, 1, 1> { public: LTransitionElementsKind(LOperand* object, - LOperand* new_map_temp, - LOperand* fixed_object_temp) { + LOperand* new_map_temp) { inputs_[0] = object; temps_[0] = new_map_temp; - temps_[1] = fixed_object_temp; } LOperand* object() { return inputs_[0]; } LOperand* new_map_temp() { return temps_[0]; } - LOperand* temp() { return temps_[1]; } DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, "transition-elements-kind") diff --git a/deps/v8/src/arm/lithium-codegen-arm.cc b/deps/v8/src/arm/lithium-codegen-arm.cc index 41636a8171..929d04de13 100644 --- a/deps/v8/src/arm/lithium-codegen-arm.cc +++ b/deps/v8/src/arm/lithium-codegen-arm.cc @@ -1742,7 +1742,14 @@ void LCodeGen::DoShiftI(LShiftI* instr) { break; case Token::SHL: if (shift_count != 0) { - __ mov(result, Operand(left, LSL, shift_count)); + if (instr->hydrogen_value()->representation().IsSmi() && + instr->can_deopt()) { + __ mov(result, Operand(left, LSL, shift_count - 1)); + __ SmiTag(result, result, SetCC); + DeoptimizeIf(vs, instr->environment()); + } else { + __ mov(result, Operand(left, LSL, shift_count)); + } } else { __ Move(result, left); } @@ -1815,6 +1822,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { } +void LCodeGen::DoConstantE(LConstantE* instr) { + __ mov(ToRegister(instr->result()), Operand(instr->value())); +} + + void LCodeGen::DoConstantT(LConstantT* instr) { Handle<Object> value = instr->value(); AllowDeferredHandleDereference smi_check; @@ -2995,6 +3007,13 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); Register object = ToRegister(instr->object()); + + if (access.IsExternalMemory()) { + Register result = ToRegister(instr->result()); + __ ldr(result, MemOperand(object, offset)); + return; + } + if (instr->hydrogen()->representation().IsDouble()) { DwVfpRegister result = ToDoubleRegister(instr->result()); __ vldr(result, FieldMemOperand(object, offset)); @@ -4174,10 +4193,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { Register object = ToRegister(instr->object()); Register scratch = scratch0(); - HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + if (access.IsExternalMemory()) { + Register value = ToRegister(instr->value()); + __ str(value, MemOperand(object, offset)); + return; + } + Handle<Map> transition = instr->transition(); if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { @@ -4500,7 +4524,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { // Write barrier. __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, scratch, GetLinkRegisterState(), kDontSaveFPRegs); - } else if (FLAG_compiled_transitions) { + } else { PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); __ Move(r0, object_reg); __ Move(r1, to_map); @@ -4508,28 +4532,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ CallStub(&stub); RecordSafepointWithRegisters( instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); - } else if (IsFastSmiElementsKind(from_kind) && - IsFastDoubleElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(r2)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(r3)); - __ mov(new_map_reg, Operand(to_map)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), - RelocInfo::CODE_TARGET, instr); - } else if (IsFastDoubleElementsKind(from_kind) && - IsFastObjectElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(r2)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(r3)); - __ mov(new_map_reg, Operand(to_map)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), - RelocInfo::CODE_TARGET, instr); - } else { - UNREACHABLE(); } __ bind(¬_applicable); } diff --git a/deps/v8/src/assembler.h b/deps/v8/src/assembler.h index 481add56b8..d70d5aa928 100644 --- a/deps/v8/src/assembler.h +++ b/deps/v8/src/assembler.h @@ -684,6 +684,8 @@ class ExternalReference BASE_EMBEDDED { typedef void* ExternalReferenceRedirector(void* original, Type type); + ExternalReference() : address_(NULL) {} + ExternalReference(Builtins::CFunctionId id, Isolate* isolate); ExternalReference(ApiFunction* ptr, Type type, Isolate* isolate); @@ -829,7 +831,7 @@ class ExternalReference BASE_EMBEDDED { static ExternalReference cpu_features(); - Address address() const {return reinterpret_cast<Address>(address_);} + Address address() const { return reinterpret_cast<Address>(address_); } #ifdef ENABLE_DEBUGGER_SUPPORT // Function Debug::Break() @@ -868,6 +870,14 @@ class ExternalReference BASE_EMBEDDED { static ExternalReference stress_deopt_count(Isolate* isolate); + bool operator==(const ExternalReference& other) const { + return address_ == other.address_; + } + + bool operator!=(const ExternalReference& other) const { + return !(*this == other); + } + private: explicit ExternalReference(void* address) : address_(address) {} diff --git a/deps/v8/src/builtins.cc b/deps/v8/src/builtins.cc index eaba839aa4..4a5cd03b6f 100644 --- a/deps/v8/src/builtins.cc +++ b/deps/v8/src/builtins.cc @@ -1551,15 +1551,6 @@ static void Generate_KeyedStoreIC_NonStrictArguments(MacroAssembler* masm) { } -static void Generate_TransitionElementsSmiToDouble(MacroAssembler* masm) { - KeyedStoreIC::GenerateTransitionElementsSmiToDouble(masm); -} - - -static void Generate_TransitionElementsDoubleToObject(MacroAssembler* masm) { - KeyedStoreIC::GenerateTransitionElementsDoubleToObject(masm); -} - #ifdef ENABLE_DEBUGGER_SUPPORT static void Generate_LoadIC_DebugBreak(MacroAssembler* masm) { Debug::GenerateLoadICDebugBreak(masm); diff --git a/deps/v8/src/builtins.h b/deps/v8/src/builtins.h index edf650df2e..73a2e96459 100644 --- a/deps/v8/src/builtins.h +++ b/deps/v8/src/builtins.h @@ -194,10 +194,6 @@ enum BuiltinExtraArguments { kStrictMode) \ V(KeyedStoreIC_NonStrictArguments, KEYED_STORE_IC, MONOMORPHIC, \ Code::kNoExtraICState) \ - V(TransitionElementsSmiToDouble, BUILTIN, UNINITIALIZED, \ - Code::kNoExtraICState) \ - V(TransitionElementsDoubleToObject, BUILTIN, UNINITIALIZED, \ - Code::kNoExtraICState) \ \ /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ V(FunctionCall, BUILTIN, UNINITIALIZED, \ diff --git a/deps/v8/src/checks.h b/deps/v8/src/checks.h index b309e2c42c..1feecf3a92 100644 --- a/deps/v8/src/checks.h +++ b/deps/v8/src/checks.h @@ -30,6 +30,8 @@ #include <string.h> +#include "globals.h" + #include "../include/v8stdint.h" extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); @@ -232,7 +234,7 @@ inline void CheckNonEqualsHelper(const char* file, // Use C++11 static_assert if possible, which gives error // messages that are easier to understand on first sight. -#if __cplusplus >= 201103L +#if V8_CXX_STATIC_ASSERT #define STATIC_CHECK(test) static_assert(test, #test) #else // This is inspired by the static assertion facility in boost. This @@ -254,7 +256,7 @@ template <int> class StaticAssertionHelper { }; typedef \ StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) -#endif +#endif // V8_CXX_STATIC_ASSERT extern bool FLAG_enable_slow_asserts; diff --git a/deps/v8/src/code-stubs.cc b/deps/v8/src/code-stubs.cc index 9d40ad04d1..5f6616ea07 100644 --- a/deps/v8/src/code-stubs.cc +++ b/deps/v8/src/code-stubs.cc @@ -818,44 +818,6 @@ bool ToBooleanStub::Types::CanBeUndetectable() const { } -void ElementsTransitionAndStorePlatformStub::Generate(MacroAssembler* masm) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(from_, to_); - ASSERT(!IsFastHoleyElementsKind(from_) || IsFastHoleyElementsKind(to_)); - if (!FLAG_trace_elements_transitions) { - if (IsFastSmiOrObjectElementsKind(to_)) { - if (IsFastSmiOrObjectElementsKind(from_)) { - ElementsTransitionGenerator:: - GenerateMapChangeElementsTransition(masm, mode, &fail); - } else if (IsFastDoubleElementsKind(from_)) { - ASSERT(!IsFastSmiElementsKind(to_)); - ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); - } else { - UNREACHABLE(); - } - KeyedStoreStubCompiler::GenerateStoreFastElement(masm, - is_jsarray_, - to_, - store_mode_); - } else if (IsFastSmiElementsKind(from_) && - IsFastDoubleElementsKind(to_)) { - ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); - KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, - is_jsarray_, - store_mode_); - } else if (IsFastDoubleElementsKind(from_)) { - ASSERT(to_ == FAST_HOLEY_DOUBLE_ELEMENTS); - ElementsTransitionGenerator:: - GenerateMapChangeElementsTransition(masm, mode, &fail); - } else { - UNREACHABLE(); - } - } - masm->bind(&fail); - KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); -} - - void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); diff --git a/deps/v8/src/code-stubs.h b/deps/v8/src/code-stubs.h index bc581d837d..84d9b023b3 100644 --- a/deps/v8/src/code-stubs.h +++ b/deps/v8/src/code-stubs.h @@ -2310,48 +2310,6 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub { }; -// TODO(bmeurer) Remove this when compiled transitions is enabled -class ElementsTransitionAndStorePlatformStub : public PlatformCodeStub { - public: - ElementsTransitionAndStorePlatformStub(ElementsKind from, - ElementsKind to, - bool is_jsarray, - StrictModeFlag strict_mode, - KeyedAccessStoreMode store_mode) - : from_(from), - to_(to), - is_jsarray_(is_jsarray), - strict_mode_(strict_mode), - store_mode_(store_mode) {} - - private: - class FromBits: public BitField<ElementsKind, 0, 8> {}; - class ToBits: public BitField<ElementsKind, 8, 8> {}; - class IsJSArrayBits: public BitField<bool, 16, 1> {}; - class StrictModeBits: public BitField<StrictModeFlag, 17, 1> {}; - class StoreModeBits: public BitField<KeyedAccessStoreMode, 18, 4> {}; - - Major MajorKey() { return ElementsTransitionAndStore; } - int MinorKey() { - return FromBits::encode(from_) | - ToBits::encode(to_) | - IsJSArrayBits::encode(is_jsarray_) | - StrictModeBits::encode(strict_mode_) | - StoreModeBits::encode(store_mode_); - } - - void Generate(MacroAssembler* masm); - - ElementsKind from_; - ElementsKind to_; - bool is_jsarray_; - StrictModeFlag strict_mode_; - KeyedAccessStoreMode store_mode_; - - DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStorePlatformStub); -}; - - class StoreArrayLiteralElementStub : public PlatformCodeStub { public: StoreArrayLiteralElementStub() diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index ebd126659b..4cac73f7b6 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -558,8 +558,7 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { #ifdef ENABLE_DEBUGGER_SUPPORT if (info->is_eval()) { - Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL; - script->set_compilation_type(Smi::FromInt(compilation_type)); + script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); // For eval scripts add information on the function from which eval was // called. if (info->is_eval()) { @@ -650,8 +649,7 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) { // the instances of the function. SetExpectedNofPropertiesFromEstimate(result, lit->expected_property_count()); - script->set_compilation_state( - Smi::FromInt(Script::COMPILATION_STATE_COMPILED)); + script->set_compilation_state(Script::COMPILATION_STATE_COMPILED); #ifdef ENABLE_DEBUGGER_SUPPORT // Notify debugger @@ -969,9 +967,7 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) { if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { if (FLAG_trace_parallel_recompilation) { - PrintF(" ** Compilation queue full, will retry optimizing "); - closure->PrintName(); - PrintF(" on next run.\n"); + PrintF(" ** Compilation queue, will retry opting on next run.\n"); } return; } diff --git a/deps/v8/src/cpu-profiler-inl.h b/deps/v8/src/cpu-profiler-inl.h index bafea0679f..868ec64fd6 100644 --- a/deps/v8/src/cpu-profiler-inl.h +++ b/deps/v8/src/cpu-profiler-inl.h @@ -68,7 +68,6 @@ void ReportBuiltinEventRecord::UpdateCodeMap(CodeMap* code_map) { TickSample* ProfilerEventsProcessor::TickSampleEvent() { - generator_->Tick(); TickSampleEventRecord* evt = new(ticks_buffer_.Enqueue()) TickSampleEventRecord(last_code_event_id_); return &evt->sample; diff --git a/deps/v8/src/cpu-profiler.cc b/deps/v8/src/cpu-profiler.cc index 0d226cfb3f..0a83b85f50 100644 --- a/deps/v8/src/cpu-profiler.cc +++ b/deps/v8/src/cpu-profiler.cc @@ -452,9 +452,8 @@ void CpuProfiler::StartProcessorIfNotStarted() { CpuProfile* CpuProfiler::StopProfiling(const char* title) { if (!is_profiling_) return NULL; - const double actual_sampling_rate = generator_->actual_sampling_rate(); StopProcessorIfLastProfile(title); - CpuProfile* result = profiles_->StopProfiling(title, actual_sampling_rate); + CpuProfile* result = profiles_->StopProfiling(title); if (result != NULL) { result->Print(); } @@ -464,10 +463,9 @@ CpuProfile* CpuProfiler::StopProfiling(const char* title) { CpuProfile* CpuProfiler::StopProfiling(String* title) { if (!is_profiling_) return NULL; - const double actual_sampling_rate = generator_->actual_sampling_rate(); const char* profile_title = profiles_->GetName(title); StopProcessorIfLastProfile(profile_title); - return profiles_->StopProfiling(profile_title, actual_sampling_rate); + return profiles_->StopProfiling(profile_title); } diff --git a/deps/v8/src/cpu-profiler.h b/deps/v8/src/cpu-profiler.h index 66e2b8bd18..cbe3e3cf81 100644 --- a/deps/v8/src/cpu-profiler.h +++ b/deps/v8/src/cpu-profiler.h @@ -184,7 +184,7 @@ class ProfilerEventsProcessor : public Thread { } while (false) -class CpuProfiler { +class CpuProfiler : public CodeEventListener { public: explicit CpuProfiler(Isolate* isolate); @@ -193,7 +193,7 @@ class CpuProfiler { ProfileGenerator* test_generator, ProfilerEventsProcessor* test_processor); - ~CpuProfiler(); + virtual ~CpuProfiler(); void StartProfiling(const char* title, bool record_samples = false); void StartProfiling(String* title, bool record_samples); @@ -209,30 +209,30 @@ class CpuProfiler { // Must be called via PROFILE macro, otherwise will crash when // profiling is not enabled. - void CallbackEvent(Name* name, Address entry_point); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, const char* comment); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, Name* name); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* name); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* source, int line); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, int args_count); - void CodeMovingGCEvent() {} - void CodeMoveEvent(Address from, Address to); - void CodeDeleteEvent(Address from); - void GetterCallbackEvent(Name* name, Address entry_point); - void RegExpCodeCreateEvent(Code* code, String* source); - void SetterCallbackEvent(Name* name, Address entry_point); - void SharedFunctionInfoMoveEvent(Address from, Address to); + virtual void CallbackEvent(Name* name, Address entry_point); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, const char* comment); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, Name* name); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* name); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* source, int line); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, int args_count); + virtual void CodeMovingGCEvent() {} + virtual void CodeMoveEvent(Address from, Address to); + virtual void CodeDeleteEvent(Address from); + virtual void GetterCallbackEvent(Name* name, Address entry_point); + virtual void RegExpCodeCreateEvent(Code* code, String* source); + virtual void SetterCallbackEvent(Name* name, Address entry_point); + virtual void SharedFunctionInfoMoveEvent(Address from, Address to); INLINE(bool is_profiling() const) { return is_profiling_; } bool* is_profiling_address() { diff --git a/deps/v8/src/debug.cc b/deps/v8/src/debug.cc index 8454438815..04f8a7a027 100644 --- a/deps/v8/src/debug.cc +++ b/deps/v8/src/debug.cc @@ -2044,10 +2044,6 @@ void Debug::PrepareForBreakPoints() { // If preparing for the first break point make sure to deoptimize all // functions as debugging does not work with optimized code. if (!has_break_points_) { - if (FLAG_parallel_recompilation) { - isolate_->optimizing_compiler_thread()->Flush(); - } - Deoptimizer::DeoptimizeAll(isolate_); Handle<Code> lazy_compile = diff --git a/deps/v8/src/factory.cc b/deps/v8/src/factory.cc index 52a65887a3..c5a1fddb88 100644 --- a/deps/v8/src/factory.cc +++ b/deps/v8/src/factory.cc @@ -453,13 +453,11 @@ Handle<Script> Factory::NewScript(Handle<String> source) { script->set_data(heap->undefined_value()); script->set_context_data(heap->undefined_value()); script->set_type(Smi::FromInt(Script::TYPE_NORMAL)); - script->set_compilation_type(Smi::FromInt(Script::COMPILATION_TYPE_HOST)); - script->set_compilation_state( - Smi::FromInt(Script::COMPILATION_STATE_INITIAL)); script->set_wrapper(*wrapper); script->set_line_ends(heap->undefined_value()); script->set_eval_from_shared(heap->undefined_value()); script->set_eval_from_instructions_offset(Smi::FromInt(0)); + script->set_flags(Smi::FromInt(0)); return script; } @@ -1221,7 +1219,6 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( shared->set_num_literals(literals_array_size); if (is_generator) { shared->set_instance_class_name(isolate()->heap()->Generator_string()); - shared->DisableOptimization("generator"); } return shared; } diff --git a/deps/v8/src/flag-definitions.h b/deps/v8/src/flag-definitions.h index 8888aed26c..fa202f921a 100644 --- a/deps/v8/src/flag-definitions.h +++ b/deps/v8/src/flag-definitions.h @@ -190,8 +190,6 @@ DEFINE_implication(harmony_observation, harmony_collections) // Flags for experimental implementation features. DEFINE_bool(packed_arrays, true, "optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true, "tracks arrays with only smi values") -DEFINE_bool(compiled_transitions, true, "use optimizing compiler to " - "generate array elements transition stubs") DEFINE_bool(compiled_keyed_stores, true, "use optimizing compiler to " "generate keyed store stubs") DEFINE_bool(clever_optimizations, @@ -744,11 +742,9 @@ DEFINE_bool(log_snapshot_positions, false, DEFINE_bool(log_suspect, false, "Log suspect operations.") DEFINE_bool(prof, false, "Log statistical profiling information (implies --log-code).") -DEFINE_bool(prof_auto, true, - "Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false, "Used with --prof, only does sampling and logging" - " when profiler is active (implies --noprof_auto).") + " when profiler is active.") DEFINE_bool(prof_browser_mode, true, "Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false, "Log regular expression execution.") diff --git a/deps/v8/src/globals.h b/deps/v8/src/globals.h index 26fd53114c..627c951236 100644 --- a/deps/v8/src/globals.h +++ b/deps/v8/src/globals.h @@ -28,72 +28,172 @@ #ifndef V8_GLOBALS_H_ #define V8_GLOBALS_H_ -// Define V8_INFINITY -#define V8_INFINITY INFINITY +// ---------------------------------------------------------------------------- +// Operating system detection (V8_OS_x) +// +// ANDROID - Android +// BSD4 - Any BSD 4.4 system +// CYGWIN - Cygwin +// DARWIN - Darwin / Mac OS X +// FREEBSD - FreeBSD +// LINUX - Linux +// NACL - Native Client +// NETBSD - NetBSD +// OPENBSD - OpenBSD +// SOLARIS - Solaris +// UNIX - Any UNIX BSD/SYSV system +// WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008) + +#if defined(ANDROID) || defined(__ANDROID__) +# define V8_OS_ANDROID 1 +# define V8_OS_LINUX 1 +# define V8_OS_UNIX 1 +#elif defined(__APPLE__) && defined(__MACH__) +# define V8_OS_DARWIN 1 +# define V8_OS_BSD4 1 +# define V8_OS_UNIX 1 +#elif defined(__CYGWIN__) +# define V8_OS_CYGWIN 1 +# define V8_OS_UNIX 1 +#elif defined(WIN64) || defined(_WIN64) || defined(__WIN64__) +# define V8_OS_WIN32 1 +# define V8_OS_WIN64 1 +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || \ + (defined(__MWERKS__) && defined(__INTEL__)) +# define V8_OS_WIN32 1 +#elif defined(__sun) || defined(sun) +# define V8_OS_SOLARIS 1 +# define V8_OS_UNIX 1 +#elif defined(__native_client__) +# define V8_OS_NACL 1 +#elif defined(__linux__) || defined(__linux) +# define V8_OS_LINUX 1 +# define V8_OS_UNIX 1 +#elif defined(__FreeBSD__) || defined(__DragonFly__) +# define V8_OS_FREEBSD 1 +# define V8_OS_BSD4 1 +# define V8_OS_UNIX 1 +#elif defined(__NetBSD__) +# define V8_OS_NETBSD 1 +# define V8_OS_BSD4 1 +# define V8_OS_UNIX 1 +#elif defined(__OpenBSD__) +# define V8_OS_OPENBSD 1 +# define V8_OS_BSD4 1 +# define V8_OS_UNIX 1 +#else +# error Operating system was not detected as supported by v8 +#endif -// GCC specific stuff -#ifdef __GNUC__ -#define __GNUC_VERSION_FOR_INFTY__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) +// ---------------------------------------------------------------------------- +// Compiler detection (V8_CC_x) +// +// CLANG - C++ front-end for the LLVM compiler +// GNU - GNU C++ or compatible +// INTEL - Intel C++ for Linux or Windows +// MINGW - Minimalistic GNU for Windows Compiler +// MIPS - MIPSpro C++ +// MSVC - Microsoft Visual C/C++ or compatible +// RVCT - ARM Realview Compiler Suite -// Unfortunately, the INFINITY macro cannot be used with the '-pedantic' -// warning flag and certain versions of GCC due to a bug: -// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 -// For now, we use the more involved template-based version from <limits>, but -// only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x) -// __GNUC_PREREQ is not defined in GCC for Mac OS X, so we define our own macro -#if __GNUC_VERSION_FOR_INFTY__ >= 29600 && __GNUC_VERSION_FOR_INFTY__ < 40100 -#include <limits> -#undef V8_INFINITY -#define V8_INFINITY std::numeric_limits<double>::infinity() +#if defined(_MSC_VER) +# define V8_CC_MSVC 1 +# if defined(__INTEL_COMPILER) +# define V8_CC_INTEL 1 +# endif +#elif defined(__GNUC__) +# define V8_CC_GNU 1 +# if defined(__MINGW64__) +# define V8_CC_MINGW 1 +# define V8_CC_MINGW64 1 +# elif defined(__MINGW32__) +# define V8_CC_MINGW 1 +# define V8_CC_MINGW32 1 +# elif defined(__ARMCC__) || defined(__CC_ARM) +# define V8_CC_RVCT 1 // ARM Realview Compiler Suite also masquerades as GCC +# elif defined(__INTEL_COMPILER) +# define V8_CC_INTEL 1 // Intel C++ also masquerades as GCC 3.2.0 +# elif defined(__clang__) +# define V8_CC_CLANG 1 // Clang also masquerades as GCC 4.2.1 +# endif +#elif defined(__ARMCC__) || defined(__CC_ARM) +# define V8_CC_RVCT 1 +#elif defined(__INTEL_COMPILER) +# define V8_CC_INTEL 1 +#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) +# define V8_CC_SUN 1 +#else +# error Compiler was not detected as supported by v8 #endif -#undef __GNUC_VERSION_FOR_INFTY__ -#endif // __GNUC__ +#if V8_CC_GNU +# define V8_GNUC_PREREQ(major, minor) \ + (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) +#else +# define V8_GNUC_PREREQ(major, minor) 0 +#endif // V8_CC_GNU -#ifdef _MSC_VER -#undef V8_INFINITY -#define V8_INFINITY HUGE_VAL -#endif +// ---------------------------------------------------------------------------- +// Compiler features -#include "../include/v8stdint.h" +// C++11 deleted functions +#if __cplusplus >= 201103L +# define V8_CXX_DELETED_FUNCTIONS 1 +#elif V8_CC_CLANG +# define V8_CXX_DELETED_FUNCTIONS __has_feature(cxx_deleted_functions) +#else +# define V8_CXX_DELETED_FUNCTIONS (defined(__GXX_EXPERIMENTAL_CXX0X__) && \ + V8_GNUC_PREREQ(4, 4)) +#endif + +// C++11 static_assert() +#if __cplusplus >= 201103L +# define V8_CXX_STATIC_ASSERT 1 +#elif V8_CC_CLANG +# define V8_CXX_STATIC_ASSERT (__has_extension(cxx_static_assert) || \ + __has_feature(cxx_static_assert)) +#else +# define V8_CXX_STATIC_ASSERT (defined(__GXX_EXPERIMENTAL_CXX0X__) && \ + V8_GNUC_PREREQ(4, 3)) +#endif -namespace v8 { -namespace internal { -// Processor architecture detection. For more info on what's defined, see: +// ---------------------------------------------------------------------------- +// Host architecture detection. For more info on what's defined, see: // http://msdn.microsoft.com/en-us/library/b0084kay.aspx // http://www.agner.org/optimize/calling_conventions.pdf // or with gcc, run: "echo | gcc -E -dM -" + #if defined(_M_X64) || defined(__x86_64__) -#if defined(__native_client__) +# if V8_OS_NACL // For Native Client builds of V8, use V8_TARGET_ARCH_ARM, so that V8 // generates ARM machine code, together with a portable ARM simulator // compiled for the host architecture in question. // // Since Native Client is ILP-32 on all architectures we use // V8_HOST_ARCH_IA32 on both 32- and 64-bit x86. -#define V8_HOST_ARCH_IA32 1 -#define V8_HOST_ARCH_32_BIT 1 -#define V8_HOST_CAN_READ_UNALIGNED 1 -#else -#define V8_HOST_ARCH_X64 1 -#define V8_HOST_ARCH_64_BIT 1 -#define V8_HOST_CAN_READ_UNALIGNED 1 -#endif // __native_client__ +# define V8_HOST_ARCH_IA32 1 +# define V8_HOST_ARCH_32_BIT 1 +# define V8_HOST_CAN_READ_UNALIGNED 1 +# else +# define V8_HOST_ARCH_X64 1 +# define V8_HOST_ARCH_64_BIT 1 +# define V8_HOST_CAN_READ_UNALIGNED 1 +# endif // V8_OS_NACL #elif defined(_M_IX86) || defined(__i386__) -#define V8_HOST_ARCH_IA32 1 -#define V8_HOST_ARCH_32_BIT 1 -#define V8_HOST_CAN_READ_UNALIGNED 1 +# define V8_HOST_ARCH_IA32 1 +# define V8_HOST_ARCH_32_BIT 1 +# define V8_HOST_CAN_READ_UNALIGNED 1 #elif defined(__ARMEL__) -#define V8_HOST_ARCH_ARM 1 -#define V8_HOST_ARCH_32_BIT 1 +# define V8_HOST_ARCH_ARM 1 +# define V8_HOST_ARCH_32_BIT 1 #elif defined(__MIPSEL__) -#define V8_HOST_ARCH_MIPS 1 -#define V8_HOST_ARCH_32_BIT 1 +# define V8_HOST_ARCH_MIPS 1 +# define V8_HOST_ARCH_32_BIT 1 #else -#error Host architecture was not detected as supported by v8 +# error Host architecture was not detected as supported by v8 #endif #if defined(__ARM_ARCH_7A__) || \ @@ -101,111 +201,86 @@ namespace internal { defined(__ARM_ARCH_7__) # define CAN_USE_ARMV7_INSTRUCTIONS 1 # ifndef CAN_USE_VFP3_INSTRUCTIONS -# define CAN_USE_VFP3_INSTRUCTIONS +# define CAN_USE_VFP3_INSTRUCTIONS 1 # endif #endif +// ---------------------------------------------------------------------------- // Target architecture detection. This may be set externally. If not, detect // in the same way as the host architecture, that is, target the native // environment as presented by the compiler. + #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \ !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS -#if defined(_M_X64) || defined(__x86_64__) -#define V8_TARGET_ARCH_X64 1 -#elif defined(_M_IX86) || defined(__i386__) -#define V8_TARGET_ARCH_IA32 1 -#elif defined(__ARMEL__) -#define V8_TARGET_ARCH_ARM 1 -#elif defined(__MIPSEL__) -#define V8_TARGET_ARCH_MIPS 1 -#else -#error Target architecture was not detected as supported by v8 -#endif +# if V8_HOST_ARCH_X64 +# define V8_TARGET_ARCH_X64 1 +# elif V8_HOST_ARCH_IA32 +# define V8_TARGET_ARCH_IA32 1 +# elif V8_HOST_ARCH_ARM +# define V8_TARGET_ARCH_ARM 1 +# elif V8_HOST_ARCH_MIPS +# define V8_TARGET_ARCH_MIPS 1 +# else +# error Target architecture was not detected as supported by v8 +# endif #endif // Check for supported combinations of host and target architectures. #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32 -#error Target architecture ia32 is only supported on ia32 host -#endif -#if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 -#error Target architecture x64 is only supported on x64 host -#endif -#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM)) -#error Target architecture arm is only supported on arm and ia32 host -#endif -#if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) -#error Target architecture mips is only supported on mips and ia32 host +# error Target architecture ia32 is only supported on ia32 host +#elif V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 +# error Target architecture x64 is only supported on x64 host +#elif V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM) +# error Target architecture arm is only supported on arm and ia32 host +#elif V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS) +# error Target architecture mips is only supported on mips and ia32 host #endif // Determine whether we are running in a simulated environment. // Setting USE_SIMULATOR explicitly from the build script will force // the use of a simulated environment. #if !defined(USE_SIMULATOR) -#if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) -#define USE_SIMULATOR 1 -#endif -#if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) -#define USE_SIMULATOR 1 -#endif +# if V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM +# define USE_SIMULATOR 1 +# elif V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS +# define USE_SIMULATOR 1 +# endif #endif // Determine architecture endiannes (we only support little-endian). -#if V8_TARGET_ARCH_IA32 -#define V8_TARGET_LITTLE_ENDIAN 1 -#elif V8_TARGET_ARCH_X64 -#define V8_TARGET_LITTLE_ENDIAN 1 -#elif V8_TARGET_ARCH_ARM -#define V8_TARGET_LITTLE_ENDIAN 1 -#elif V8_TARGET_ARCH_MIPS -#define V8_TARGET_LITTLE_ENDIAN 1 +#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || \ + V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS +# define V8_TARGET_LITTLE_ENDIAN 1 #else -#error Unknown target architecture endiannes +# error Unknown target architecture endiannes #endif -// Support for alternative bool type. This is only enabled if the code is -// compiled with USE_MYBOOL defined. This catches some nasty type bugs. -// For instance, 'bool b = "false";' results in b == true! This is a hidden -// source of bugs. -// However, redefining the bool type does have some negative impact on some -// platforms. It gives rise to compiler warnings (i.e. with -// MSVC) in the API header files when mixing code that uses the standard -// bool with code that uses the redefined version. -// This does not actually belong in the platform code, but needs to be -// defined here because the platform code uses bool, and platform.h is -// include very early in the main include file. - -#ifdef USE_MYBOOL -typedef unsigned int __my_bool__; -#define bool __my_bool__ // use 'indirection' to avoid name clashes -#endif - -typedef uint8_t byte; -typedef byte* Address; +// ---------------------------------------------------------------------------- // Define our own macros for writing 64-bit constants. This is less fragile // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it // works on compilers that don't have it (like MSVC). #if V8_HOST_ARCH_64_BIT -#if defined(_MSC_VER) -#define V8_UINT64_C(x) (x ## UI64) -#define V8_INT64_C(x) (x ## I64) -#define V8_INTPTR_C(x) (x ## I64) -#define V8_PTR_PREFIX "ll" -#elif defined(__MINGW64__) -#define V8_UINT64_C(x) (x ## ULL) -#define V8_INT64_C(x) (x ## LL) -#define V8_INTPTR_C(x) (x ## LL) -#define V8_PTR_PREFIX "I64" -#else -#define V8_UINT64_C(x) (x ## UL) -#define V8_INT64_C(x) (x ## L) -#define V8_INTPTR_C(x) (x ## L) -#define V8_PTR_PREFIX "l" -#endif +# if V8_CC_MSVC +# define V8_UINT64_C(x) (x ## UI64) +# define V8_INT64_C(x) (x ## I64) +# define V8_INTPTR_C(x) (x ## I64) +# define V8_PTR_PREFIX "ll" +# elif V8_CC_MINGW +# define V8_UINT64_C(x) (x ## ULL) +# define V8_INT64_C(x) (x ## LL) +# define V8_INTPTR_C(x) (x ## LL) +# define V8_PTR_PREFIX "I64" +# else +# define V8_UINT64_C(x) (x ## UL) +# define V8_INT64_C(x) (x ## L) +# define V8_INTPTR_C(x) (x ## L) +# define V8_PTR_PREFIX "l" +# endif #else // V8_HOST_ARCH_64_BIT -#define V8_INTPTR_C(x) (x) -#define V8_PTR_PREFIX "" +# define V8_INTPTR_C(x) (x) +# define V8_PTR_PREFIX "" #endif // V8_HOST_ARCH_64_BIT // The following macro works on both 32 and 64-bit platforms. @@ -213,21 +288,58 @@ typedef byte* Address; // write V8_2PART_UINT64_C(0x12345678,90123456); #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) -#define V8PRIxPTR V8_PTR_PREFIX "x" +#if V8_OS_DARWIN +// Fix for Mac OS X defining uintptr_t as "unsigned long": +# define V8PRIxPTR "lx" +#else +# define V8PRIxPTR V8_PTR_PREFIX "x" +#endif // V8_OS_DARWIN #define V8PRIdPTR V8_PTR_PREFIX "d" #define V8PRIuPTR V8_PTR_PREFIX "u" -// Fix for Mac OS X defining uintptr_t as "unsigned long": -#if defined(__APPLE__) && defined(__MACH__) -#undef V8PRIxPTR -#define V8PRIxPTR "lx" + +// ---------------------------------------------------------------------------- +// Define V8_INFINITY +#if V8_GNUC_PREREQ(2, 96) && !V8_GNUC_PREREQ(4, 1) +// Unfortunately, the INFINITY macro cannot be used with the '-pedantic' +// warning flag and certain versions of GCC due to a bug: +// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 +// For now, we use the more involved template-based version from <limits>, but +// only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x) +# include <limits> +# define V8_INFINITY std::numeric_limits<double>::infinity() +#elif V8_CC_MSVC +# define V8_INFINITY HUGE_VAL +#else +# define V8_INFINITY INFINITY #endif -#if (defined(__APPLE__) && defined(__MACH__)) || \ - defined(__FreeBSD__) || defined(__OpenBSD__) -#define USING_BSD_ABI + +#include "../include/v8stdint.h" + +namespace v8 { +namespace internal { + +// Support for alternative bool type. This is only enabled if the code is +// compiled with USE_MYBOOL defined. This catches some nasty type bugs. +// For instance, 'bool b = "false";' results in b == true! This is a hidden +// source of bugs. +// However, redefining the bool type does have some negative impact on some +// platforms. It gives rise to compiler warnings (i.e. with +// MSVC) in the API header files when mixing code that uses the standard +// bool with code that uses the redefined version. +// This does not actually belong in the platform code, but needs to be +// defined here because the platform code uses bool, and platform.h is +// include very early in the main include file. + +#ifdef USE_MYBOOL +typedef unsigned int __my_bool__; +#define bool __my_bool__ // use 'indirection' to avoid name clashes #endif +typedef uint8_t byte; +typedef byte* Address; + // ----------------------------------------------------------------------------- // Constants @@ -330,10 +442,10 @@ F FUNCTION_CAST(Address addr) { } -#if __cplusplus >= 201103L -#define DISALLOW_BY_DELETE = delete +#if V8_CXX_DELETED_FUNCTIONS +# define DISALLOW_BY_DELETE = delete #else -#define DISALLOW_BY_DELETE +# define DISALLOW_BY_DELETE #endif @@ -358,24 +470,22 @@ F FUNCTION_CAST(Address addr) { // Define used for helping GCC to make better inlining. Don't bother for debug // builds. On GCC 3.4.5 using __attribute__((always_inline)) causes compilation // errors in debug build. -#if defined(__GNUC__) && !defined(DEBUG) -#if (__GNUC__ >= 4) -#define INLINE(header) inline header __attribute__((always_inline)) -#define NO_INLINE(header) header __attribute__((noinline)) -#else -#define INLINE(header) inline __attribute__((always_inline)) header -#define NO_INLINE(header) __attribute__((noinline)) header -#endif -#elif defined(_MSC_VER) && !defined(DEBUG) -#define INLINE(header) __forceinline header -#define NO_INLINE(header) header +#if V8_GNUC_PREREQ(4, 0) && !defined(DEBUG) +# define INLINE(header) inline header __attribute__((always_inline)) +# define NO_INLINE(header) header __attribute__((noinline)) +#elif V8_CC_GNU && !defined(DEBUG) +# define INLINE(header) inline __attribute__((always_inline)) header +# define NO_INLINE(header) __attribute__((noinline)) header +#elif V8_CC_MSVC && !defined(DEBUG) +# define INLINE(header) __forceinline header +# define NO_INLINE(header) header #else -#define INLINE(header) inline header -#define NO_INLINE(header) header +# define INLINE(header) inline header +# define NO_INLINE(header) header #endif -#if defined(__GNUC__) && __GNUC__ >= 4 +#if V8_GNUC_PREREQ(4, 0) #define MUST_USE_RESULT __attribute__ ((warn_unused_result)) #else #define MUST_USE_RESULT diff --git a/deps/v8/src/heap.cc b/deps/v8/src/heap.cc index 5cd85445b4..692ec21820 100644 --- a/deps/v8/src/heap.cc +++ b/deps/v8/src/heap.cc @@ -703,16 +703,6 @@ bool Heap::CollectGarbage(AllocationSpace space, } -int Heap::NotifyContextDisposed() { - if (FLAG_parallel_recompilation) { - // Flush the queued recompilation tasks. - isolate()->optimizing_compiler_thread()->Flush(); - } - flush_monomorphic_ics_ = true; - return ++contexts_disposed_; -} - - void Heap::PerformScavenge() { GCTracer tracer(this, NULL, NULL); if (incremental_marking()->IsStopped()) { diff --git a/deps/v8/src/heap.h b/deps/v8/src/heap.h index 5e8a2e516d..fbe0531014 100644 --- a/deps/v8/src/heap.h +++ b/deps/v8/src/heap.h @@ -1254,7 +1254,10 @@ class Heap { void EnsureHeapIsIterable(); // Notify the heap that a context has been disposed. - int NotifyContextDisposed(); + int NotifyContextDisposed() { + flush_monomorphic_ics_ = true; + return ++contexts_disposed_; + } // Utility to invoke the scavenger. This is needed in test code to // ensure correct callback for weak global handles. diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc index 5fe3af1f5b..54b53db594 100644 --- a/deps/v8/src/hydrogen-instructions.cc +++ b/deps/v8/src/hydrogen-instructions.cc @@ -448,6 +448,7 @@ const char* HType::ToString() { // Note: The c1visualizer syntax for locals allows only a sequence of the // following characters: A-Za-z0-9_-|: switch (type_) { + case kNone: return "none"; case kTagged: return "tagged"; case kTaggedPrimitive: return "primitive"; case kTaggedNumber: return "number"; @@ -458,7 +459,6 @@ const char* HType::ToString() { case kNonPrimitive: return "non-primitive"; case kJSArray: return "array"; case kJSObject: return "object"; - case kUninitialized: return "uninitialized"; } UNREACHABLE(); return "unreachable"; @@ -1632,9 +1632,7 @@ HValue* HUnaryMathOperation::Canonicalize() { HValue* HCheckInstanceType::Canonicalize() { - if (check_ == IS_STRING && - !value()->type().IsUninitialized() && - value()->type().IsString()) { + if (check_ == IS_STRING && value()->type().IsString()) { return NULL; } @@ -2647,10 +2645,13 @@ HConstant::HConstant(Handle<Object> handle, Representation r) has_smi_value_(false), has_int32_value_(false), has_double_value_(false), + has_external_reference_value_(false), is_internalized_string_(false), is_not_in_new_space_(true), is_cell_(false), boolean_value_(handle->BooleanValue()) { + set_type(HType::TypeFromValue(handle)); + if (handle_->IsHeapObject()) { Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap(); is_not_in_new_space_ = !heap->InNewSpace(*handle); @@ -2663,7 +2664,6 @@ HConstant::HConstant(Handle<Object> handle, Representation r) double_value_ = n; has_double_value_ = true; } else { - type_from_value_ = HType::TypeFromValue(handle_); is_internalized_string_ = handle_->IsInternalizedString(); } @@ -2681,19 +2681,19 @@ HConstant::HConstant(Handle<Object> handle, bool is_not_in_new_space, bool is_cell, bool boolean_value) - : handle_(handle), - unique_id_(unique_id), - has_smi_value_(false), - has_int32_value_(false), - has_double_value_(false), - is_internalized_string_(is_internalize_string), - is_not_in_new_space_(is_not_in_new_space), - is_cell_(is_cell), - boolean_value_(boolean_value), - type_from_value_(type) { + : handle_(handle), + unique_id_(unique_id), + has_smi_value_(false), + has_int32_value_(false), + has_double_value_(false), + has_external_reference_value_(false), + is_internalized_string_(is_internalize_string), + is_not_in_new_space_(is_not_in_new_space), + is_cell_(is_cell), + boolean_value_(boolean_value) { ASSERT(!handle.is_null()); - ASSERT(!type.IsUninitialized()); ASSERT(!type.IsTaggedNumber()); + set_type(type); Initialize(r); } @@ -2702,17 +2702,19 @@ HConstant::HConstant(int32_t integer_value, Representation r, bool is_not_in_new_space, Handle<Object> optional_handle) - : handle_(optional_handle), - unique_id_(), - has_int32_value_(true), - has_double_value_(true), - is_internalized_string_(false), - is_not_in_new_space_(is_not_in_new_space), - is_cell_(false), - boolean_value_(integer_value != 0), - int32_value_(integer_value), - double_value_(FastI2D(integer_value)) { - has_smi_value_ = Smi::IsValid(int32_value_); + : handle_(optional_handle), + unique_id_(), + has_smi_value_(Smi::IsValid(integer_value)), + has_int32_value_(true), + has_double_value_(true), + has_external_reference_value_(false), + is_internalized_string_(false), + is_not_in_new_space_(is_not_in_new_space), + is_cell_(false), + boolean_value_(integer_value != 0), + int32_value_(integer_value), + double_value_(FastI2D(integer_value)) { + set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); Initialize(r); } @@ -2721,21 +2723,38 @@ HConstant::HConstant(double double_value, Representation r, bool is_not_in_new_space, Handle<Object> optional_handle) - : handle_(optional_handle), - unique_id_(), - has_int32_value_(IsInteger32(double_value)), - has_double_value_(true), - is_internalized_string_(false), - is_not_in_new_space_(is_not_in_new_space), - is_cell_(false), - boolean_value_(double_value != 0 && !std::isnan(double_value)), - int32_value_(DoubleToInt32(double_value)), - double_value_(double_value) { + : handle_(optional_handle), + unique_id_(), + has_int32_value_(IsInteger32(double_value)), + has_double_value_(true), + has_external_reference_value_(false), + is_internalized_string_(false), + is_not_in_new_space_(is_not_in_new_space), + is_cell_(false), + boolean_value_(double_value != 0 && !std::isnan(double_value)), + int32_value_(DoubleToInt32(double_value)), + double_value_(double_value) { has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); + set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); Initialize(r); } +HConstant::HConstant(ExternalReference reference) + : has_smi_value_(false), + has_int32_value_(false), + has_double_value_(false), + has_external_reference_value_(true), + is_internalized_string_(false), + is_not_in_new_space_(true), + is_cell_(false), + boolean_value_(true), + external_reference_value_(reference) { + set_type(HType::None()); + Initialize(Representation::External()); +} + + void HConstant::Initialize(Representation r) { if (r.IsNone()) { if (has_smi_value_ && kSmiValueSize == 31) { @@ -2744,6 +2763,8 @@ void HConstant::Initialize(Representation r) { r = Representation::Integer32(); } else if (has_double_value_) { r = Representation::Double(); + } else if (has_external_reference_value_) { + r = Representation::External(); } else { r = Representation::Tagged(); } @@ -2768,17 +2789,21 @@ HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const { if (r.IsSmi() && !has_smi_value_) return NULL; if (r.IsInteger32() && !has_int32_value_) return NULL; if (r.IsDouble() && !has_double_value_) return NULL; + if (r.IsExternal() && !has_external_reference_value_) return NULL; if (has_int32_value_) { return new(zone) HConstant(int32_value_, r, is_not_in_new_space_, handle_); } if (has_double_value_) { return new(zone) HConstant(double_value_, r, is_not_in_new_space_, handle_); } + if (has_external_reference_value_) { + return new(zone) HConstant(external_reference_value_); + } ASSERT(!handle_.is_null()); return new(zone) HConstant(handle_, unique_id_, r, - type_from_value_, + type_, is_internalized_string_, is_not_in_new_space_, is_cell_, @@ -2826,6 +2851,9 @@ void HConstant::PrintDataTo(StringStream* stream) { stream->Add("%d ", int32_value_); } else if (has_double_value_) { stream->Add("%f ", FmtElm(double_value_)); + } else if (has_external_reference_value_) { + stream->Add("%p ", reinterpret_cast<void*>( + external_reference_value_.address())); } else { handle()->ShortPrint(stream); } @@ -3653,8 +3681,9 @@ HType HCheckSmi::CalculateInferredType() { HType HPhi::CalculateInferredType() { - HType result = HType::Uninitialized(); - for (int i = 0; i < OperandCount(); ++i) { + if (OperandCount() == 0) return HType::Tagged(); + HType result = OperandAt(0)->type(); + for (int i = 1; i < OperandCount(); ++i) { HType current = OperandAt(i)->type(); result = result.Combine(current); } @@ -3662,16 +3691,6 @@ HType HPhi::CalculateInferredType() { } -HType HConstant::CalculateInferredType() { - if (has_int32_value_) { - return Smi::IsValid(int32_value_) ? HType::Smi() : HType::HeapNumber(); - } - if (has_double_value_) return HType::HeapNumber(); - ASSERT(!type_from_value_.IsUninitialized()); - return type_from_value_; -} - - HType HCompareGeneric::CalculateInferredType() { return HType::Boolean(); } @@ -3728,11 +3747,6 @@ Representation HUnaryMathOperation::RepresentationFromInputs() { } -HType HStringCharFromCode::CalculateInferredType() { - return HType::String(); -} - - void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, HValue* dominator) { ASSERT(side_effect == kChangesNewSpacePromotion); @@ -4361,7 +4375,11 @@ bool HValue::HasNonSmiUse() { // We check for observed_input_representation elsewhere. Representation use_rep = it.value()->RequiredInputRepresentation(it.index()); - if (!use_rep.IsNone() && !use_rep.IsSmi()) return true; + if (!use_rep.IsNone() && + !use_rep.IsSmi() && + !use_rep.IsTagged()) { + return true; + } } return false; } @@ -4520,6 +4538,10 @@ void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) { instr->SetGVNFlag(is_store ? kChangesMaps : kDependsOnMaps); break; + case kExternalMemory: + instr->SetGVNFlag(is_store + ? kChangesExternalMemory : kDependsOnExternalMemory); + break; } } @@ -4546,6 +4568,9 @@ void HObjectAccess::PrintTo(StringStream* stream) { if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); stream->Add("[backing-store]"); break; + case kExternalMemory: + stream->Add("[external-memory]"); + break; } stream->Add("@%d", offset()); diff --git a/deps/v8/src/hydrogen-instructions.h b/deps/v8/src/hydrogen-instructions.h index 40bbc90245..e71b7cdf41 100644 --- a/deps/v8/src/hydrogen-instructions.h +++ b/deps/v8/src/hydrogen-instructions.h @@ -211,7 +211,7 @@ class LChunkBuilder; V(GlobalVars) \ V(InobjectFields) \ V(OsrEntries) \ - V(SpecializedArrayElements) + V(ExternalMemory) #define DECLARE_ABSTRACT_INSTRUCTION(type) \ @@ -350,8 +350,7 @@ class UniqueValueId { class HType { public: - HType() : type_(kUninitialized) { } - + static HType None() { return HType(kNone); } static HType Tagged() { return HType(kTagged); } static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } static HType TaggedNumber() { return HType(kTaggedNumber); } @@ -362,7 +361,6 @@ class HType { static HType NonPrimitive() { return HType(kNonPrimitive); } static HType JSArray() { return HType(kJSArray); } static HType JSObject() { return HType(kJSObject); } - static HType Uninitialized() { return HType(kUninitialized); } // Return the weakest (least precise) common type. HType Combine(HType other) { @@ -378,32 +376,26 @@ class HType { } bool IsTagged() const { - ASSERT(type_ != kUninitialized); return ((type_ & kTagged) == kTagged); } bool IsTaggedPrimitive() const { - ASSERT(type_ != kUninitialized); return ((type_ & kTaggedPrimitive) == kTaggedPrimitive); } bool IsTaggedNumber() const { - ASSERT(type_ != kUninitialized); return ((type_ & kTaggedNumber) == kTaggedNumber); } bool IsSmi() const { - ASSERT(type_ != kUninitialized); return ((type_ & kSmi) == kSmi); } bool IsHeapNumber() const { - ASSERT(type_ != kUninitialized); return ((type_ & kHeapNumber) == kHeapNumber); } bool IsString() const { - ASSERT(type_ != kUninitialized); return ((type_ & kString) == kString); } @@ -413,40 +405,50 @@ class HType { } bool IsBoolean() const { - ASSERT(type_ != kUninitialized); return ((type_ & kBoolean) == kBoolean); } bool IsNonPrimitive() const { - ASSERT(type_ != kUninitialized); return ((type_ & kNonPrimitive) == kNonPrimitive); } bool IsJSArray() const { - ASSERT(type_ != kUninitialized); return ((type_ & kJSArray) == kJSArray); } bool IsJSObject() const { - ASSERT(type_ != kUninitialized); return ((type_ & kJSObject) == kJSObject); } - bool IsUninitialized() const { - return type_ == kUninitialized; - } - bool IsHeapObject() const { - ASSERT(type_ != kUninitialized); return IsHeapNumber() || IsString() || IsBoolean() || IsNonPrimitive(); } + bool ToStringOrToNumberCanBeObserved(Representation representation) { + switch (type_) { + case kTaggedPrimitive: // fallthru + case kTaggedNumber: // fallthru + case kSmi: // fallthru + case kHeapNumber: // fallthru + case kString: // fallthru + case kBoolean: + return false; + case kJSArray: // fallthru + case kJSObject: + return true; + case kTagged: + break; + } + return !representation.IsSmiOrInteger32() && !representation.IsDouble(); + } + static HType TypeFromValue(Handle<Object> value); const char* ToString(); private: enum Type { + kNone = 0x0, // 0000 0000 0000 0000 kTagged = 0x1, // 0000 0000 0000 0001 kTaggedPrimitive = 0x5, // 0000 0000 0000 0101 kTaggedNumber = 0xd, // 0000 0000 0000 1101 @@ -456,12 +458,11 @@ class HType { kBoolean = 0x85, // 0000 0000 1000 0101 kNonPrimitive = 0x101, // 0000 0001 0000 0001 kJSObject = 0x301, // 0000 0011 0000 0001 - kJSArray = 0x701, // 0000 0111 0000 0001 - kUninitialized = 0x1fff // 0001 1111 1111 1111 + kJSArray = 0x701 // 0000 0111 0000 0001 }; // Make sure type fits in int16. - STATIC_ASSERT(kUninitialized < (1 << (2 * kBitsPerByte))); + STATIC_ASSERT(kJSArray < (1 << (2 * kBitsPerByte))); explicit HType(Type t) : type_(t) { } @@ -1145,6 +1146,18 @@ class HValue: public ZoneObject { } } + // Returns true conservatively if the program might be able to observe a + // ToString() operation on this value. + bool ToStringCanBeObserved() const { + return type().ToStringOrToNumberCanBeObserved(representation()); + } + + // Returns true conservatively if the program might be able to observe a + // ToNumber() operation on this value. + bool ToNumberCanBeObserved() const { + return type().ToStringOrToNumberCanBeObserved(representation()); + } + protected: void TryGuaranteeRangeRecursive(RangeEvaluationContext* context); @@ -2682,6 +2695,10 @@ class HLoadExternalArrayPointer: public HUnaryOperation { return Representation::Tagged(); } + virtual HType CalculateInferredType() { + return HType::None(); + } + DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer) protected: @@ -2937,11 +2954,7 @@ class HCheckHeapObject: public HUnaryOperation { #endif virtual HValue* Canonicalize() { - HType value_type = value()->type(); - if (!value_type.IsUninitialized() && value_type.IsHeapObject()) { - return NULL; - } - return this; + return value()->type().IsHeapObject() ? NULL : this; } DECLARE_CONCRETE_INSTRUCTION(CheckHeapObject) @@ -3343,9 +3356,6 @@ class HPhi: public HValue { void SimplifyConstantInputs(); - // TODO(titzer): we can't eliminate the receiver for generating backtraces - virtual bool IsDeletable() const { return !IsReceiver(); } - protected: virtual void DeleteFromGraph(); virtual void InternalSetOperandAt(int index, HValue* value) { @@ -3365,6 +3375,9 @@ class HPhi: public HValue { int indirect_uses_[Representation::kNumRepresentations]; int phi_id_; InductionVariableData* induction_variable_data_; + + // TODO(titzer): we can't eliminate the receiver for generating backtraces + virtual bool IsDeletable() const { return !IsReceiver(); } }; @@ -3471,6 +3484,7 @@ class HConstant: public HTemplateInstruction<0> { bool is_not_in_new_space, bool is_cell, bool boolean_value); + explicit HConstant(ExternalReference reference); Handle<Object> handle() { if (handle_.is_null()) { @@ -3535,12 +3549,12 @@ class HConstant: public HTemplateInstruction<0> { if (HasSmiValue() && kSmiValueSize == 31) return Representation::Smi(); if (HasInteger32Value()) return Representation::Integer32(); if (HasNumberValue()) return Representation::Double(); + if (HasExternalReferenceValue()) return Representation::External(); return Representation::Tagged(); } virtual bool EmitAtUses(); virtual void PrintDataTo(StringStream* stream); - virtual HType CalculateInferredType(); bool IsInteger() { return handle()->IsSmi(); } HConstant* CopyToRepresentation(Representation r, Zone* zone) const; Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); @@ -3577,7 +3591,7 @@ class HConstant: public HTemplateInstruction<0> { bool HasStringValue() const { if (has_double_value_ || has_int32_value_) return false; ASSERT(!handle_.is_null()); - return type_from_value_.IsString(); + return type_.IsString(); } Handle<String> StringValue() const { ASSERT(HasStringValue()); @@ -3587,6 +3601,13 @@ class HConstant: public HTemplateInstruction<0> { return HasStringValue() && is_internalized_string_; } + bool HasExternalReferenceValue() const { + return has_external_reference_value_; + } + ExternalReference ExternalReferenceValue() const { + return external_reference_value_; + } + bool BooleanValue() const { return boolean_value_; } virtual intptr_t Hashcode() { @@ -3594,6 +3615,8 @@ class HConstant: public HTemplateInstruction<0> { return static_cast<intptr_t>(int32_value_); } else if (has_double_value_) { return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); + } else if (has_external_reference_value_) { + return reinterpret_cast<intptr_t>(external_reference_value_.address()); } else { ASSERT(!handle_.is_null()); return unique_id_.Hashcode(); @@ -3601,14 +3624,15 @@ class HConstant: public HTemplateInstruction<0> { } virtual void FinalizeUniqueValueId() { - if (!has_double_value_) { + if (!has_double_value_ && !has_external_reference_value_) { ASSERT(!handle_.is_null()); unique_id_ = UniqueValueId(handle_); } } bool UniqueValueIdsMatch(UniqueValueId other) { - return !has_double_value_ && unique_id_ == other; + return !has_double_value_ && !has_external_reference_value_ && + unique_id_ == other; } #ifdef DEBUG @@ -3629,6 +3653,10 @@ class HConstant: public HTemplateInstruction<0> { return other_constant->has_double_value_ && BitCast<int64_t>(double_value_) == BitCast<int64_t>(other_constant->double_value_); + } else if (has_external_reference_value_) { + return other_constant->has_external_reference_value_ && + external_reference_value_ == + other_constant->external_reference_value_; } else { ASSERT(!handle_.is_null()); return !other_constant->handle_.is_null() && @@ -3656,13 +3684,14 @@ class HConstant: public HTemplateInstruction<0> { bool has_smi_value_ : 1; bool has_int32_value_ : 1; bool has_double_value_ : 1; + bool has_external_reference_value_ : 1; bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. bool is_not_in_new_space_ : 1; bool is_cell_ : 1; bool boolean_value_ : 1; int32_t int32_value_; double double_value_; - HType type_from_value_; + ExternalReference external_reference_value_; }; @@ -3678,9 +3707,9 @@ class HBinaryOperation: public HTemplateInstruction<3> { observed_input_representation_[1] = Representation::None(); } - HValue* context() { return OperandAt(0); } - HValue* left() { return OperandAt(1); } - HValue* right() { return OperandAt(2); } + HValue* context() const { return OperandAt(0); } + HValue* left() const { return OperandAt(1); } + HValue* right() const { return OperandAt(2); } // True if switching left and right operands likely generates better code. bool AreOperandsBetterSwitched() { @@ -3934,9 +3963,6 @@ class HBoundsCheck: public HTemplateInstruction<2> { virtual Representation RequiredInputRepresentation(int arg_index) { return representation(); } - virtual bool IsDeletable() const { - return skip_check() && !FLAG_debug_code; - } virtual bool IsRelationTrueInternal(NumericRelation relation, HValue* related_value, @@ -3973,6 +3999,11 @@ class HBoundsCheck: public HTemplateInstruction<2> { int scale_; RangeGuaranteeDirection responsibility_direction_; bool allow_equality_; + + private: + virtual bool IsDeletable() const { + return skip_check() && !FLAG_debug_code; + } }; @@ -4792,8 +4823,7 @@ class HMathMinMax: public HArithmeticBinaryOperation { virtual Representation RepresentationFromInputs() { Representation left_rep = left()->representation(); Representation right_rep = right()->representation(); - // TODO(verwaest): Initialize to Smi once lithium-codegen has been fixed. - Representation result = Representation::Integer32(); + Representation result = Representation::Smi(); result = result.generalize(left_rep); result = result.generalize(right_rep); if (result.IsTagged()) return Representation::Double(); @@ -4891,7 +4921,11 @@ class HShl: public HBitwiseBinaryOperation { virtual void UpdateRepresentation(Representation new_rep, HInferRepresentationPhase* h_infer, const char* reason) { - if (new_rep.IsSmi()) new_rep = Representation::Integer32(); + if (new_rep.IsSmi() && + !(right()->IsInteger32Constant() && + right()->GetInteger32Constant() >= 0)) { + new_rep = Representation::Integer32(); + } HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); } @@ -5554,7 +5588,11 @@ class HStoreContextSlot: public HTemplateInstruction<2> { class HObjectAccess { public: inline bool IsInobject() const { - return portion() != kBackingStore; + return portion() != kBackingStore && portion() != kExternalMemory; + } + + inline bool IsExternalMemory() const { + return portion() == kExternalMemory; } inline int offset() const { @@ -5584,9 +5622,11 @@ class HObjectAccess { static HObjectAccess ForArrayLength(ElementsKind elements_kind) { return HObjectAccess( - kArrayLengths, JSArray::kLengthOffset, - IsFastElementsKind(elements_kind) && FLAG_track_fields ? - Representation::Smi() : Representation::Tagged()); + kArrayLengths, + JSArray::kLengthOffset, + IsFastElementsKind(elements_kind) && + FLAG_track_fields + ? Representation::Smi() : Representation::Tagged()); } static HObjectAccess ForAllocationSiteTransitionInfo() { @@ -5599,9 +5639,9 @@ class HObjectAccess { static HObjectAccess ForFixedArrayLength() { return HObjectAccess( - kArrayLengths, FixedArray::kLengthOffset, - FLAG_track_fields ? - Representation::Smi() : Representation::Tagged()); + kArrayLengths, + FixedArray::kLengthOffset, + FLAG_track_fields ? Representation::Smi() : Representation::Tagged()); } static HObjectAccess ForPropertiesPointer() { @@ -5628,6 +5668,10 @@ class HObjectAccess { return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); } + static HObjectAccess ForCounter() { + return HObjectAccess(kExternalMemory, 0, Representation::Integer32()); + } + // Create an access to an offset in a fixed array header. static HObjectAccess ForFixedArrayHeader(int offset); @@ -5666,7 +5710,8 @@ class HObjectAccess { kElementsPointer, // elements pointer kBackingStore, // some field in the backing store kDouble, // some double field - kInobject // some other in-object field + kInobject, // some other in-object field + kExternalMemory // some field in external memory }; HObjectAccess(Portion portion, int offset, @@ -5744,7 +5789,9 @@ class HLoadNamedField: public HTemplateInstruction<2> { if (representation.IsSmi()) { set_type(HType::Smi()); set_representation(representation); - } else if (representation.IsDouble()) { + } else if (representation.IsDouble() || + representation.IsExternal() || + representation.IsInteger32()) { set_representation(representation); } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { @@ -5770,6 +5817,10 @@ class HLoadNamedField: public HTemplateInstruction<2> { virtual bool HasEscapingOperandAt(int index) { return false; } virtual Representation RequiredInputRepresentation(int index) { + if (index == 0 && access().IsExternalMemory()) { + // object must be external in case of external memory access + return Representation::External(); + } return Representation::Tagged(); } virtual void PrintDataTo(StringStream* stream); @@ -5943,7 +5994,7 @@ class HLoadKeyed set_representation(Representation::Integer32()); } - SetGVNFlag(kDependsOnSpecializedArrayElements); + SetGVNFlag(kDependsOnExternalMemory); // Native code could change the specialized array. SetGVNFlag(kDependsOnCalls); } @@ -6100,9 +6151,13 @@ class HStoreNamedField: public HTemplateInstruction<2> { virtual bool HasEscapingOperandAt(int index) { return index == 1; } virtual Representation RequiredInputRepresentation(int index) { - if (index == 1 && field_representation().IsDouble()) { - return field_representation(); - } else if (index == 1 && field_representation().IsSmi()) { + if (index == 0 && access().IsExternalMemory()) { + // object must be external in case of external memory access + return Representation::External(); + } else if (index == 1 && + (field_representation().IsDouble() || + field_representation().IsSmi() || + field_representation().IsInteger32())) { return field_representation(); } return Representation::Tagged(); @@ -6140,6 +6195,7 @@ class HStoreNamedField: public HTemplateInstruction<2> { if (IsSkipWriteBarrier()) return false; if (field_representation().IsDouble()) return false; if (field_representation().IsSmi()) return false; + if (field_representation().IsInteger32()) return false; return StoringValueNeedsWriteBarrier(value()) && ReceiverObjectNeedsWriteBarrier(object(), new_space_dominator()); } @@ -6220,7 +6276,7 @@ class HStoreKeyed SetGVNFlag(kDependsOnNewSpacePromotion); } if (is_external()) { - SetGVNFlag(kChangesSpecializedArrayElements); + SetGVNFlag(kChangesExternalMemory); SetFlag(kAllowUndefinedAsNaN); } else if (IsFastDoubleElementsKind(elements_kind)) { SetGVNFlag(kChangesDoubleArrayElements); @@ -6471,8 +6527,9 @@ class HStringAdd: public HBinaryOperation { SetGVNFlag(kChangesNewSpacePromotion); } - // TODO(svenpanne) Might be safe, but leave it out until we know for sure. - // virtual bool IsDeletable() const { return true; } + // No side-effects except possible allocation. + // NOTE: this instruction _does not_ call ToString() on its inputs. + virtual bool IsDeletable() const { return true; } const StringAddFlags flags_; }; @@ -6497,9 +6554,9 @@ class HStringCharCodeAt: public HTemplateInstruction<3> { : Representation::Tagged(); } - HValue* context() { return OperandAt(0); } - HValue* string() { return OperandAt(1); } - HValue* index() { return OperandAt(2); } + HValue* context() const { return OperandAt(0); } + HValue* string() const { return OperandAt(1); } + HValue* index() const { return OperandAt(2); } DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt) @@ -6510,9 +6567,9 @@ class HStringCharCodeAt: public HTemplateInstruction<3> { return new(zone) Range(0, String::kMaxUtf16CodeUnit); } - // TODO(svenpanne) Might be safe, but leave it out until we know for sure. - // private: - // virtual bool IsDeletable() const { return true; } + private: + // No side effects: runtime function assumes string + number inputs. + virtual bool IsDeletable() const { return true; } }; @@ -6527,10 +6584,10 @@ class HStringCharFromCode: public HTemplateInstruction<2> { ? Representation::Tagged() : Representation::Integer32(); } - virtual HType CalculateInferredType(); + virtual HType CalculateInferredType() { return HType::String(); } - HValue* context() { return OperandAt(0); } - HValue* value() { return OperandAt(1); } + HValue* context() const { return OperandAt(0); } + HValue* value() const { return OperandAt(1); } virtual bool DataEquals(HValue* other) { return true; } @@ -6545,8 +6602,9 @@ class HStringCharFromCode: public HTemplateInstruction<2> { SetGVNFlag(kChangesNewSpacePromotion); } - // TODO(svenpanne) Might be safe, but leave it out until we know for sure. - // virtual bool IsDeletable() const { return true; } + virtual bool IsDeletable() const { + return !value()->ToNumberCanBeObserved(); + } }; diff --git a/deps/v8/src/hydrogen-mark-deoptimize.cc b/deps/v8/src/hydrogen-mark-deoptimize.cc new file mode 100644 index 0000000000..111fcd2ce9 --- /dev/null +++ b/deps/v8/src/hydrogen-mark-deoptimize.cc @@ -0,0 +1,71 @@ +// Copyright 2013 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 "hydrogen-mark-deoptimize.h" + +namespace v8 { +namespace internal { + +void HMarkDeoptimizeOnUndefinedPhase::Run() { + const ZoneList<HPhi*>* phi_list = graph()->phi_list(); + for (int i = 0; i < phi_list->length(); i++) { + HPhi* phi = phi_list->at(i); + if (phi->CheckFlag(HValue::kAllowUndefinedAsNaN)) { + for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { + HValue* use_value = it.value(); + if (!use_value->CheckFlag(HValue::kAllowUndefinedAsNaN)) { + ProcessPhi(phi); + break; + } + } + } + } +} + + +void HMarkDeoptimizeOnUndefinedPhase::ProcessPhi(HPhi* phi) { + ASSERT(phi->CheckFlag(HValue::kAllowUndefinedAsNaN)); + ASSERT(worklist_.is_empty()); + + // Push the phi onto the worklist + phi->ClearFlag(HValue::kAllowUndefinedAsNaN); + worklist_.Add(phi, zone()); + + // Process all phis that can reach this phi + while (!worklist_.is_empty()) { + phi = worklist_.RemoveLast(); + for (int i = phi->OperandCount() - 1; i >= 0; --i) { + HValue* input = phi->OperandAt(i); + if (input->IsPhi() && input->CheckFlag(HValue::kAllowUndefinedAsNaN)) { + input->ClearFlag(HValue::kAllowUndefinedAsNaN); + worklist_.Add(HPhi::cast(input), zone()); + } + } + } +} + +} } // namespace v8::internal diff --git a/deps/v8/src/hydrogen-mark-deoptimize.h b/deps/v8/src/hydrogen-mark-deoptimize.h new file mode 100644 index 0000000000..0aa2c2c754 --- /dev/null +++ b/deps/v8/src/hydrogen-mark-deoptimize.h @@ -0,0 +1,63 @@ +// Copyright 2013 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_HYDROGEN_MARK_DEOPTIMIZE_H_ +#define V8_HYDROGEN_MARK_DEOPTIMIZE_H_ + +#include "hydrogen.h" + +namespace v8 { +namespace internal { + + +// Compute DeoptimizeOnUndefined flag for phis. Any phi that can reach a use +// with DeoptimizeOnUndefined set must have DeoptimizeOnUndefined set. +// Currently only HCompareNumericAndBranch, with double input representation, +// has this flag set. The flag is used by HChange tagged->double, which must +// deoptimize if one of its uses has this flag set. +class HMarkDeoptimizeOnUndefinedPhase : public HPhase { + public: + explicit HMarkDeoptimizeOnUndefinedPhase(HGraph* graph) + : HPhase("H_Mark deoptimize on undefined", graph), + worklist_(16, zone()) {} + + void Run(); + + private: + void ProcessPhi(HPhi* phi); + + // Preallocated worklist used as an optimization so we don't have + // to allocate a new ZoneList for every ProcessPhi() invocation. + ZoneList<HPhi*> worklist_; + + DISALLOW_COPY_AND_ASSIGN(HMarkDeoptimizeOnUndefinedPhase); +}; + + +} } // namespace v8::internal + +#endif // V8_HYDROGEN_MARK_DEOPTIMIZE_H_ diff --git a/deps/v8/src/hydrogen.cc b/deps/v8/src/hydrogen.cc index e34688051d..0875f29112 100644 --- a/deps/v8/src/hydrogen.cc +++ b/deps/v8/src/hydrogen.cc @@ -44,6 +44,7 @@ #include "hydrogen-infer-representation.h" #include "hydrogen-infer-types.h" #include "hydrogen-gvn.h" +#include "hydrogen-mark-deoptimize.h" #include "hydrogen-minus-zero.h" #include "hydrogen-osr.h" #include "hydrogen-range-analysis.h" @@ -986,6 +987,19 @@ HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) { } +void HGraphBuilder::AddIncrementCounter(StatsCounter* counter, + HValue* context) { + if (FLAG_native_code_counters && counter->Enabled()) { + HValue* reference = Add<HConstant>(ExternalReference(counter)); + HValue* old_value = AddLoad(reference, HObjectAccess::ForCounter(), NULL); + HValue* new_value = AddInstruction( + HAdd::New(zone(), context, old_value, graph()->GetConstant1())); + new_value->ClearFlag(HValue::kCanOverflow); // Ignore counter overflow + AddStore(reference, HObjectAccess::ForCounter(), new_value); + } +} + + HBasicBlock* HGraphBuilder::CreateBasicBlock(HEnvironment* env) { HBasicBlock* b = graph()->CreateBasicBlock(); b->SetInitialEnvironment(env); @@ -1078,8 +1092,16 @@ HValue* HGraphBuilder::BuildCheckForCapacityGrow(HValue* object, HValue* context = environment()->LookupContext(); - HValue* new_capacity = BuildNewElementsCapacity(context, key); + HValue* max_gap = Add<HConstant>(static_cast<int32_t>(JSObject::kMaxGap)); + HValue* max_capacity = AddInstruction( + HAdd::New(zone, context, current_capacity, max_gap)); + IfBuilder key_checker(this); + key_checker.If<HCompareNumericAndBranch>(key, max_capacity, Token::LT); + key_checker.Then(); + key_checker.ElseDeopt(); + key_checker.End(); + HValue* new_capacity = BuildNewElementsCapacity(context, key); HValue* new_elements = BuildGrowElementsCapacity(object, elements, kind, kind, length, new_capacity); @@ -1337,6 +1359,9 @@ HValue* HGraphBuilder::BuildAllocateElementsAndInitializeElementsHeader( HValue* context, ElementsKind kind, HValue* capacity) { + // The HForceRepresentation is to prevent possible deopt on int-smi + // conversion after allocation but before the new object fields are set. + capacity = Add<HForceRepresentation>(capacity, Representation::Smi()); HValue* new_elements = BuildAllocateElements(context, kind, capacity); BuildInitializeElementsHeader(new_elements, kind, capacity); return new_elements; @@ -1474,7 +1499,6 @@ HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* context, HValue* half_old_capacity = AddInstruction(HShr::New(zone, context, old_capacity, graph_->GetConstant1())); - half_old_capacity->ClearFlag(HValue::kCanOverflow); HValue* new_capacity = AddInstruction( HAdd::New(zone, context, half_old_capacity, old_capacity)); @@ -1497,8 +1521,6 @@ void HGraphBuilder::BuildNewSpaceArrayCheck(HValue* length, ElementsKind kind) { int max_size = heap->MaxRegularSpaceAllocationSize() / element_size; max_size -= JSArray::kSize / element_size; HConstant* max_size_constant = Add<HConstant>(max_size); - // Since we're forcing Integer32 representation for this HBoundsCheck, - // there's no need to Smi-check the index. Add<HBoundsCheck>(length, max_size_constant); } @@ -1927,6 +1949,14 @@ HValue* HGraphBuilder::JSArrayBuilder::AllocateArray(HValue* size_in_bytes, bool fill_with_hole) { HValue* context = builder()->environment()->LookupContext(); + // These HForceRepresentations are because we store these as fields in the + // objects we construct, and an int32-to-smi HChange could deopt. Accept + // the deopt possibility now, before allocation occurs. + capacity = builder()->Add<HForceRepresentation>(capacity, + Representation::Smi()); + length_field = builder()->Add<HForceRepresentation>(length_field, + Representation::Smi()); + // Allocate (dealing with failure appropriately) HAllocate::Flags flags = HAllocate::DefaultFlags(kind_); HAllocate* new_object = builder()->Add<HAllocate>(context, size_in_bytes, @@ -2485,38 +2515,6 @@ void HGraph::CollectPhis() { } -void HGraph::RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi) { - if (!phi->CheckFlag(HValue::kAllowUndefinedAsNaN)) return; - phi->ClearFlag(HValue::kAllowUndefinedAsNaN); - for (int i = 0; i < phi->OperandCount(); ++i) { - HValue* input = phi->OperandAt(i); - if (input->IsPhi()) { - RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi::cast(input)); - } - } -} - - -void HGraph::MarkDeoptimizeOnUndefined() { - HPhase phase("H_MarkDeoptimizeOnUndefined", this); - // Compute DeoptimizeOnUndefined flag for phis. Any phi that can reach a use - // with DeoptimizeOnUndefined set must have DeoptimizeOnUndefined set. - // Currently only HCompareNumericAndBranch, with double input representation, - // has this flag set. The flag is used by HChange tagged->double, which must - // deoptimize if one of its uses has this flag set. - for (int i = 0; i < phi_list()->length(); i++) { - HPhi* phi = phi_list()->at(i); - for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { - HValue* use_value = it.value(); - if (!use_value->CheckFlag(HValue::kAllowUndefinedAsNaN)) { - RecursivelyMarkPhiDeoptimizeOnUndefined(phi); - break; - } - } - } -} - - // Implementation of utility class to encapsulate the translation state for // a (possibly inlined) function. FunctionState::FunctionState(HOptimizedGraphBuilder* owner, @@ -2989,7 +2987,7 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) { // This must happen after inferring representations. Run<HMergeRemovableSimulatesPhase>(); - MarkDeoptimizeOnUndefined(); + Run<HMarkDeoptimizeOnUndefinedPhase>(); Run<HRepresentationChangesPhase>(); Run<HInferTypesPhase>(); diff --git a/deps/v8/src/hydrogen.h b/deps/v8/src/hydrogen.h index 895b9849c9..8484cd1eb6 100644 --- a/deps/v8/src/hydrogen.h +++ b/deps/v8/src/hydrogen.h @@ -316,7 +316,6 @@ class HGraph: public ZoneObject { HEnvironment* start_environment() const { return start_environment_; } void FinalizeUniqueValueIds(); - void MarkDeoptimizeOnUndefined(); bool ProcessArgumentsObject(); void OrderBlocks(); void AssignDominators(); @@ -464,7 +463,6 @@ class HGraph: public ZoneObject { phase.Run(); } - void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); void SetupInformativeDefinitionsInBlock(HBasicBlock* block); void SetupInformativeDefinitionsRecursively(HBasicBlock* block); @@ -1133,6 +1131,9 @@ class HGraphBuilder { void FinishExitWithHardDeoptimization(HBasicBlock* continuation); + void AddIncrementCounter(StatsCounter* counter, + HValue* context); + class IfBuilder { public: explicit IfBuilder(HGraphBuilder* builder, diff --git a/deps/v8/src/ia32/ic-ia32.cc b/deps/v8/src/ia32/ic-ia32.cc index 1e9146847b..bf0c80b2b4 100644 --- a/deps/v8/src/ia32/ic-ia32.cc +++ b/deps/v8/src/ia32/ic-ia32.cc @@ -1591,61 +1591,6 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { } -void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { - // ----------- S t a t e ------------- - // -- ebx : target map - // -- edx : receiver - // -- esp[0] : return address - // ----------------------------------- - // Must return the modified receiver in eax. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, - FAST_DOUBLE_ELEMENTS); - ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); - __ mov(eax, edx); - __ Ret(); - __ bind(&fail); - } - - __ pop(ebx); - __ push(edx); - __ push(ebx); // return address - // Leaving the code managed by the register allocator and return to the - // convention of using esi as context register. - __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); - __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); -} - - -void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( - MacroAssembler* masm) { - // ----------- S t a t e ------------- - // -- ebx : target map - // -- edx : receiver - // -- esp[0] : return address - // ----------------------------------- - // Must return the modified receiver in eax. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, - FAST_ELEMENTS); - ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); - __ mov(eax, edx); - __ Ret(); - __ bind(&fail); - } - - __ pop(ebx); - __ push(edx); - __ push(ebx); // return address - // Leaving the code managed by the register allocator and return to the - // convention of using esi as context register. - __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); - __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); -} - - #undef __ diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.cc b/deps/v8/src/ia32/lithium-codegen-ia32.cc index d022a82f4d..3ddad068bf 100644 --- a/deps/v8/src/ia32/lithium-codegen-ia32.cc +++ b/deps/v8/src/ia32/lithium-codegen-ia32.cc @@ -685,6 +685,13 @@ double LCodeGen::ToDouble(LConstantOperand* op) const { } +ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const { + HConstant* constant = chunk_->LookupConstant(op); + ASSERT(constant->HasExternalReferenceValue()); + return constant->ExternalReferenceValue(); +} + + bool LCodeGen::IsInteger32(LConstantOperand* op) const { return chunk_->LookupLiteralRepresentation(op).IsSmiOrInteger32(); } @@ -1762,7 +1769,14 @@ void LCodeGen::DoShiftI(LShiftI* instr) { break; case Token::SHL: if (shift_count != 0) { - __ shl(ToRegister(left), shift_count); + if (instr->hydrogen_value()->representation().IsSmi() && + instr->can_deopt()) { + __ shl(ToRegister(left), shift_count - 1); + __ SmiTag(ToRegister(left)); + DeoptimizeIf(overflow, instr->environment()); + } else { + __ shl(ToRegister(left), shift_count); + } } break; default: @@ -1846,6 +1860,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { } +void LCodeGen::DoConstantE(LConstantE* instr) { + __ lea(ToRegister(instr->result()), Operand::StaticVariable(instr->value())); +} + + void LCodeGen::DoConstantT(LConstantT* instr) { Register reg = ToRegister(instr->result()); Handle<Object> handle = instr->value(); @@ -3042,6 +3061,19 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + + if (access.IsExternalMemory()) { + Register result = ToRegister(instr->result()); + if (instr->object()->IsConstantOperand()) { + ExternalReference external_reference = ToExternalReference( + LConstantOperand::cast(instr->object())); + __ mov(result, MemOperand::StaticVariable(external_reference)); + } else { + __ mov(result, MemOperand(ToRegister(instr->object()), offset)); + } + return; + } + Register object = ToRegister(instr->object()); if (FLAG_track_double_fields && instr->hydrogen()->representation().IsDouble()) { @@ -4321,10 +4353,25 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { Representation representation = instr->representation(); - Register object = ToRegister(instr->object()); HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + if (access.IsExternalMemory()) { + MemOperand operand = instr->object()->IsConstantOperand() + ? MemOperand::StaticVariable( + ToExternalReference(LConstantOperand::cast(instr->object()))) + : MemOperand(ToRegister(instr->object()), offset); + if (instr->value()->IsConstantOperand()) { + LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); + __ mov(operand, Immediate(ToInteger32(operand_value))); + } else { + Register value = ToRegister(instr->value()); + __ mov(operand, value); + } + return; + } + + Register object = ToRegister(instr->object()); Handle<Map> transition = instr->transition(); if (FLAG_track_fields && representation.IsSmi()) { @@ -4389,8 +4436,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { Register write_register = object; if (!access.IsInobject()) { write_register = ToRegister(instr->temp()); - __ mov(write_register, - FieldOperand(object, JSObject::kPropertiesOffset)); + __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); } if (instr->value()->IsConstantOperand()) { @@ -4708,7 +4754,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ RecordWriteForMap(object_reg, to_map, new_map_reg, ToRegister(instr->temp()), kDontSaveFPRegs); - } else if (FLAG_compiled_transitions) { + } else { PushSafepointRegistersScope scope(this); if (!object_reg.is(eax)) { __ push(object_reg); @@ -4722,28 +4768,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ CallStub(&stub); RecordSafepointWithRegisters( instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); - } else if (IsFastSmiElementsKind(from_kind) && - IsFastDoubleElementsKind(to_kind)) { - Register new_map_reg = ToRegister(instr->new_map_temp()); - __ mov(new_map_reg, to_map); - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(edx)); - ASSERT(new_map_reg.is(ebx)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), - RelocInfo::CODE_TARGET, instr); - } else if (IsFastDoubleElementsKind(from_kind) && - IsFastObjectElementsKind(to_kind)) { - Register new_map_reg = ToRegister(instr->new_map_temp()); - __ mov(new_map_reg, to_map); - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(edx)); - ASSERT(new_map_reg.is(ebx)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), - RelocInfo::CODE_TARGET, instr); - } else { - UNREACHABLE(); } __ bind(¬_applicable); } diff --git a/deps/v8/src/ia32/lithium-codegen-ia32.h b/deps/v8/src/ia32/lithium-codegen-ia32.h index 657453231e..27295da8b8 100644 --- a/deps/v8/src/ia32/lithium-codegen-ia32.h +++ b/deps/v8/src/ia32/lithium-codegen-ia32.h @@ -297,6 +297,7 @@ class LCodeGen BASE_EMBEDDED { X87Register ToX87Register(int index) const; int ToRepresentation(LConstantOperand* op, const Representation& r) const; int32_t ToInteger32(LConstantOperand* op) const; + ExternalReference ToExternalReference(LConstantOperand* op) const; Operand BuildFastArrayOperand(LOperand* elements_pointer, LOperand* key, diff --git a/deps/v8/src/ia32/lithium-ia32.cc b/deps/v8/src/ia32/lithium-ia32.cc index f03cd72bec..8c8103f619 100644 --- a/deps/v8/src/ia32/lithium-ia32.cc +++ b/deps/v8/src/ia32/lithium-ia32.cc @@ -761,7 +761,7 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { LInstruction* LChunkBuilder::DoShift(Token::Value op, HBitwiseBinaryOperation* instr) { - if (instr->representation().IsSmiOrTagged()) { + if (instr->representation().IsTagged()) { ASSERT(instr->left()->representation().IsSmiOrTagged()); ASSERT(instr->right()->representation().IsSmiOrTagged()); @@ -772,25 +772,35 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, return MarkAsCall(DefineFixed(result, eax), instr); } - ASSERT(instr->representation().IsInteger32()); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->representation().IsSmiOrInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); HValue* right_value = instr->right(); LOperand* right = NULL; int constant_value = 0; + bool does_deopt = false; if (right_value->IsConstant()) { HConstant* constant = HConstant::cast(right_value); right = chunk_->DefineConstantOperand(constant); constant_value = constant->Integer32Value() & 0x1f; + // Left shifts can deoptimize if we shift by > 0 and the result cannot be + // truncated to smi. + if (instr->representation().IsSmi() && constant_value > 0) { + for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { + if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { + does_deopt = true; + break; + } + } + } } else { right = UseFixed(right_value, ecx); } // Shift operations can only deoptimize if we do a logical shift by 0 and // the result cannot be truncated to int32. - bool does_deopt = false; if (op == Token::SHR && constant_value == 0) { if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); @@ -2136,6 +2146,8 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { bool value_is_zero = BitCast<uint64_t, double>(value) == 0; LOperand* temp = value_is_zero ? NULL : TempRegister(); return DefineAsRegister(new(zone()) LConstantD(temp)); + } else if (r.IsExternal()) { + return DefineAsRegister(new(zone()) LConstantE); } else if (r.IsTagged()) { return DefineAsRegister(new(zone()) LConstantT); } else { @@ -2212,7 +2224,10 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { - LOperand* obj = UseRegisterAtStart(instr->object()); + LOperand* obj = (instr->access().IsExternalMemory() && + instr->access().offset() == 0) + ? UseRegisterOrConstantAtStart(instr->object()) + : UseRegisterAtStart(instr->object()); return DefineAsRegister(new(zone()) LLoadNamedField(obj)); } @@ -2405,21 +2420,11 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind( new(zone()) LTransitionElementsKind(object, NULL, new_map_reg, temp_reg); return result; - } else if (FLAG_compiled_transitions) { + } else { LOperand* context = UseRegister(instr->context()); LTransitionElementsKind* result = new(zone()) LTransitionElementsKind(object, context, NULL, NULL); return AssignPointerMap(result); - } else { - LOperand* object = UseFixed(instr->object(), eax); - LOperand* fixed_object_reg = FixedTemp(edx); - LOperand* new_map_reg = FixedTemp(ebx); - LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, - NULL, - new_map_reg, - fixed_object_reg); - return MarkAsCall(result, instr); } } @@ -2436,6 +2441,8 @@ LInstruction* LChunkBuilder::DoTrapAllocationMemento( LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { bool is_in_object = instr->access().IsInobject(); + bool is_external_location = instr->access().IsExternalMemory() && + instr->access().offset() == 0; bool needs_write_barrier = instr->NeedsWriteBarrier(); bool needs_write_barrier_for_map = !instr->transition().is_null() && instr->NeedsWriteBarrierForMap(); @@ -2445,6 +2452,11 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { obj = is_in_object ? UseRegister(instr->object()) : UseTempRegister(instr->object()); + } else if (is_external_location) { + ASSERT(!is_in_object); + ASSERT(!needs_write_barrier); + ASSERT(!needs_write_barrier_for_map); + obj = UseRegisterOrConstant(instr->object()); } else { obj = needs_write_barrier_for_map ? UseRegister(instr->object()) diff --git a/deps/v8/src/ia32/lithium-ia32.h b/deps/v8/src/ia32/lithium-ia32.h index 85c04685ba..6a2aa00654 100644 --- a/deps/v8/src/ia32/lithium-ia32.h +++ b/deps/v8/src/ia32/lithium-ia32.h @@ -80,6 +80,7 @@ class LCodeGen; V(CmpMapAndBranch) \ V(CmpT) \ V(ConstantD) \ + V(ConstantE) \ V(ConstantI) \ V(ConstantS) \ V(ConstantT) \ @@ -271,7 +272,7 @@ class LInstruction: public ZoneObject { } virtual bool HasResult() const = 0; - virtual LOperand* result() = 0; + virtual LOperand* result() const = 0; bool HasDoubleRegisterResult(); bool HasDoubleRegisterInput(); @@ -311,9 +312,9 @@ class LTemplateInstruction: public LInstruction { public: // Allow 0 or 1 output operands. STATIC_ASSERT(R == 0 || R == 1); - virtual bool HasResult() const { return R != 0; } + virtual bool HasResult() const { return R != 0 && result() != NULL; } void set_result(LOperand* operand) { results_[0] = operand; } - LOperand* result() { return results_[0]; } + LOperand* result() const { return results_[0]; } protected: EmbeddedContainer<LOperand*, R> results_; @@ -1208,6 +1209,17 @@ class LConstantD: public LTemplateInstruction<1, 0, 1> { }; +class LConstantE: public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") + DECLARE_HYDROGEN_ACCESSOR(Constant) + + ExternalReference value() const { + return hydrogen()->ExternalReferenceValue(); + } +}; + + class LConstantT: public LTemplateInstruction<1, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") diff --git a/deps/v8/src/ia32/macro-assembler-ia32.cc b/deps/v8/src/ia32/macro-assembler-ia32.cc index 2ab5a25932..6d1cb16c62 100644 --- a/deps/v8/src/ia32/macro-assembler-ia32.cc +++ b/deps/v8/src/ia32/macro-assembler-ia32.cc @@ -1933,7 +1933,7 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, // If false, it is returned as a pointer to a preallocated by caller memory // region. Pointer to this region should be passed to a function as an // implicit first argument. -#if defined(USING_BSD_ABI) || defined(__MINGW32__) || defined(__CYGWIN__) +#if V8_OS_BSD4 || V8_OS_MINGW32 || V8_OS_CYGWIN static const bool kReturnHandlesDirectly = true; #else static const bool kReturnHandlesDirectly = false; diff --git a/deps/v8/src/ic.h b/deps/v8/src/ic.h index c9f521f145..7820d407ec 100644 --- a/deps/v8/src/ic.h +++ b/deps/v8/src/ic.h @@ -649,8 +649,6 @@ class KeyedStoreIC: public StoreIC { StrictModeFlag strict_mode); static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); static void GenerateNonStrictArguments(MacroAssembler* masm); - static void GenerateTransitionElementsSmiToDouble(MacroAssembler* masm); - static void GenerateTransitionElementsDoubleToObject(MacroAssembler* masm); protected: virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index ccd6f280dc..61f1e2dcfa 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -816,9 +816,9 @@ Handle<JSArray> Isolate::CaptureCurrentStackTrace( } if (options & StackTrace::kIsEval) { - int type = Smi::cast(script->compilation_type())->value(); - Handle<Object> is_eval = (type == Script::COMPILATION_TYPE_EVAL) ? - factory()->true_value() : factory()->false_value(); + Handle<Object> is_eval = + script->compilation_type() == Script::COMPILATION_TYPE_EVAL ? + factory()->true_value() : factory()->false_value(); CHECK_NOT_EMPTY_HANDLE(this, JSObject::SetLocalPropertyIgnoreAttributes( stack_frame, eval_key, is_eval, NONE)); @@ -844,6 +844,11 @@ Handle<JSArray> Isolate::CaptureCurrentStackTrace( } +void Isolate::PrintStack() { + PrintStack(stdout); +} + + void Isolate::PrintStack(FILE* out) { if (stack_trace_nesting_level_ == 0) { stack_trace_nesting_level_++; @@ -1777,6 +1782,7 @@ Isolate::Isolate() regexp_stack_(NULL), date_cache_(NULL), code_stub_interface_descriptors_(NULL), + context_exit_happened_(false), initialized_from_snapshot_(false), cpu_profiler_(NULL), heap_profiler_(NULL), diff --git a/deps/v8/src/isolate.h b/deps/v8/src/isolate.h index 065277093e..c008317737 100644 --- a/deps/v8/src/isolate.h +++ b/deps/v8/src/isolate.h @@ -737,6 +737,7 @@ class Isolate { void PrintStackTrace(FILE* out, char* thread_data); void PrintStack(StringStream* accumulator); void PrintStack(FILE* out); + void PrintStack(); Handle<String> StackTraceString(); NO_INLINE(void PushStackTraceAndDie(unsigned int magic, Object* object, @@ -1059,6 +1060,13 @@ class Isolate { thread_local_top_.top_lookup_result_ = top; } + bool context_exit_happened() { + return context_exit_happened_; + } + void set_context_exit_happened(bool context_exit_happened) { + context_exit_happened_ = context_exit_happened; + } + bool initialized_from_snapshot() { return initialized_from_snapshot_; } double time_millis_since_init() { @@ -1306,6 +1314,10 @@ class Isolate { unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; + // The garbage collector should be a little more aggressive when it knows + // that a context was recently exited. + bool context_exit_happened_; + // True if this isolate was initialized from a snapshot. bool initialized_from_snapshot_; diff --git a/deps/v8/src/liveedit.cc b/deps/v8/src/liveedit.cc index b998a26dd7..859cf2b94f 100644 --- a/deps/v8/src/liveedit.cc +++ b/deps/v8/src/liveedit.cc @@ -1290,7 +1290,6 @@ MaybeObject* LiveEdit::ReplaceFunctionCode( if (code_scope_info->IsFixedArray()) { shared_info->set_scope_info(ScopeInfo::cast(*code_scope_info)); } - shared_info->DisableOptimization("LiveEdit"); } if (shared_info->debug_info()->IsDebugInfo()) { @@ -1558,11 +1557,14 @@ static Handle<Script> CreateScriptCopy(Handle<Script> original) { copy->set_data(original->data()); copy->set_type(original->type()); copy->set_context_data(original->context_data()); - copy->set_compilation_type(original->compilation_type()); copy->set_eval_from_shared(original->eval_from_shared()); copy->set_eval_from_instructions_offset( original->eval_from_instructions_offset()); + // Copy all the flags, but clear compilation state. + copy->set_flags(original->flags()); + copy->set_compilation_state(Script::COMPILATION_STATE_INITIAL); + return copy; } diff --git a/deps/v8/src/log-utils.cc b/deps/v8/src/log-utils.cc index d8d8f5934f..6bba8823e3 100644 --- a/deps/v8/src/log-utils.cc +++ b/deps/v8/src/log-utils.cc @@ -66,10 +66,9 @@ void Log::Initialize(const char* log_file_name) { // --prof implies --log-code. if (FLAG_prof) FLAG_log_code = true; - // --prof_lazy controls --log-code, implies --noprof_auto. + // --prof_lazy controls --log-code. if (FLAG_prof_lazy) { FLAG_log_code = false; - FLAG_prof_auto = false; } // If we're logging anything, we need to open the log file. diff --git a/deps/v8/src/log.cc b/deps/v8/src/log.cc index 520723e342..b89c2bfba0 100644 --- a/deps/v8/src/log.cc +++ b/deps/v8/src/log.cc @@ -54,6 +54,11 @@ static const char* const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS] = { #undef DECLARE_EVENT +#define CALL_LISTENERS(Call) \ +for (int i = 0; i < listeners_.length(); ++i) { \ + listeners_[i]->Call; \ +} + #define PROFILER_LOG(Call) \ do { \ CpuProfiler* cpu_profiler = isolate_->cpu_profiler(); \ @@ -72,220 +77,193 @@ static const char* ComputeMarker(Code* code) { } -class CodeEventLogger { +class CodeEventLogger::NameBuffer { public: - virtual ~CodeEventLogger() { } - - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - const char* comment); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - Name* name); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - int args_count); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* name); - void CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* source, - int line); - void RegExpCodeCreateEvent(Code* code, String* source); - - protected: - class NameBuffer { - public: - NameBuffer() { Reset(); } - - void Reset() { - utf8_pos_ = 0; - } + NameBuffer() { Reset(); } - void Init(Logger::LogEventsAndTags tag) { - Reset(); - AppendBytes(kLogEventsNames[tag]); - AppendByte(':'); - } + void Reset() { + utf8_pos_ = 0; + } - void AppendName(Name* name) { - if (name->IsString()) { - AppendString(String::cast(name)); - } else { - Symbol* symbol = Symbol::cast(name); - AppendBytes("symbol("); - if (!symbol->name()->IsUndefined()) { - AppendBytes("\""); - AppendString(String::cast(symbol->name())); - AppendBytes("\" "); - } - AppendBytes("hash "); - AppendHex(symbol->Hash()); - AppendByte(')'); + void Init(Logger::LogEventsAndTags tag) { + Reset(); + AppendBytes(kLogEventsNames[tag]); + AppendByte(':'); + } + + void AppendName(Name* name) { + if (name->IsString()) { + AppendString(String::cast(name)); + } else { + Symbol* symbol = Symbol::cast(name); + AppendBytes("symbol("); + if (!symbol->name()->IsUndefined()) { + AppendBytes("\""); + AppendString(String::cast(symbol->name())); + AppendBytes("\" "); } + AppendBytes("hash "); + AppendHex(symbol->Hash()); + AppendByte(')'); } + } - void AppendString(String* str) { - if (str == NULL) return; - int uc16_length = Min(str->length(), kUtf16BufferSize); - String::WriteToFlat(str, utf16_buffer, 0, uc16_length); - int previous = unibrow::Utf16::kNoPreviousCharacter; - for (int i = 0; i < uc16_length && utf8_pos_ < kUtf8BufferSize; ++i) { - uc16 c = utf16_buffer[i]; - if (c <= unibrow::Utf8::kMaxOneByteChar) { - utf8_buffer_[utf8_pos_++] = static_cast<char>(c); - } else { - int char_length = unibrow::Utf8::Length(c, previous); - if (utf8_pos_ + char_length > kUtf8BufferSize) break; - unibrow::Utf8::Encode(utf8_buffer_ + utf8_pos_, c, previous); - utf8_pos_ += char_length; - } - previous = c; + void AppendString(String* str) { + if (str == NULL) return; + int uc16_length = Min(str->length(), kUtf16BufferSize); + String::WriteToFlat(str, utf16_buffer, 0, uc16_length); + int previous = unibrow::Utf16::kNoPreviousCharacter; + for (int i = 0; i < uc16_length && utf8_pos_ < kUtf8BufferSize; ++i) { + uc16 c = utf16_buffer[i]; + if (c <= unibrow::Utf8::kMaxOneByteChar) { + utf8_buffer_[utf8_pos_++] = static_cast<char>(c); + } else { + int char_length = unibrow::Utf8::Length(c, previous); + if (utf8_pos_ + char_length > kUtf8BufferSize) break; + unibrow::Utf8::Encode(utf8_buffer_ + utf8_pos_, c, previous); + utf8_pos_ += char_length; } + previous = c; } + } - void AppendBytes(const char* bytes, int size) { - size = Min(size, kUtf8BufferSize - utf8_pos_); - OS::MemCopy(utf8_buffer_ + utf8_pos_, bytes, size); - utf8_pos_ += size; - } + void AppendBytes(const char* bytes, int size) { + size = Min(size, kUtf8BufferSize - utf8_pos_); + OS::MemCopy(utf8_buffer_ + utf8_pos_, bytes, size); + utf8_pos_ += size; + } - void AppendBytes(const char* bytes) { - AppendBytes(bytes, StrLength(bytes)); - } + void AppendBytes(const char* bytes) { + AppendBytes(bytes, StrLength(bytes)); + } - void AppendByte(char c) { - if (utf8_pos_ >= kUtf8BufferSize) return; - utf8_buffer_[utf8_pos_++] = c; - } + void AppendByte(char c) { + if (utf8_pos_ >= kUtf8BufferSize) return; + utf8_buffer_[utf8_pos_++] = c; + } - void AppendInt(int n) { - Vector<char> buffer(utf8_buffer_ + utf8_pos_, - kUtf8BufferSize - utf8_pos_); - int size = OS::SNPrintF(buffer, "%d", n); - if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { - utf8_pos_ += size; - } + void AppendInt(int n) { + Vector<char> buffer(utf8_buffer_ + utf8_pos_, + kUtf8BufferSize - utf8_pos_); + int size = OS::SNPrintF(buffer, "%d", n); + if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { + utf8_pos_ += size; } + } - void AppendHex(uint32_t n) { - Vector<char> buffer(utf8_buffer_ + utf8_pos_, - kUtf8BufferSize - utf8_pos_); - int size = OS::SNPrintF(buffer, "%x", n); - if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { - utf8_pos_ += size; - } + void AppendHex(uint32_t n) { + Vector<char> buffer(utf8_buffer_ + utf8_pos_, + kUtf8BufferSize - utf8_pos_); + int size = OS::SNPrintF(buffer, "%x", n); + if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { + utf8_pos_ += size; } + } - const char* get() { return utf8_buffer_; } - int size() const { return utf8_pos_; } - - private: - static const int kUtf8BufferSize = 512; - static const int kUtf16BufferSize = 128; - - int utf8_pos_; - char utf8_buffer_[kUtf8BufferSize]; - uc16 utf16_buffer[kUtf16BufferSize]; - }; + const char* get() { return utf8_buffer_; } + int size() const { return utf8_pos_; } private: - virtual void LogRecordedBuffer(Code* code, - SharedFunctionInfo* shared, - NameBuffer* name_buffer) = 0; + static const int kUtf8BufferSize = 512; + static const int kUtf16BufferSize = 128; - NameBuffer name_buffer_; + int utf8_pos_; + char utf8_buffer_[kUtf8BufferSize]; + uc16 utf16_buffer[kUtf16BufferSize]; }; +CodeEventLogger::CodeEventLogger() : name_buffer_(new NameBuffer) { } + +CodeEventLogger::~CodeEventLogger() { delete name_buffer_; } + + void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, const char* comment) { - name_buffer_.Init(tag); - name_buffer_.AppendBytes(comment); - LogRecordedBuffer(code, NULL, &name_buffer_); + name_buffer_->Init(tag); + name_buffer_->AppendBytes(comment); + LogRecordedBuffer(code, NULL, name_buffer_->get(), name_buffer_->size()); } void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, Name* name) { - name_buffer_.Init(tag); - name_buffer_.AppendName(name); - LogRecordedBuffer(code, NULL, &name_buffer_); + name_buffer_->Init(tag); + name_buffer_->AppendName(name); + LogRecordedBuffer(code, NULL, name_buffer_->get(), name_buffer_->size()); } void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* name) { - name_buffer_.Init(tag); - name_buffer_.AppendBytes(ComputeMarker(code)); - name_buffer_.AppendName(name); - LogRecordedBuffer(code, shared, &name_buffer_); + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* name) { + name_buffer_->Init(tag); + name_buffer_->AppendBytes(ComputeMarker(code)); + name_buffer_->AppendName(name); + LogRecordedBuffer(code, shared, name_buffer_->get(), name_buffer_->size()); } void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, - Code* code, - SharedFunctionInfo* shared, - CompilationInfo* info, - Name* source, int line) { - name_buffer_.Init(tag); - name_buffer_.AppendBytes(ComputeMarker(code)); - name_buffer_.AppendString(shared->DebugName()); - name_buffer_.AppendByte(' '); + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* source, int line) { + name_buffer_->Init(tag); + name_buffer_->AppendBytes(ComputeMarker(code)); + name_buffer_->AppendString(shared->DebugName()); + name_buffer_->AppendByte(' '); if (source->IsString()) { - name_buffer_.AppendString(String::cast(source)); + name_buffer_->AppendString(String::cast(source)); } else { - name_buffer_.AppendBytes("symbol(hash "); - name_buffer_.AppendHex(Name::cast(source)->Hash()); - name_buffer_.AppendByte(')'); + name_buffer_->AppendBytes("symbol(hash "); + name_buffer_->AppendHex(Name::cast(source)->Hash()); + name_buffer_->AppendByte(')'); } - name_buffer_.AppendByte(':'); - name_buffer_.AppendInt(line); - LogRecordedBuffer(code, shared, &name_buffer_); + name_buffer_->AppendByte(':'); + name_buffer_->AppendInt(line); + LogRecordedBuffer(code, shared, name_buffer_->get(), name_buffer_->size()); } void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, Code* code, int args_count) { - name_buffer_.Init(tag); - name_buffer_.AppendInt(args_count); - LogRecordedBuffer(code, NULL, &name_buffer_); + name_buffer_->Init(tag); + name_buffer_->AppendInt(args_count); + LogRecordedBuffer(code, NULL, name_buffer_->get(), name_buffer_->size()); } void CodeEventLogger::RegExpCodeCreateEvent(Code* code, String* source) { - name_buffer_.Init(Logger::REG_EXP_TAG); - name_buffer_.AppendString(source); - LogRecordedBuffer(code, NULL, &name_buffer_); + name_buffer_->Init(Logger::REG_EXP_TAG); + name_buffer_->AppendString(source); + LogRecordedBuffer(code, NULL, name_buffer_->get(), name_buffer_->size()); } // Low-level logging support. +#define LL_LOG(Call) if (ll_logger_) ll_logger_->Call; + class LowLevelLogger : public CodeEventLogger { public: explicit LowLevelLogger(const char* file_name); virtual ~LowLevelLogger(); - void CodeMoveEvent(Address from, Address to); - void CodeDeleteEvent(Address from); - void SnapshotPositionEvent(Address addr, int pos); - void CodeMovingGCEvent(); + virtual void CodeMoveEvent(Address from, Address to); + virtual void CodeDeleteEvent(Address from); + virtual void SnapshotPositionEvent(Address addr, int pos); + virtual void CodeMovingGCEvent(); private: virtual void LogRecordedBuffer(Code* code, SharedFunctionInfo* shared, - NameBuffer* name_buffer); + const char* name, + int length); // Low-level profiling event structures. struct CodeCreateStruct { @@ -383,14 +361,15 @@ void LowLevelLogger::LogCodeInfo() { void LowLevelLogger::LogRecordedBuffer(Code* code, SharedFunctionInfo*, - NameBuffer* name_buffer) { + const char* name, + int length) { CodeCreateStruct event; - event.name_size = name_buffer->size(); + event.name_size = length; event.code_address = code->instruction_start(); ASSERT(event.code_address == code->address() + Code::kHeaderSize); event.code_size = code->instruction_size(); LogWriteStruct(event); - LogWriteBytes(name_buffer->get(), name_buffer->size()); + LogWriteBytes(name, length); LogWriteBytes( reinterpret_cast<const char*>(code->instruction_start()), code->instruction_size()); @@ -434,143 +413,33 @@ void LowLevelLogger::CodeMovingGCEvent() { } -#define LL_LOG(Call) if (ll_logger_) ll_logger_->Call; - - -class CodeAddressMap: public CodeEventLogger { - public: - CodeAddressMap() { } - virtual ~CodeAddressMap() { } - - void CodeMoveEvent(Address from, Address to) { - address_to_name_map_.Move(from, to); - } - - void CodeDeleteEvent(Address from) { - address_to_name_map_.Remove(from); - } - - const char* Lookup(Address address) { - return address_to_name_map_.Lookup(address); - } - - private: - class NameMap { - public: - NameMap() : impl_(&PointerEquals) {} - - ~NameMap() { - for (HashMap::Entry* p = impl_.Start(); p != NULL; p = impl_.Next(p)) { - DeleteArray(static_cast<const char*>(p->value)); - } - } - - void Insert(Address code_address, const char* name, int name_size) { - HashMap::Entry* entry = FindOrCreateEntry(code_address); - if (entry->value == NULL) { - entry->value = CopyName(name, name_size); - } - } - - const char* Lookup(Address code_address) { - HashMap::Entry* entry = FindEntry(code_address); - return (entry != NULL) ? static_cast<const char*>(entry->value) : NULL; - } - - void Remove(Address code_address) { - HashMap::Entry* entry = FindEntry(code_address); - if (entry != NULL) { - DeleteArray(static_cast<char*>(entry->value)); - RemoveEntry(entry); - } - } - - void Move(Address from, Address to) { - if (from == to) return; - HashMap::Entry* from_entry = FindEntry(from); - ASSERT(from_entry != NULL); - void* value = from_entry->value; - RemoveEntry(from_entry); - HashMap::Entry* to_entry = FindOrCreateEntry(to); - ASSERT(to_entry->value == NULL); - to_entry->value = value; - } - - private: - static bool PointerEquals(void* lhs, void* rhs) { - return lhs == rhs; - } - - static char* CopyName(const char* name, int name_size) { - char* result = NewArray<char>(name_size + 1); - for (int i = 0; i < name_size; ++i) { - char c = name[i]; - if (c == '\0') c = ' '; - result[i] = c; - } - result[name_size] = '\0'; - return result; - } - - HashMap::Entry* FindOrCreateEntry(Address code_address) { - return impl_.Lookup(code_address, ComputePointerHash(code_address), true); - } - - HashMap::Entry* FindEntry(Address code_address) { - return impl_.Lookup(code_address, - ComputePointerHash(code_address), - false); - } - - void RemoveEntry(HashMap::Entry* entry) { - impl_.Remove(entry->key, entry->hash); - } - - HashMap impl_; - - DISALLOW_COPY_AND_ASSIGN(NameMap); - }; - - virtual void LogRecordedBuffer(Code* code, - SharedFunctionInfo*, - NameBuffer* name_buffer) { - address_to_name_map_.Insert(code->address(), - name_buffer->get(), - name_buffer->size()); - } - - NameMap address_to_name_map_; -}; - - -#define CODE_ADDRESS_MAP_LOG(Call)\ - if (Serializer::enabled()) code_address_map_->Call; +#define JIT_LOG(Call) if (jit_logger_) jit_logger_->Call; class JitLogger : public CodeEventLogger { public: explicit JitLogger(JitCodeEventHandler code_event_handler); - void CodeMoveEvent(Address from, Address to); - void CodeDeleteEvent(Address from); - void AddCodeLinePosInfoEvent( + virtual void CodeMoveEvent(Address from, Address to); + virtual void CodeDeleteEvent(Address from); + virtual void AddCodeLinePosInfoEvent( void* jit_handler_data, int pc_offset, int position, JitCodeEvent::PositionType position_type); + void* StartCodePosInfoEvent(); void EndCodePosInfoEvent(Code* code, void* jit_handler_data); private: virtual void LogRecordedBuffer(Code* code, SharedFunctionInfo* shared, - CodeEventLogger::NameBuffer* name_buffer); + const char* name, + int length); JitCodeEventHandler code_event_handler_; }; -#define JIT_LOG(Call) if (jit_logger_) jit_logger_->Call; - JitLogger::JitLogger(JitCodeEventHandler code_event_handler) : code_event_handler_(code_event_handler) { @@ -579,7 +448,8 @@ JitLogger::JitLogger(JitCodeEventHandler code_event_handler) void JitLogger::LogRecordedBuffer(Code* code, SharedFunctionInfo* shared, - CodeEventLogger::NameBuffer* name_buffer) { + const char* name, + int length) { JitCodeEvent event; memset(&event, 0, sizeof(event)); event.type = JitCodeEvent::CODE_ADDED; @@ -590,8 +460,8 @@ void JitLogger::LogRecordedBuffer(Code* code, script_handle = Handle<Script>(Script::cast(shared->script())); } event.script = ToApiHandle<v8::Script>(script_handle); - event.name.str = name_buffer->get(); - event.name.len = name_buffer->size(); + event.name.str = name; + event.name.len = length; code_event_handler_(&event); } @@ -844,23 +714,34 @@ Logger::Logger(Isolate* isolate) log_(new Log(this)), ll_logger_(NULL), jit_logger_(NULL), - code_address_map_(new CodeAddressMap), + listeners_(5), is_initialized_(false), - last_address_(NULL), - prev_sp_(NULL), - prev_function_(NULL), - prev_to_(NULL), - prev_code_(NULL), epoch_(0) { } Logger::~Logger() { - delete code_address_map_; delete log_; } +void Logger::addCodeEventListener(CodeEventListener* listener) { + ASSERT(!hasCodeEventListener(listener)); + listeners_.Add(listener); +} + + +void Logger::removeCodeEventListener(CodeEventListener* listener) { + ASSERT(hasCodeEventListener(listener)); + listeners_.RemoveElement(listener); +} + + +bool Logger::hasCodeEventListener(CodeEventListener* listener) { + return listeners_.Contains(listener); +} + + void Logger::ProfilerBeginEvent() { if (!log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1279,9 +1160,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, PROFILER_LOG(CodeCreateEvent(tag, code, comment)); if (!is_logging_code_events()) return; - JIT_LOG(CodeCreateEvent(tag, code, comment)); - LL_LOG(CodeCreateEvent(tag, code, comment)); - CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, comment)); + CALL_LISTENERS(CodeCreateEvent(tag, code, comment)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1298,9 +1177,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, PROFILER_LOG(CodeCreateEvent(tag, code, name)); if (!is_logging_code_events()) return; - JIT_LOG(CodeCreateEvent(tag, code, name)); - LL_LOG(CodeCreateEvent(tag, code, name)); - CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, name)); + CALL_LISTENERS(CodeCreateEvent(tag, code, name)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1325,9 +1202,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name)); if (!is_logging_code_events()) return; - JIT_LOG(CodeCreateEvent(tag, code, shared, info, name)); - LL_LOG(CodeCreateEvent(tag, code, shared, info, name)); - CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, shared, info, name)); + CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name)); if (!FLAG_log_code || !log_->IsEnabled()) return; if (code == isolate_->builtins()->builtin( @@ -1362,9 +1237,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); if (!is_logging_code_events()) return; - JIT_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); - LL_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); - CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); + CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, source, line)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1393,9 +1266,7 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, PROFILER_LOG(CodeCreateEvent(tag, code, args_count)); if (!is_logging_code_events()) return; - JIT_LOG(CodeCreateEvent(tag, code, args_count)); - LL_LOG(CodeCreateEvent(tag, code, args_count)); - CODE_ADDRESS_MAP_LOG(CodeCreateEvent(tag, code, args_count)); + CALL_LISTENERS(CodeCreateEvent(tag, code, args_count)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1411,7 +1282,7 @@ void Logger::CodeMovingGCEvent() { if (!is_logging_code_events()) return; if (!log_->IsEnabled() || !FLAG_ll_prof) return; - LL_LOG(CodeMovingGCEvent()); + CALL_LISTENERS(CodeMovingGCEvent()); OS::SignalCodeMovingGC(); } @@ -1420,9 +1291,7 @@ void Logger::RegExpCodeCreateEvent(Code* code, String* source) { PROFILER_LOG(RegExpCodeCreateEvent(code, source)); if (!is_logging_code_events()) return; - JIT_LOG(RegExpCodeCreateEvent(code, source)); - LL_LOG(RegExpCodeCreateEvent(code, source)); - CODE_ADDRESS_MAP_LOG(RegExpCodeCreateEvent(code, source)); + CALL_LISTENERS(RegExpCodeCreateEvent(code, source)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1439,9 +1308,7 @@ void Logger::CodeMoveEvent(Address from, Address to) { PROFILER_LOG(CodeMoveEvent(from, to)); if (!is_logging_code_events()) return; - JIT_LOG(CodeMoveEvent(from, to)); - LL_LOG(CodeMoveEvent(from, to)); - CODE_ADDRESS_MAP_LOG(CodeMoveEvent(from, to)); + CALL_LISTENERS(CodeMoveEvent(from, to)); MoveEventInternal(CODE_MOVE_EVENT, from, to); } @@ -1450,9 +1317,7 @@ void Logger::CodeDeleteEvent(Address from) { PROFILER_LOG(CodeDeleteEvent(from)); if (!is_logging_code_events()) return; - JIT_LOG(CodeDeleteEvent(from)); - LL_LOG(CodeDeleteEvent(from)); - CODE_ADDRESS_MAP_LOG(CodeDeleteEvent(from)); + CALL_LISTENERS(CodeDeleteEvent(from)); if (!FLAG_log_code || !log_->IsEnabled()) return; Log::MessageBuilder msg(log_); @@ -1496,18 +1361,19 @@ void Logger::CodeEndLinePosInfoRecordEvent(Code* code, } +void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) { + if (code_name == NULL) return; // Not a code object. + Log::MessageBuilder msg(log_); + msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); + msg.AppendDoubleQuotedString(code_name); + msg.Append("\n"); + msg.WriteToLogFile(); +} + + void Logger::SnapshotPositionEvent(Address addr, int pos) { if (!log_->IsEnabled()) return; LL_LOG(SnapshotPositionEvent(addr, pos)); - if (Serializer::enabled()) { - const char* code_name = code_address_map_->Lookup(addr); - if (code_name == NULL) return; // Not a code object. - Log::MessageBuilder msg(log_); - msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); - msg.AppendDoubleQuotedString(code_name); - msg.Append("\n"); - msg.WriteToLogFile(); - } if (!FLAG_log_snapshot_positions) return; Log::MessageBuilder msg(log_); msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]); @@ -1998,10 +1864,9 @@ bool Logger::SetUp(Isolate* isolate) { FLAG_log_snapshot_positions = true; } - // --prof_lazy controls --log-code, implies --noprof_auto. + // --prof_lazy controls --log-code. if (FLAG_prof_lazy) { FLAG_log_code = false; - FLAG_prof_auto = false; } SmartArrayPointer<const char> log_file_name = @@ -2010,6 +1875,7 @@ bool Logger::SetUp(Isolate* isolate) { if (FLAG_ll_prof) { ll_logger_ = new LowLevelLogger(*log_file_name); + addCodeEventListener(ll_logger_); } ticker_ = new Ticker(isolate, kSamplingIntervalMs); @@ -2020,12 +1886,10 @@ bool Logger::SetUp(Isolate* isolate) { if (FLAG_prof) { profiler_ = new Profiler(isolate); - if (!FLAG_prof_auto) { + if (FLAG_prof_lazy) { profiler_->pause(); } else { logging_nesting_ = 1; - } - if (!FLAG_prof_lazy) { profiler_->Engage(); } } @@ -2039,18 +1903,19 @@ bool Logger::SetUp(Isolate* isolate) { void Logger::SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler) { if (jit_logger_) { + removeCodeEventListener(jit_logger_); delete jit_logger_; jit_logger_ = NULL; } if (event_handler) { jit_logger_ = new JitLogger(event_handler); - } - - if (jit_logger_ != NULL && (options & kJitCodeEventEnumExisting)) { - HandleScope scope(isolate_); - LogCodeObjects(); - LogCompiledFunctions(); + addCodeEventListener(jit_logger_); + if (options & kJitCodeEventEnumExisting) { + HandleScope scope(isolate_); + LogCodeObjects(); + LogCompiledFunctions(); + } } } @@ -2075,11 +1940,13 @@ FILE* Logger::TearDown() { ticker_ = NULL; if (ll_logger_) { + removeCodeEventListener(ll_logger_); delete ll_logger_; ll_logger_ = NULL; } if (jit_logger_) { + removeCodeEventListener(jit_logger_); delete jit_logger_; jit_logger_ = NULL; } diff --git a/deps/v8/src/log.h b/deps/v8/src/log.h index 194ad9d015..24d83ef127 100644 --- a/deps/v8/src/log.h +++ b/deps/v8/src/log.h @@ -70,7 +70,7 @@ namespace internal { // tick profiler requires code events, so --prof implies --log-code. // Forward declarations. -class CodeAddressMap; +class CodeEventListener; class CompilationInfo; class CpuProfiler; class Isolate; @@ -155,7 +155,6 @@ class JitLogger; class LowLevelLogger; class Sampler; - class Logger { public: #define DECLARE_ENUM(enum_item, ignore) enum_item, @@ -226,6 +225,11 @@ class Logger { // ==== Events logged by --log-code. ==== + void addCodeEventListener(CodeEventListener* listener); + void removeCodeEventListener(CodeEventListener* listener); + bool hasCodeEventListener(CodeEventListener* listener); + + // Emits a code event for a callback function. void CallbackEvent(Name* name, Address entry_point); void GetterCallbackEvent(Name* name, Address entry_point); @@ -269,6 +273,7 @@ class Logger { void SharedFunctionInfoMoveEvent(Address from, Address to); + void CodeNameEvent(Address addr, int pos, const char* code_name); void SnapshotPositionEvent(Address addr, int pos); // ==== Events logged by --log-gc. ==== @@ -439,29 +444,98 @@ class Logger { Log* log_; LowLevelLogger* ll_logger_; JitLogger* jit_logger_; - CodeAddressMap* code_address_map_; + List<CodeEventListener*> listeners_; // Guards against multiple calls to TearDown() that can happen in some tests. // 'true' between SetUp() and TearDown(). bool is_initialized_; - // Support for 'incremental addresses' in compressed logs: - // LogMessageBuilder::AppendAddress(Address addr) - Address last_address_; - // Logger::TickEvent(...) - Address prev_sp_; - Address prev_function_; - // Logger::MoveEventInternal(...) - Address prev_to_; - // Logger::FunctionCreateEvent(...) - Address prev_code_; - int64_t epoch_; friend class CpuProfiler; }; +class CodeEventListener { + public: + virtual ~CodeEventListener() {} + + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + const char* comment) = 0; + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + Name* name) = 0; + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* name) = 0; + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* source, + int line) = 0; + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + int args_count) = 0; + virtual void CallbackEvent(Name* name, Address entry_point) = 0; + virtual void GetterCallbackEvent(Name* name, Address entry_point) = 0; + virtual void SetterCallbackEvent(Name* name, Address entry_point) = 0; + virtual void RegExpCodeCreateEvent(Code* code, String* source) = 0; + virtual void CodeMoveEvent(Address from, Address to) = 0; + virtual void CodeDeleteEvent(Address from) = 0; + virtual void SharedFunctionInfoMoveEvent(Address from, Address to) = 0; + virtual void CodeMovingGCEvent() = 0; +}; + + +class CodeEventLogger : public CodeEventListener { + public: + CodeEventLogger(); + virtual ~CodeEventLogger(); + + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + const char* comment); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + Name* name); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + int args_count); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* name); + virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, + Code* code, + SharedFunctionInfo* shared, + CompilationInfo* info, + Name* source, + int line); + virtual void RegExpCodeCreateEvent(Code* code, String* source); + + virtual void CallbackEvent(Name* name, Address entry_point) { } + virtual void GetterCallbackEvent(Name* name, Address entry_point) { } + virtual void SetterCallbackEvent(Name* name, Address entry_point) { } + virtual void SharedFunctionInfoMoveEvent(Address from, Address to) { } + virtual void CodeMovingGCEvent() { } + + private: + class NameBuffer; + + virtual void LogRecordedBuffer(Code* code, + SharedFunctionInfo* shared, + const char* name, + int length) = 0; + + NameBuffer* name_buffer_; +}; + + } } // namespace v8::internal diff --git a/deps/v8/src/mark-compact.cc b/deps/v8/src/mark-compact.cc index 59492e1643..911e73b12a 100644 --- a/deps/v8/src/mark-compact.cc +++ b/deps/v8/src/mark-compact.cc @@ -2743,8 +2743,7 @@ void MarkCompactCollector::MigrateObject(Address dst, if (dest == OLD_POINTER_SPACE) { // TODO(hpayer): Replace this check with an assert. HeapObject* heap_object = HeapObject::FromAddress(src); - CHECK(heap_object->IsExternalString() || - heap_->TargetSpace(heap_object) == heap_->old_pointer_space()); + CHECK(heap_->TargetSpace(heap_object) == heap_->old_pointer_space()); Address src_slot = src; Address dst_slot = dst; ASSERT(IsAligned(size, kPointerSize)); diff --git a/deps/v8/src/messages.js b/deps/v8/src/messages.js index 8b647dd205..92ac1bc46a 100644 --- a/deps/v8/src/messages.js +++ b/deps/v8/src/messages.js @@ -1078,7 +1078,26 @@ function GetStackFrames(raw_stack) { } -function FormatStackTrace(error_string, frames) { +// Flag to prevent recursive call of Error.prepareStackTrace. +var formatting_custom_stack_trace = false; + + +function FormatStackTrace(obj, error_string, frames) { + if (IS_FUNCTION($Error.prepareStackTrace) && !formatting_custom_stack_trace) { + var array = []; + %MoveArrayContents(frames, array); + formatting_custom_stack_trace = true; + var stack_trace = void 0; + try { + stack_trace = $Error.prepareStackTrace(obj, array); + } catch (e) { + throw e; // The custom formatting function threw. Rethrow. + } finally { + formatting_custom_stack_trace = false; + } + return stack_trace; + } + var lines = new InternalArray(); lines.push(error_string); for (var i = 0; i < frames.length; i++) { @@ -1115,10 +1134,6 @@ function GetTypeName(receiver, requireConstructor) { } -// Flag to prevent recursive call of Error.prepareStackTrace. -var formatting_custom_stack_trace = false; - - function captureStackTrace(obj, cons_opt) { var stackTraceLimit = $Error.stackTraceLimit; if (!stackTraceLimit || !IS_NUMBER(stackTraceLimit)) return; @@ -1129,21 +1144,6 @@ function captureStackTrace(obj, cons_opt) { cons_opt ? cons_opt : captureStackTrace, stackTraceLimit); - // Don't be lazy if the error stack formatting is custom (observable). - if (IS_FUNCTION($Error.prepareStackTrace) && !formatting_custom_stack_trace) { - var array = []; - %MoveArrayContents(GetStackFrames(stack), array); - formatting_custom_stack_trace = true; - try { - obj.stack = $Error.prepareStackTrace(obj, array); - } catch (e) { - throw e; // The custom formatting function threw. Rethrow. - } finally { - formatting_custom_stack_trace = false; - } - return; - } - var error_string = FormatErrorString(obj); // The holder of this getter ('obj') may not be the receiver ('this'). // When this getter is called the first time, we use the context values to @@ -1151,7 +1151,7 @@ function captureStackTrace(obj, cons_opt) { // property (on the holder). var getter = function() { // Stack is still a raw array awaiting to be formatted. - var result = FormatStackTrace(error_string, GetStackFrames(stack)); + var result = FormatStackTrace(obj, error_string, GetStackFrames(stack)); // Turn this accessor into a data property. %DefineOrRedefineDataProperty(obj, 'stack', result, NONE); // Release context values. @@ -1321,7 +1321,7 @@ function SetUpStackOverflowBoilerplate() { // We may not have captured any stack trace. if (IS_UNDEFINED(stack)) return stack; - var result = FormatStackTrace(error_string, GetStackFrames(stack)); + var result = FormatStackTrace(holder, error_string, GetStackFrames(stack)); // Replace this accessor with a data property. %DefineOrRedefineDataProperty(holder, 'stack', result, NONE); return result; diff --git a/deps/v8/src/mips/assembler-mips.cc b/deps/v8/src/mips/assembler-mips.cc index a04d456ae9..fcf49f110d 100644 --- a/deps/v8/src/mips/assembler-mips.cc +++ b/deps/v8/src/mips/assembler-mips.cc @@ -1347,7 +1347,7 @@ void Assembler::rotrv(Register rd, Register rt, Register rs) { // Helper for base-reg + offset, when offset is larger than int16. void Assembler::LoadRegPlusOffsetToAt(const MemOperand& src) { ASSERT(!src.rm().is(at)); - lui(at, src.offset_ >> kLuiShift); + lui(at, (src.offset_ >> kLuiShift) & kImm16Mask); ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset. addu(at, at, src.rm()); // Add base register. } diff --git a/deps/v8/src/mips/ic-mips.cc b/deps/v8/src/mips/ic-mips.cc index ed67e829e3..eb730bb388 100644 --- a/deps/v8/src/mips/ic-mips.cc +++ b/deps/v8/src/mips/ic-mips.cc @@ -1486,51 +1486,6 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { } -void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { - // ---------- S t a t e -------------- - // -- a2 : receiver - // -- a3 : target map - // -- ra : return address - // ----------------------------------- - // Must return the modified receiver in v0. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, - FAST_DOUBLE_ELEMENTS); - ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); - __ Ret(USE_DELAY_SLOT); - __ mov(v0, a2); - __ bind(&fail); - } - - __ push(a2); - __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); -} - - -void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( - MacroAssembler* masm) { - // ---------- S t a t e -------------- - // -- a2 : receiver - // -- a3 : target map - // -- ra : return address - // ----------------------------------- - // Must return the modified receiver in v0. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, - FAST_ELEMENTS); - ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); - __ Ret(USE_DELAY_SLOT); - __ mov(v0, a2); - __ bind(&fail); - } - - __ push(a2); - __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); -} - - void StoreIC::GenerateMegamorphic(MacroAssembler* masm, StrictModeFlag strict_mode) { // ----------- S t a t e ------------- diff --git a/deps/v8/src/mips/lithium-codegen-mips.cc b/deps/v8/src/mips/lithium-codegen-mips.cc index 5cf1d59e49..8db5f00fbf 100644 --- a/deps/v8/src/mips/lithium-codegen-mips.cc +++ b/deps/v8/src/mips/lithium-codegen-mips.cc @@ -407,6 +407,9 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { if (r.IsInteger32()) { ASSERT(literal->IsNumber()); __ li(scratch, Operand(static_cast<int32_t>(literal->Number()))); + } else if (r.IsSmi()) { + ASSERT(constant->HasSmiValue()); + __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value()))); } else if (r.IsDouble()) { Abort("EmitLoadRegister: Unsupported double immediate."); } else { @@ -1521,6 +1524,7 @@ void LCodeGen::DoShiftI(LShiftI* instr) { LOperand* right_op = instr->right(); Register left = ToRegister(instr->left()); Register result = ToRegister(instr->result()); + Register scratch = scratch0(); if (right_op->IsRegister()) { // No need to mask the right operand on MIPS, it is built into the variable @@ -1577,7 +1581,14 @@ void LCodeGen::DoShiftI(LShiftI* instr) { break; case Token::SHL: if (shift_count != 0) { - __ sll(result, left, shift_count); + if (instr->hydrogen_value()->representation().IsSmi() && + instr->can_deopt()) { + __ sll(result, left, shift_count - 1); + __ SmiTagCheckOverflow(result, result, scratch); + DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg)); + } else { + __ sll(result, left, shift_count); + } } else { __ Move(result, left); } @@ -1647,6 +1658,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { } +void LCodeGen::DoConstantE(LConstantE* instr) { + __ li(ToRegister(instr->result()), Operand(instr->value())); +} + + void LCodeGen::DoConstantT(LConstantT* instr) { Handle<Object> value = instr->value(); AllowDeferredHandleDereference smi_check; @@ -2867,6 +2883,13 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); Register object = ToRegister(instr->object()); + + if (access.IsExternalMemory()) { + Register result = ToRegister(instr->result()); + __ lw(result, MemOperand(object, offset)); + return; + } + if (instr->hydrogen()->representation().IsDouble()) { DoubleRegister result = ToDoubleRegister(instr->result()); __ ldc1(result, FieldMemOperand(object, offset)); @@ -4104,6 +4127,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + if (access.IsExternalMemory()) { + Register value = ToRegister(instr->value()); + __ sw(value, MemOperand(object, offset)); + return; + } + Handle<Map> transition = instr->transition(); if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { @@ -4444,7 +4473,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { // Write barrier. __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, scratch, GetRAState(), kDontSaveFPRegs); - } else if (FLAG_compiled_transitions) { + } else { PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); __ mov(a0, object_reg); __ li(a1, Operand(to_map)); @@ -4452,28 +4481,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ CallStub(&stub); RecordSafepointWithRegisters( instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); - } else if (IsFastSmiElementsKind(from_kind) && - IsFastDoubleElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(a2)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(a3)); - __ li(new_map_reg, Operand(to_map)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), - RelocInfo::CODE_TARGET, instr); - } else if (IsFastDoubleElementsKind(from_kind) && - IsFastObjectElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(a2)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(a3)); - __ li(new_map_reg, Operand(to_map)); - __ mov(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), - RelocInfo::CODE_TARGET, instr); - } else { - UNREACHABLE(); } __ bind(¬_applicable); } diff --git a/deps/v8/src/mips/lithium-mips.cc b/deps/v8/src/mips/lithium-mips.cc index b03cea44cb..5cfca00010 100644 --- a/deps/v8/src/mips/lithium-mips.cc +++ b/deps/v8/src/mips/lithium-mips.cc @@ -713,9 +713,9 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { LInstruction* LChunkBuilder::DoShift(Token::Value op, HBitwiseBinaryOperation* instr) { - if (instr->representation().IsSmiOrTagged()) { - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + if (instr->representation().IsTagged()) { + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), a1); LOperand* right = UseFixed(instr->right(), a0); @@ -723,25 +723,35 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, return MarkAsCall(DefineFixed(result, v0), instr); } - ASSERT(instr->representation().IsInteger32()); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->representation().IsSmiOrInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); HValue* right_value = instr->right(); LOperand* right = NULL; int constant_value = 0; + bool does_deopt = false; if (right_value->IsConstant()) { HConstant* constant = HConstant::cast(right_value); right = chunk_->DefineConstantOperand(constant); constant_value = constant->Integer32Value() & 0x1f; + // Left shifts can deoptimize if we shift by > 0 and the result cannot be + // truncated to smi. + if (instr->representation().IsSmi() && constant_value > 0) { + for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { + if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) { + does_deopt = true; + break; + } + } + } } else { right = UseRegisterAtStart(right_value); } - // Shift operations can only deoptimize if we do a logical shift + // Shift operations can deoptimize if we do a logical shift // by 0 and the result cannot be truncated to int32. - bool does_deopt = false; if (op == Token::SHR && constant_value == 0) { if (FLAG_opt_safe_uint32_operations) { does_deopt = !instr->CheckFlag(HInstruction::kUint32); @@ -2007,6 +2017,8 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { return DefineAsRegister(new(zone()) LConstantI); } else if (r.IsDouble()) { return DefineAsRegister(new(zone()) LConstantD); + } else if (r.IsExternal()) { + return DefineAsRegister(new(zone()) LConstantE); } else if (r.IsTagged()) { return DefineAsRegister(new(zone()) LConstantT); } else { @@ -2235,21 +2247,12 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind( if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { LOperand* new_map_reg = TempRegister(); LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); + new(zone()) LTransitionElementsKind(object, new_map_reg); return result; - } else if (FLAG_compiled_transitions) { - LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, NULL, NULL); - return AssignPointerMap(result); } else { - LOperand* object = UseFixed(instr->object(), a0); - LOperand* fixed_object_reg = FixedTemp(a2); - LOperand* new_map_reg = FixedTemp(a3); LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, - new_map_reg, - fixed_object_reg); - return MarkAsCall(result, instr); + new(zone()) LTransitionElementsKind(object, NULL); + return AssignPointerMap(result); } } diff --git a/deps/v8/src/mips/lithium-mips.h b/deps/v8/src/mips/lithium-mips.h index 2b55906352..2618c46992 100644 --- a/deps/v8/src/mips/lithium-mips.h +++ b/deps/v8/src/mips/lithium-mips.h @@ -79,6 +79,7 @@ class LCodeGen; V(CmpMapAndBranch) \ V(CmpT) \ V(ConstantD) \ + V(ConstantE) \ V(ConstantI) \ V(ConstantS) \ V(ConstantT) \ @@ -265,7 +266,7 @@ class LInstruction: public ZoneObject { bool IsMarkedAsCall() const { return is_call_; } virtual bool HasResult() const = 0; - virtual LOperand* result() = 0; + virtual LOperand* result() const = 0; LOperand* FirstInput() { return InputAt(0); } LOperand* Output() { return HasResult() ? result() : NULL; } @@ -301,9 +302,9 @@ class LTemplateInstruction: public LInstruction { public: // Allow 0 or 1 output operands. STATIC_ASSERT(R == 0 || R == 1); - virtual bool HasResult() const { return R != 0; } + virtual bool HasResult() const { return R != 0 && result() != NULL; } void set_result(LOperand* operand) { results_[0] = operand; } - LOperand* result() { return results_[0]; } + LOperand* result() const { return results_[0]; } protected: EmbeddedContainer<LOperand*, R> results_; @@ -1210,6 +1211,17 @@ class LConstantD: public LTemplateInstruction<1, 0, 0> { }; +class LConstantE: public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") + DECLARE_HYDROGEN_ACCESSOR(Constant) + + ExternalReference value() const { + return hydrogen()->ExternalReferenceValue(); + } +}; + + class LConstantT: public LTemplateInstruction<1, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") @@ -2208,19 +2220,16 @@ class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { }; -class LTransitionElementsKind: public LTemplateInstruction<0, 1, 2> { +class LTransitionElementsKind: public LTemplateInstruction<0, 1, 1> { public: LTransitionElementsKind(LOperand* object, - LOperand* new_map_temp, - LOperand* fixed_object_temp) { + LOperand* new_map_temp) { inputs_[0] = object; temps_[0] = new_map_temp; - temps_[1] = fixed_object_temp; } LOperand* object() { return inputs_[0]; } LOperand* new_map_temp() { return temps_[0]; } - LOperand* temp() { return temps_[1]; } DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, "transition-elements-kind") diff --git a/deps/v8/src/objects-inl.h b/deps/v8/src/objects-inl.h index 3189d84030..ef30496963 100644 --- a/deps/v8/src/objects-inl.h +++ b/deps/v8/src/objects-inl.h @@ -4482,12 +4482,29 @@ ACCESSORS(Script, data, Object, kDataOffset) ACCESSORS(Script, context_data, Object, kContextOffset) ACCESSORS(Script, wrapper, Foreign, kWrapperOffset) ACCESSORS_TO_SMI(Script, type, kTypeOffset) -ACCESSORS_TO_SMI(Script, compilation_type, kCompilationTypeOffset) -ACCESSORS_TO_SMI(Script, compilation_state, kCompilationStateOffset) ACCESSORS(Script, line_ends, Object, kLineEndsOffset) ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, kEvalFrominstructionsOffsetOffset) +ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) + +Script::CompilationType Script::compilation_type() { + return BooleanBit::get(flags(), kCompilationTypeBit) ? + COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; +} +void Script::set_compilation_type(CompilationType type) { + set_flags(BooleanBit::set(flags(), kCompilationTypeBit, + type == COMPILATION_TYPE_EVAL)); +} +Script::CompilationState Script::compilation_state() { + return BooleanBit::get(flags(), kCompilationStateBit) ? + COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; +} +void Script::set_compilation_state(CompilationState state) { + set_flags(BooleanBit::set(flags(), kCompilationStateBit, + state == COMPILATION_STATE_COMPILED)); +} + #ifdef ENABLE_DEBUGGER_SUPPORT ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) diff --git a/deps/v8/src/objects-printer.cc b/deps/v8/src/objects-printer.cc index 2327cbae8a..6b2a3f0d4f 100644 --- a/deps/v8/src/objects-printer.cc +++ b/deps/v8/src/objects-printer.cc @@ -1202,8 +1202,7 @@ void Script::ScriptPrint(FILE* out) { context_data()->ShortPrint(out); PrintF(out, "\n - wrapper: "); wrapper()->ShortPrint(out); - PrintF(out, "\n - compilation type: "); - compilation_type()->ShortPrint(out); + PrintF(out, "\n - compilation type: %d", compilation_type()); PrintF(out, "\n - line ends: "); line_ends()->ShortPrint(out); PrintF(out, "\n - eval from shared: "); diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index d2ffb9c3c8..7839faaddf 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -9234,7 +9234,6 @@ void JSFunction::MarkForLazyRecompilation() { ASSERT(!IsOptimized()); ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); - ASSERT(!shared()->is_generator()); set_code_no_write_barrier( GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); // No write barrier required, since the builtin is part of the root set. @@ -9245,8 +9244,10 @@ void JSFunction::MarkForParallelRecompilation() { ASSERT(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); ASSERT(!IsOptimized()); ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); - ASSERT(!shared()->is_generator()); - ASSERT(FLAG_parallel_recompilation); + if (!FLAG_parallel_recompilation) { + JSFunction::MarkForLazyRecompilation(); + return; + } if (FLAG_trace_parallel_recompilation) { PrintF(" ** Marking "); PrintName(); diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h index 36611ee077..388187445f 100644 --- a/deps/v8/src/objects.h +++ b/deps/v8/src/objects.h @@ -5849,12 +5849,6 @@ class Script: public Struct { // [type]: the script type. DECL_ACCESSORS(type, Smi) - // [compilation]: how the the script was compiled. - DECL_ACCESSORS(compilation_type, Smi) - - // [is_compiled]: determines whether the script has already been compiled. - DECL_ACCESSORS(compilation_state, Smi) - // [line_ends]: FixedArray of line ends positions. DECL_ACCESSORS(line_ends, Object) @@ -5866,6 +5860,19 @@ class Script: public Struct { // function from which eval was called where eval was called. DECL_ACCESSORS(eval_from_instructions_offset, Smi) + // [flags]: Holds an exciting bitfield. + DECL_ACCESSORS(flags, Smi) + + // [compilation_type]: how the the script was compiled. Encoded in the + // 'flags' field. + inline CompilationType compilation_type(); + inline void set_compilation_type(CompilationType type); + + // [compilation_state]: determines whether the script has already been + // compiled. Encoded in the 'flags' field. + inline CompilationState compilation_state(); + inline void set_compilation_state(CompilationState state); + static inline Script* cast(Object* obj); // If script source is an external string, check that the underlying @@ -5884,17 +5891,20 @@ class Script: public Struct { static const int kContextOffset = kDataOffset + kPointerSize; static const int kWrapperOffset = kContextOffset + kPointerSize; static const int kTypeOffset = kWrapperOffset + kPointerSize; - static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; - static const int kCompilationStateOffset = - kCompilationTypeOffset + kPointerSize; - static const int kLineEndsOffset = kCompilationStateOffset + kPointerSize; + static const int kLineEndsOffset = kTypeOffset + kPointerSize; static const int kIdOffset = kLineEndsOffset + kPointerSize; static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; static const int kEvalFrominstructionsOffsetOffset = kEvalFromSharedOffset + kPointerSize; - static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; + static const int kFlagsOffset = + kEvalFrominstructionsOffsetOffset + kPointerSize; + static const int kSize = kFlagsOffset + kPointerSize; private: + // Bit positions in the flags field. + static const int kCompilationTypeBit = 0; + static const int kCompilationStateBit = 1; + DISALLOW_IMPLICIT_CONSTRUCTORS(Script); }; diff --git a/deps/v8/src/optimizing-compiler-thread.cc b/deps/v8/src/optimizing-compiler-thread.cc index 11d60c33d2..21ef237107 100644 --- a/deps/v8/src/optimizing-compiler-thread.cc +++ b/deps/v8/src/optimizing-compiler-thread.cc @@ -60,23 +60,12 @@ void OptimizingCompilerThread::Run() { OS::Sleep(FLAG_parallel_recompilation_delay); } - switch (static_cast<StopFlag>(Acquire_Load(&stop_thread_))) { - case CONTINUE: - break; - case STOP: - if (FLAG_trace_parallel_recompilation) { - time_spent_total_ = OS::Ticks() - epoch; - } - stop_semaphore_->Signal(); - return; - case FLUSH: - // Reset input queue semaphore. - delete input_queue_semaphore_; - input_queue_semaphore_ = OS::CreateSemaphore(0); - // Signal for main thread to start flushing. - stop_semaphore_->Signal(); - // Return to start of consumer loop. - continue; + if (Acquire_Load(&stop_thread_)) { + stop_semaphore_->Signal(); + if (FLAG_trace_parallel_recompilation) { + time_spent_total_ = OS::Ticks() - epoch; + } + return; } int64_t compiling_start = 0; @@ -113,41 +102,9 @@ void OptimizingCompilerThread::CompileNext() { } -void OptimizingCompilerThread::FlushQueue( - UnboundQueue<OptimizingCompiler*>* queue, - bool restore_function_code) { - ASSERT(!IsOptimizerThread()); - OptimizingCompiler* optimizing_compiler; - // The optimizing compiler is allocated in the CompilationInfo's zone. - while (queue->Dequeue(&optimizing_compiler)) { - CompilationInfo* info = optimizing_compiler->info(); - if (restore_function_code) { - Handle<JSFunction> function = info->closure(); - function->ReplaceCode(function->shared()->code()); - } - delete info; - } -} - - -void OptimizingCompilerThread::Flush() { - ASSERT(!IsOptimizerThread()); - Release_Store(&stop_thread_, static_cast<AtomicWord>(FLUSH)); - input_queue_semaphore_->Signal(); - - FlushQueue(&input_queue_, true); - NoBarrier_Store(&queue_length_, static_cast<AtomicWord>(0)); - - stop_semaphore_->Wait(); - Release_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE)); - - FlushQueue(&output_queue_, true); -} - - void OptimizingCompilerThread::Stop() { ASSERT(!IsOptimizerThread()); - Release_Store(&stop_thread_, static_cast<AtomicWord>(STOP)); + Release_Store(&stop_thread_, static_cast<AtomicWord>(true)); input_queue_semaphore_->Signal(); stop_semaphore_->Wait(); @@ -157,8 +114,14 @@ void OptimizingCompilerThread::Stop() { while (NoBarrier_Load(&queue_length_) > 0) CompileNext(); InstallOptimizedFunctions(); } else { - FlushQueue(&input_queue_, false); - FlushQueue(&output_queue_, false); + OptimizingCompiler* optimizing_compiler; + // The optimizing compiler is allocated in the CompilationInfo's zone. + while (input_queue_.Dequeue(&optimizing_compiler)) { + delete optimizing_compiler->info(); + } + while (output_queue_.Dequeue(&optimizing_compiler)) { + delete optimizing_compiler->info(); + } } if (FLAG_trace_parallel_recompilation) { diff --git a/deps/v8/src/optimizing-compiler-thread.h b/deps/v8/src/optimizing-compiler-thread.h index 5a87a975e5..275ceb40b7 100644 --- a/deps/v8/src/optimizing-compiler-thread.h +++ b/deps/v8/src/optimizing-compiler-thread.h @@ -54,13 +54,13 @@ class OptimizingCompilerThread : public Thread { install_mutex_(OS::CreateMutex()), time_spent_compiling_(0), time_spent_total_(0) { - NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE)); + NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); NoBarrier_Store(&queue_length_, static_cast<AtomicWord>(0)); } void Run(); void Stop(); - void Flush(); + void CompileNext(); void QueueForOptimization(OptimizingCompiler* optimizing_compiler); void InstallOptimizedFunctions(); @@ -92,12 +92,6 @@ class OptimizingCompilerThread : public Thread { } private: - enum StopFlag { CONTINUE, STOP, FLUSH }; - - void FlushQueue(UnboundQueue<OptimizingCompiler*>* queue, - bool restore_function_code); - void CompileNext(); - #ifdef DEBUG int thread_id_; Mutex* thread_id_mutex_; diff --git a/deps/v8/src/platform-win32.cc b/deps/v8/src/platform-win32.cc index 80bcaf92af..292c24a3da 100644 --- a/deps/v8/src/platform-win32.cc +++ b/deps/v8/src/platform-win32.cc @@ -892,7 +892,7 @@ size_t OS::AllocateAlignment() { } -static void* GetRandomAddr() { +void* OS::GetRandomMmapAddr() { Isolate* isolate = Isolate::UncheckedCurrent(); // Note that the current isolate isn't set up in a call path via // CpuFeatures::Probe. We don't care about randomization in this case because @@ -925,7 +925,7 @@ static void* RandomizedVirtualAlloc(size_t size, int action, int protection) { if (protection == PAGE_EXECUTE_READWRITE || protection == PAGE_NOACCESS) { // For exectutable pages try and randomize the allocation address for (size_t attempts = 0; base == NULL && attempts < 3; ++attempts) { - base = VirtualAlloc(GetRandomAddr(), size, action, protection); + base = VirtualAlloc(OS::GetRandomMmapAddr(), size, action, protection); } } diff --git a/deps/v8/src/profile-generator.cc b/deps/v8/src/profile-generator.cc index 8428303afe..4e2e38988a 100644 --- a/deps/v8/src/profile-generator.cc +++ b/deps/v8/src/profile-generator.cc @@ -372,19 +372,30 @@ void ProfileTree::ShortPrint() { } +CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples) + : title_(title), + uid_(uid), + record_samples_(record_samples), + start_time_ms_(OS::TimeCurrentMillis()), + end_time_ms_(0) { +} + + void CpuProfile::AddPath(const Vector<CodeEntry*>& path) { ProfileNode* top_frame_node = top_down_.AddPathFromEnd(path); if (record_samples_) samples_.Add(top_frame_node); } -void CpuProfile::CalculateTotalTicks() { +void CpuProfile::CalculateTotalTicksAndSamplingRate() { + end_time_ms_ = OS::TimeCurrentMillis(); top_down_.CalculateTotalTicks(); -} - -void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) { - top_down_.SetTickRatePerMs(actual_sampling_rate); + double duration = end_time_ms_ - start_time_ms_; + if (duration < 1) duration = 1; + unsigned ticks = top_down_.root()->total_ticks(); + double rate = ticks / duration; + top_down_.SetTickRatePerMs(rate); } @@ -529,8 +540,7 @@ bool CpuProfilesCollection::StartProfiling(const char* title, unsigned uid, } -CpuProfile* CpuProfilesCollection::StopProfiling(const char* title, - double actual_sampling_rate) { +CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) { const int title_len = StrLength(title); CpuProfile* profile = NULL; current_profiles_semaphore_->Wait(); @@ -543,8 +553,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(const char* title, current_profiles_semaphore_->Signal(); if (profile == NULL) return NULL; - profile->CalculateTotalTicks(); - profile->SetActualSamplingRate(actual_sampling_rate); + profile->CalculateTotalTicksAndSamplingRate(); finished_profiles_.Add(profile); return profile; } @@ -601,29 +610,6 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry( } -void SampleRateCalculator::Tick() { - if (--wall_time_query_countdown_ == 0) - UpdateMeasurements(OS::TimeCurrentMillis()); -} - - -void SampleRateCalculator::UpdateMeasurements(double current_time) { - if (measurements_count_++ != 0) { - const double measured_ticks_per_ms = - (kWallTimeQueryIntervalMs * ticks_per_ms_) / - (current_time - last_wall_time_); - // Update the average value. - ticks_per_ms_ += - (measured_ticks_per_ms - ticks_per_ms_) / measurements_count_; - // Update the externally accessible result. - result_ = static_cast<AtomicWord>(ticks_per_ms_ * kResultScale); - } - last_wall_time_ = current_time; - wall_time_query_countdown_ = - static_cast<unsigned>(kWallTimeQueryIntervalMs * ticks_per_ms_); -} - - const char* const ProfileGenerator::kAnonymousFunctionName = "(anonymous function)"; const char* const ProfileGenerator::kProgramEntryName = diff --git a/deps/v8/src/profile-generator.h b/deps/v8/src/profile-generator.h index 6b02368816..7861ccd817 100644 --- a/deps/v8/src/profile-generator.h +++ b/deps/v8/src/profile-generator.h @@ -203,13 +203,11 @@ class ProfileTree { class CpuProfile { public: - CpuProfile(const char* title, unsigned uid, bool record_samples) - : title_(title), uid_(uid), record_samples_(record_samples) { } + CpuProfile(const char* title, unsigned uid, bool record_samples); // Add pc -> ... -> main() call path to the profile. void AddPath(const Vector<CodeEntry*>& path); - void CalculateTotalTicks(); - void SetActualSamplingRate(double actual_sampling_rate); + void CalculateTotalTicksAndSamplingRate(); INLINE(const char* title() const) { return title_; } INLINE(unsigned uid() const) { return uid_; } @@ -227,6 +225,8 @@ class CpuProfile { const char* title_; unsigned uid_; bool record_samples_; + double start_time_ms_; + double end_time_ms_; List<ProfileNode*> samples_; ProfileTree top_down_; @@ -286,7 +286,7 @@ class CpuProfilesCollection { ~CpuProfilesCollection(); bool StartProfiling(const char* title, unsigned uid, bool record_samples); - CpuProfile* StopProfiling(const char* title, double actual_sampling_rate); + CpuProfile* StopProfiling(const char* title); List<CpuProfile*>* profiles() { return &finished_profiles_; } const char* GetName(Name* name) { return function_and_resource_names_.GetName(name); @@ -329,44 +329,6 @@ class CpuProfilesCollection { }; -class SampleRateCalculator { - public: - SampleRateCalculator() - : result_(Logger::kSamplingIntervalMs * kResultScale), - ticks_per_ms_(Logger::kSamplingIntervalMs), - measurements_count_(0), - wall_time_query_countdown_(1) { - } - - double ticks_per_ms() { - return result_ / static_cast<double>(kResultScale); - } - void Tick(); - void UpdateMeasurements(double current_time); - - // Instead of querying current wall time each tick, - // we use this constant to control query intervals. - static const unsigned kWallTimeQueryIntervalMs = 100; - - private: - // As the result needs to be accessed from a different thread, we - // use type that guarantees atomic writes to memory. There should - // be <= 1000 ticks per second, thus storing a value of a 10 ** 5 - // order should provide enough precision while keeping away from a - // potential overflow. - static const int kResultScale = 100000; - - AtomicWord result_; - // All other fields are accessed only from the sampler thread. - double ticks_per_ms_; - unsigned measurements_count_; - unsigned wall_time_query_countdown_; - double last_wall_time_; - - DISALLOW_COPY_AND_ASSIGN(SampleRateCalculator); -}; - - class ProfileGenerator { public: explicit ProfileGenerator(CpuProfilesCollection* profiles); @@ -375,11 +337,6 @@ class ProfileGenerator { INLINE(CodeMap* code_map()) { return &code_map_; } - INLINE(void Tick()) { sample_rate_calc_.Tick(); } - INLINE(double actual_sampling_rate()) { - return sample_rate_calc_.ticks_per_ms(); - } - static const char* const kAnonymousFunctionName; static const char* const kProgramEntryName; static const char* const kGarbageCollectorEntryName; @@ -395,7 +352,6 @@ class ProfileGenerator { CodeEntry* program_entry_; CodeEntry* gc_entry_; CodeEntry* unresolved_entry_; - SampleRateCalculator sample_rate_calc_; DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); }; diff --git a/deps/v8/src/runtime-profiler.cc b/deps/v8/src/runtime-profiler.cc index ff41432b28..0e99650ed7 100644 --- a/deps/v8/src/runtime-profiler.cc +++ b/deps/v8/src/runtime-profiler.cc @@ -408,11 +408,6 @@ void RuntimeProfiler::TearDown() { } -int RuntimeProfiler::SamplerWindowSize() { - return kSamplerWindowSize; -} - - // Update the pointers in the sampler window after a GC. void RuntimeProfiler::UpdateSamplesAfterScavenge() { for (int i = 0; i < kSamplerWindowSize; i++) { diff --git a/deps/v8/src/runtime-profiler.h b/deps/v8/src/runtime-profiler.h index 46da38155f..28d6d322fd 100644 --- a/deps/v8/src/runtime-profiler.h +++ b/deps/v8/src/runtime-profiler.h @@ -49,9 +49,6 @@ class RuntimeProfiler { void Reset(); void TearDown(); - Object** SamplerWindowAddress(); - int SamplerWindowSize(); - void NotifyICChanged() { any_ic_changed_ = true; } // Rate limiting support. diff --git a/deps/v8/src/runtime.cc b/deps/v8/src/runtime.cc index 40fae3aa05..ed3527fa92 100644 --- a/deps/v8/src/runtime.cc +++ b/deps/v8/src/runtime.cc @@ -2948,7 +2948,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ResumeJSGeneratorObject) { JavaScriptFrame* frame = stack_iterator.frame(); ASSERT_EQ(frame->function(), generator_object->function()); - ASSERT(frame->function()->is_compiled()); STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); @@ -5231,40 +5230,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsKind) { } -RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) { - SealHandleScope shs(isolate); - RUNTIME_ASSERT(args.length() == 1); - Handle<Object> object = args.at<Object>(0); - if (object->IsJSObject()) { - Handle<JSObject> js_object(Handle<JSObject>::cast(object)); - ASSERT(!js_object->map()->is_observed()); - ElementsKind new_kind = js_object->HasFastHoleyElements() - ? FAST_HOLEY_DOUBLE_ELEMENTS - : FAST_DOUBLE_ELEMENTS; - return TransitionElements(object, new_kind, isolate); - } else { - return *object; - } -} - - -RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) { - SealHandleScope shs(isolate); - RUNTIME_ASSERT(args.length() == 1); - Handle<Object> object = args.at<Object>(0); - if (object->IsJSObject()) { - Handle<JSObject> js_object(Handle<JSObject>::cast(object)); - ASSERT(!js_object->map()->is_observed()); - ElementsKind new_kind = js_object->HasFastHoleyElements() - ? FAST_HOLEY_ELEMENTS - : FAST_ELEMENTS; - return TransitionElements(object, new_kind, isolate); - } else { - return *object; - } -} - - // Set the native flag on the function. // This is used to decide if we should transform null and undefined // into the global object when doing call and apply. @@ -8466,7 +8431,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) { } CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); if (FLAG_parallel_recompilation && sync_with_compiler_thread) { - while (function->IsInRecompileQueue() || + while (function->IsMarkedForParallelRecompilation() || + function->IsInRecompileQueue() || function->IsMarkedForInstallingRecompiledCode()) { isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); OS::Sleep(50); @@ -12921,7 +12887,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) { RUNTIME_ASSERT(script_wrapper->value()->IsScript()); Handle<Script> script(Script::cast(script_wrapper->value())); - int compilation_state = Smi::cast(script->compilation_state())->value(); + int compilation_state = script->compilation_state(); RUNTIME_ASSERT(compilation_state == Script::COMPILATION_STATE_INITIAL); script->set_source(*source); diff --git a/deps/v8/src/runtime.h b/deps/v8/src/runtime.h index 400145f892..17e3b43561 100644 --- a/deps/v8/src/runtime.h +++ b/deps/v8/src/runtime.h @@ -463,8 +463,6 @@ namespace internal { F(HasExternalDoubleElements, 1, 1) \ F(HasFastProperties, 1, 1) \ F(TransitionElementsKind, 2, 1) \ - F(TransitionElementsSmiToDouble, 1, 1) \ - F(TransitionElementsDoubleToObject, 1, 1) \ F(HaveSameMap, 2, 1) diff --git a/deps/v8/src/serialize.cc b/deps/v8/src/serialize.cc index ad56d36132..6c5a620a41 100644 --- a/deps/v8/src/serialize.cc +++ b/deps/v8/src/serialize.cc @@ -665,6 +665,141 @@ bool Serializer::serialization_enabled_ = false; bool Serializer::too_late_to_enable_now_ = false; +class CodeAddressMap: public CodeEventLogger { + public: + explicit CodeAddressMap(Isolate* isolate) + : isolate_(isolate) { + isolate->logger()->addCodeEventListener(this); + } + + virtual ~CodeAddressMap() { + isolate_->logger()->removeCodeEventListener(this); + } + + virtual void CodeMoveEvent(Address from, Address to) { + address_to_name_map_.Move(from, to); + } + + virtual void CodeDeleteEvent(Address from) { + address_to_name_map_.Remove(from); + } + + const char* Lookup(Address address) { + return address_to_name_map_.Lookup(address); + } + + private: + class NameMap { + public: + NameMap() : impl_(&PointerEquals) {} + + ~NameMap() { + for (HashMap::Entry* p = impl_.Start(); p != NULL; p = impl_.Next(p)) { + DeleteArray(static_cast<const char*>(p->value)); + } + } + + void Insert(Address code_address, const char* name, int name_size) { + HashMap::Entry* entry = FindOrCreateEntry(code_address); + if (entry->value == NULL) { + entry->value = CopyName(name, name_size); + } + } + + const char* Lookup(Address code_address) { + HashMap::Entry* entry = FindEntry(code_address); + return (entry != NULL) ? static_cast<const char*>(entry->value) : NULL; + } + + void Remove(Address code_address) { + HashMap::Entry* entry = FindEntry(code_address); + if (entry != NULL) { + DeleteArray(static_cast<char*>(entry->value)); + RemoveEntry(entry); + } + } + + void Move(Address from, Address to) { + if (from == to) return; + HashMap::Entry* from_entry = FindEntry(from); + ASSERT(from_entry != NULL); + void* value = from_entry->value; + RemoveEntry(from_entry); + HashMap::Entry* to_entry = FindOrCreateEntry(to); + ASSERT(to_entry->value == NULL); + to_entry->value = value; + } + + private: + static bool PointerEquals(void* lhs, void* rhs) { + return lhs == rhs; + } + + static char* CopyName(const char* name, int name_size) { + char* result = NewArray<char>(name_size + 1); + for (int i = 0; i < name_size; ++i) { + char c = name[i]; + if (c == '\0') c = ' '; + result[i] = c; + } + result[name_size] = '\0'; + return result; + } + + HashMap::Entry* FindOrCreateEntry(Address code_address) { + return impl_.Lookup(code_address, ComputePointerHash(code_address), true); + } + + HashMap::Entry* FindEntry(Address code_address) { + return impl_.Lookup(code_address, + ComputePointerHash(code_address), + false); + } + + void RemoveEntry(HashMap::Entry* entry) { + impl_.Remove(entry->key, entry->hash); + } + + HashMap impl_; + + DISALLOW_COPY_AND_ASSIGN(NameMap); + }; + + virtual void LogRecordedBuffer(Code* code, + SharedFunctionInfo*, + const char* name, + int length) { + address_to_name_map_.Insert(code->address(), name, length); + } + + NameMap address_to_name_map_; + Isolate* isolate_; +}; + + +CodeAddressMap* Serializer::code_address_map_ = NULL; + + +void Serializer::Enable() { + if (!serialization_enabled_) { + ASSERT(!too_late_to_enable_now_); + } + if (serialization_enabled_) return; + serialization_enabled_ = true; + i::Isolate* isolate = Isolate::Current(); + isolate->InitializeLoggingAndCounters(); + code_address_map_ = new CodeAddressMap(isolate); +} + + +void Serializer::Disable() { + if (!serialization_enabled_) return; + serialization_enabled_ = false; + delete code_address_map_; + code_address_map_ = NULL; +} + + Deserializer::Deserializer(SnapshotByteSource* source) : isolate_(NULL), source_(source), @@ -1458,7 +1593,11 @@ void Serializer::ObjectSerializer::Serialize() { "ObjectSerialization"); sink_->PutInt(size >> kObjectAlignmentBits, "Size in words"); - LOG(i::Isolate::Current(), + ASSERT(code_address_map_); + const char* code_name = code_address_map_->Lookup(object_->address()); + LOG(serializer_->isolate_, + CodeNameEvent(object_->address(), sink_->Position(), code_name)); + LOG(serializer_->isolate_, SnapshotPositionEvent(object_->address(), sink_->Position())); // Mark this object as already serialized. diff --git a/deps/v8/src/serialize.h b/deps/v8/src/serialize.h index 283c1b77a1..563f0a06d0 100644 --- a/deps/v8/src/serialize.h +++ b/deps/v8/src/serialize.h @@ -459,6 +459,8 @@ class SerializationAddressMapper { }; +class CodeAddressMap; + // There can be only one serializer per V8 process. class Serializer : public SerializerDeserializer { public: @@ -472,14 +474,9 @@ class Serializer : public SerializerDeserializer { return fullness_[space]; } - static void Enable() { - if (!serialization_enabled_) { - ASSERT(!too_late_to_enable_now_); - } - serialization_enabled_ = true; - } + static void Enable(); + static void Disable(); - static void Disable() { serialization_enabled_ = false; } // Call this when you have made use of the fact that there is no serialization // going on. static void TooLateToEnableNow() { too_late_to_enable_now_ = true; } @@ -589,6 +586,7 @@ class Serializer : public SerializerDeserializer { friend class Deserializer; private: + static CodeAddressMap* code_address_map_; DISALLOW_COPY_AND_ASSIGN(Serializer); }; diff --git a/deps/v8/src/stub-cache.cc b/deps/v8/src/stub-cache.cc index 73c7a0a208..9e29a95ebf 100644 --- a/deps/v8/src/stub-cache.cc +++ b/deps/v8/src/stub-cache.cc @@ -1992,21 +1992,11 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElementPolymorphic( bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; ElementsKind elements_kind = receiver_map->elements_kind(); if (!transitioned_map.is_null()) { - if (FLAG_compiled_transitions) { - cached_stub = ElementsTransitionAndStoreStub( - elements_kind, - transitioned_map->elements_kind(), - is_js_array, - store_mode_).GetCode(isolate()); - } else { - // TODO(bmeurer) Remove this when compiled transitions is enabled - cached_stub = ElementsTransitionAndStorePlatformStub( - elements_kind, - transitioned_map->elements_kind(), - is_js_array, - strict_mode(), - store_mode_).GetCode(isolate()); - } + cached_stub = ElementsTransitionAndStoreStub( + elements_kind, + transitioned_map->elements_kind(), + is_js_array, + store_mode_).GetCode(isolate()); } else { if (FLAG_compiled_keyed_stores && (receiver_map->has_fast_elements() || diff --git a/deps/v8/src/third_party/vtune/vtune-jit.cc b/deps/v8/src/third_party/vtune/vtune-jit.cc index 0f35290d19..93de7efbb9 100644 --- a/deps/v8/src/third_party/vtune/vtune-jit.cc +++ b/deps/v8/src/third_party/vtune/vtune-jit.cc @@ -64,10 +64,15 @@ using namespace std; // To avoid GCC 4.4 compilation warning about hash_map being deprecated. #define OLD_DEPRECATED __DEPRECATED #undef __DEPRECATED +#if defined (ANDROID) +#include <hash_map> +using namespace std; +#else #include <ext/hash_map> -#define __DEPRECATED OLD_DEPRECATED using namespace __gnu_cxx; #endif +#define __DEPRECATED OLD_DEPRECATED +#endif #include <list> diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc index bae1a70f8b..2111181306 100644 --- a/deps/v8/src/version.cc +++ b/deps/v8/src/version.cc @@ -34,7 +34,7 @@ // system so their names cannot be changed without changing the scripts. #define MAJOR_VERSION 3 #define MINOR_VERSION 20 -#define BUILD_NUMBER 9 +#define BUILD_NUMBER 11 #define PATCH_LEVEL 0 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/x64/ic-x64.cc b/deps/v8/src/x64/ic-x64.cc index f26b234fed..6e238c76ec 100644 --- a/deps/v8/src/x64/ic-x64.cc +++ b/deps/v8/src/x64/ic-x64.cc @@ -1610,55 +1610,6 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { } -void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { - // ----------- S t a t e ------------- - // -- rbx : target map - // -- rdx : receiver - // -- rsp[0] : return address - // ----------------------------------- - // Must return the modified receiver in eax. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, - FAST_DOUBLE_ELEMENTS); - ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); - __ movq(rax, rdx); - __ Ret(); - __ bind(&fail); - } - - __ pop(rbx); - __ push(rdx); - __ push(rbx); // return address - __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); -} - - -void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( - MacroAssembler* masm) { - // ----------- S t a t e ------------- - // -- rbx : target map - // -- rdx : receiver - // -- rsp[0] : return address - // ----------------------------------- - // Must return the modified receiver in eax. - if (!FLAG_trace_elements_transitions) { - Label fail; - AllocationSiteMode mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, - FAST_ELEMENTS); - ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); - __ movq(rax, rdx); - __ Ret(); - __ bind(&fail); - } - - __ pop(rbx); - __ push(rdx); - __ push(rbx); // return address - __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); -} - - #undef __ diff --git a/deps/v8/src/x64/lithium-codegen-x64.cc b/deps/v8/src/x64/lithium-codegen-x64.cc index 364c3a1824..e9210a9eed 100644 --- a/deps/v8/src/x64/lithium-codegen-x64.cc +++ b/deps/v8/src/x64/lithium-codegen-x64.cc @@ -429,6 +429,13 @@ double LCodeGen::ToDouble(LConstantOperand* op) const { } +ExternalReference LCodeGen::ToExternalReference(LConstantOperand* op) const { + HConstant* constant = chunk_->LookupConstant(op); + ASSERT(constant->HasExternalReferenceValue()); + return constant->ExternalReferenceValue(); +} + + Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { HConstant* constant = chunk_->LookupConstant(op); ASSERT(chunk_->LookupLiteralRepresentation(op).IsSmiOrTagged()); @@ -1453,7 +1460,11 @@ void LCodeGen::DoShiftI(LShiftI* instr) { break; case Token::SHL: if (shift_count != 0) { - __ shll(ToRegister(left), Immediate(shift_count)); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ shl(ToRegister(left), Immediate(shift_count)); + } else { + __ shll(ToRegister(left), Immediate(shift_count)); + } } break; default: @@ -1519,6 +1530,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) { } +void LCodeGen::DoConstantE(LConstantE* instr) { + __ LoadAddress(ToRegister(instr->result()), instr->value()); +} + + void LCodeGen::DoConstantT(LConstantT* instr) { Handle<Object> value = instr->value(); AllowDeferredHandleDereference smi_check; @@ -1699,7 +1715,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { LOperand* right = instr->right(); ASSERT(left->Equals(instr->result())); HMathMinMax::Operation operation = instr->hydrogen()->operation(); - if (instr->hydrogen()->representation().IsInteger32()) { + if (instr->hydrogen()->representation().IsSmiOrInteger32()) { Label return_left; Condition condition = (operation == HMathMinMax::kMathMin) ? less_equal @@ -1708,17 +1724,26 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { if (right->IsConstantOperand()) { Immediate right_imm = Immediate(ToInteger32(LConstantOperand::cast(right))); + ASSERT(!instr->hydrogen_value()->representation().IsSmi()); __ cmpl(left_reg, right_imm); __ j(condition, &return_left, Label::kNear); __ movq(left_reg, right_imm); } else if (right->IsRegister()) { Register right_reg = ToRegister(right); - __ cmpl(left_reg, right_reg); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ cmpq(left_reg, right_reg); + } else { + __ cmpl(left_reg, right_reg); + } __ j(condition, &return_left, Label::kNear); __ movq(left_reg, right_reg); } else { Operand right_op = ToOperand(right); - __ cmpl(left_reg, right_op); + if (instr->hydrogen_value()->representation().IsSmi()) { + __ cmpq(left_reg, right_op); + } else { + __ cmpl(left_reg, right_op); + } __ j(condition, &return_left, Label::kNear); __ movq(left_reg, right_op); } @@ -2676,6 +2701,19 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + + if (access.IsExternalMemory()) { + Register result = ToRegister(instr->result()); + if (instr->object()->IsConstantOperand()) { + ASSERT(result.is(rax)); + __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object()))); + } else { + Register object = ToRegister(instr->object()); + __ movq(result, MemOperand(object, offset)); + } + return; + } + Register object = ToRegister(instr->object()); if (FLAG_track_double_fields && instr->hydrogen()->representation().IsDouble()) { @@ -3913,11 +3951,23 @@ void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { Representation representation = instr->representation(); - Register object = ToRegister(instr->object()); - HObjectAccess access = instr->hydrogen()->access(); int offset = access.offset(); + if (access.IsExternalMemory()) { + Register value = ToRegister(instr->value()); + if (instr->object()->IsConstantOperand()) { + ASSERT(value.is(rax)); + LConstantOperand* object = LConstantOperand::cast(instr->object()); + __ store_rax(ToExternalReference(object)); + } else { + Register object = ToRegister(instr->object()); + __ movq(MemOperand(object, offset), value); + } + return; + } + + Register object = ToRegister(instr->object()); Handle<Map> transition = instr->transition(); if (FLAG_track_fields && representation.IsSmi()) { @@ -4275,7 +4325,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { ASSERT_NE(instr->temp(), NULL); __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, ToRegister(instr->temp()), kDontSaveFPRegs); - } else if (FLAG_compiled_transitions) { + } else { PushSafepointRegistersScope scope(this); if (!object_reg.is(rax)) { __ movq(rax, object_reg); @@ -4285,28 +4335,6 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { __ CallStub(&stub); RecordSafepointWithRegisters( instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); - } else if (IsFastSmiElementsKind(from_kind) && - IsFastDoubleElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(rdx)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(rbx)); - __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); - __ movq(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), - RelocInfo::CODE_TARGET, instr); - } else if (IsFastDoubleElementsKind(from_kind) && - IsFastObjectElementsKind(to_kind)) { - Register fixed_object_reg = ToRegister(instr->temp()); - ASSERT(fixed_object_reg.is(rdx)); - Register new_map_reg = ToRegister(instr->new_map_temp()); - ASSERT(new_map_reg.is(rbx)); - __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); - __ movq(fixed_object_reg, object_reg); - CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), - RelocInfo::CODE_TARGET, instr); - } else { - UNREACHABLE(); } __ bind(¬_applicable); } diff --git a/deps/v8/src/x64/lithium-codegen-x64.h b/deps/v8/src/x64/lithium-codegen-x64.h index 5ad1c40a2b..4eab56c5b4 100644 --- a/deps/v8/src/x64/lithium-codegen-x64.h +++ b/deps/v8/src/x64/lithium-codegen-x64.h @@ -106,6 +106,7 @@ class LCodeGen BASE_EMBEDDED { int32_t ToInteger32(LConstantOperand* op) const; Smi* ToSmi(LConstantOperand* op) const; double ToDouble(LConstantOperand* op) const; + ExternalReference ToExternalReference(LConstantOperand* op) const; bool IsTaggedConstant(LConstantOperand* op) const; Handle<Object> ToHandle(LConstantOperand* op) const; Operand ToOperand(LOperand* op) const; diff --git a/deps/v8/src/x64/lithium-x64.cc b/deps/v8/src/x64/lithium-x64.cc index d6f05c0a2d..4153417473 100644 --- a/deps/v8/src/x64/lithium-x64.cc +++ b/deps/v8/src/x64/lithium-x64.cc @@ -717,9 +717,9 @@ LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { LInstruction* LChunkBuilder::DoShift(Token::Value op, HBitwiseBinaryOperation* instr) { - if (instr->representation().IsSmiOrTagged()) { - ASSERT(instr->left()->representation().IsSmiOrTagged()); - ASSERT(instr->right()->representation().IsSmiOrTagged()); + if (instr->representation().IsTagged()) { + ASSERT(instr->left()->representation().IsTagged()); + ASSERT(instr->right()->representation().IsTagged()); LOperand* left = UseFixed(instr->left(), rdx); LOperand* right = UseFixed(instr->right(), rax); @@ -727,9 +727,9 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, return MarkAsCall(DefineFixed(result, rax), instr); } - ASSERT(instr->representation().IsInteger32()); - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + ASSERT(instr->representation().IsSmiOrInteger32()); + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); LOperand* left = UseRegisterAtStart(instr->left()); HValue* right_value = instr->right(); @@ -1562,9 +1562,9 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { LOperand* left = NULL; LOperand* right = NULL; - if (instr->representation().IsInteger32()) { - ASSERT(instr->left()->representation().IsInteger32()); - ASSERT(instr->right()->representation().IsInteger32()); + if (instr->representation().IsSmiOrInteger32()) { + ASSERT(instr->left()->representation().Equals(instr->representation())); + ASSERT(instr->right()->representation().Equals(instr->representation())); left = UseRegisterAtStart(instr->BetterLeftOperand()); right = UseOrConstantAtStart(instr->BetterRightOperand()); } else { @@ -1997,6 +1997,8 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { } else if (r.IsDouble()) { LOperand* temp = TempRegister(); return DefineAsRegister(new(zone()) LConstantD(temp)); + } else if (r.IsExternal()) { + return DefineAsRegister(new(zone()) LConstantE); } else if (r.IsTagged()) { return DefineAsRegister(new(zone()) LConstantT); } else { @@ -2074,6 +2076,10 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { + if (instr->access().IsExternalMemory() && instr->access().offset() == 0) { + LOperand* obj = UseRegisterOrConstantAtStart(instr->object()); + return DefineFixed(new(zone()) LLoadNamedField(obj), rax); + } LOperand* obj = UseRegisterAtStart(instr->object()); return DefineAsRegister(new(zone()) LLoadNamedField(obj)); } @@ -2229,19 +2235,10 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind( LTransitionElementsKind* result = new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); return result; - } else if (FLAG_compiled_transitions) { + } else { LTransitionElementsKind* result = new(zone()) LTransitionElementsKind(object, NULL, NULL); return AssignPointerMap(result); - } else { - LOperand* object = UseFixed(instr->object(), rax); - LOperand* fixed_object_reg = FixedTemp(rdx); - LOperand* new_map_reg = FixedTemp(rbx); - LTransitionElementsKind* result = - new(zone()) LTransitionElementsKind(object, - new_map_reg, - fixed_object_reg); - return MarkAsCall(result, instr); } } @@ -2258,6 +2255,8 @@ LInstruction* LChunkBuilder::DoTrapAllocationMemento( LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { bool is_in_object = instr->access().IsInobject(); + bool is_external_location = instr->access().IsExternalMemory() && + instr->access().offset() == 0; bool needs_write_barrier = instr->NeedsWriteBarrier(); bool needs_write_barrier_for_map = !instr->transition().is_null() && instr->NeedsWriteBarrierForMap(); @@ -2267,6 +2266,11 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { obj = is_in_object ? UseRegister(instr->object()) : UseTempRegister(instr->object()); + } else if (is_external_location) { + ASSERT(!is_in_object); + ASSERT(!needs_write_barrier); + ASSERT(!needs_write_barrier_for_map); + obj = UseRegisterOrConstant(instr->object()); } else { obj = needs_write_barrier_for_map ? UseRegister(instr->object()) @@ -2280,6 +2284,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { LOperand* val; if (needs_write_barrier) { val = UseTempRegister(instr->value()); + } else if (is_external_location) { + val = UseFixed(instr->value(), rax); } else if (can_be_constant) { val = UseRegisterOrConstant(instr->value()); } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { diff --git a/deps/v8/src/x64/lithium-x64.h b/deps/v8/src/x64/lithium-x64.h index 50e32d8cd6..cb3a2b05d7 100644 --- a/deps/v8/src/x64/lithium-x64.h +++ b/deps/v8/src/x64/lithium-x64.h @@ -79,6 +79,7 @@ class LCodeGen; V(CmpMapAndBranch) \ V(CmpT) \ V(ConstantD) \ + V(ConstantE) \ V(ConstantI) \ V(ConstantS) \ V(ConstantT) \ @@ -266,7 +267,7 @@ class LInstruction: public ZoneObject { bool IsMarkedAsCall() const { return is_call_; } virtual bool HasResult() const = 0; - virtual LOperand* result() = 0; + virtual LOperand* result() const = 0; LOperand* FirstInput() { return InputAt(0); } LOperand* Output() { return HasResult() ? result() : NULL; } @@ -302,9 +303,9 @@ class LTemplateInstruction: public LInstruction { public: // Allow 0 or 1 output operands. STATIC_ASSERT(R == 0 || R == 1); - virtual bool HasResult() const { return R != 0; } + virtual bool HasResult() const { return R != 0 && result() != NULL; } void set_result(LOperand* operand) { results_[0] = operand; } - LOperand* result() { return results_[0]; } + LOperand* result() const { return results_[0]; } protected: EmbeddedContainer<LOperand*, R> results_; @@ -1166,6 +1167,17 @@ class LConstantD: public LTemplateInstruction<1, 0, 1> { }; +class LConstantE: public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") + DECLARE_HYDROGEN_ACCESSOR(Constant) + + ExternalReference value() const { + return hydrogen()->ExternalReferenceValue(); + } +}; + + class LConstantT: public LTemplateInstruction<1, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index 3895e524f4..3c6f85ed72 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -55,6 +55,8 @@ static const bool kLogThreading = false; using ::v8::AccessorInfo; using ::v8::Arguments; +using ::v8::Boolean; +using ::v8::BooleanObject; using ::v8::Context; using ::v8::Extension; using ::v8::Function; @@ -621,6 +623,41 @@ TEST(MakingExternalAsciiStringConditions) { } +TEST(MakingExternalUnalignedAsciiString) { + LocalContext env; + v8::HandleScope scope(env->GetIsolate()); + + CompileRun("function cons(a, b) { return a + b; }" + "function slice(a) { return a.substring(1); }"); + // Create a cons string that will land in old pointer space. + Local<String> cons = Local<String>::Cast(CompileRun( + "cons('abcdefghijklm', 'nopqrstuvwxyz');")); + // Create a sliced string that will land in old pointer space. + Local<String> slice = Local<String>::Cast(CompileRun( + "slice('abcdefghijklmnopqrstuvwxyz');")); + + // Trigger GCs so that the newly allocated string moves to old gen. + SimulateFullSpace(HEAP->old_pointer_space()); + HEAP->CollectGarbage(i::NEW_SPACE); // in survivor space now + HEAP->CollectGarbage(i::NEW_SPACE); // in old gen now + + // Turn into external string with unaligned resource data. + int dispose_count = 0; + const char* c_cons = "_abcdefghijklmnopqrstuvwxyz"; + bool success = cons->MakeExternal( + new TestAsciiResource(i::StrDup(c_cons) + 1, &dispose_count)); + CHECK(success); + const char* c_slice = "_bcdefghijklmnopqrstuvwxyz"; + success = slice->MakeExternal( + new TestAsciiResource(i::StrDup(c_slice) + 1, &dispose_count)); + CHECK(success); + + // Trigger GCs and force evacuation. + HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); + HEAP->CollectAllGarbage(i::Heap::kReduceMemoryFootprintMask); +} + + THREADED_TEST(UsingExternalString) { i::Factory* factory = i::Isolate::Current()->factory(); { @@ -1451,13 +1488,13 @@ THREADED_TEST(StringObject) { CHECK(!not_object->IsStringObject()); v8::Handle<v8::StringObject> as_boxed = boxed_string.As<v8::StringObject>(); CHECK(!as_boxed.IsEmpty()); - Local<v8::String> the_string = as_boxed->StringValue(); + Local<v8::String> the_string = as_boxed->ValueOf(); CHECK(!the_string.IsEmpty()); ExpectObject("\"test\"", the_string); v8::Handle<v8::Value> new_boxed_string = v8::StringObject::New(the_string); CHECK(new_boxed_string->IsStringObject()); as_boxed = new_boxed_string.As<v8::StringObject>(); - the_string = as_boxed->StringValue(); + the_string = as_boxed->ValueOf(); CHECK(!the_string.IsEmpty()); ExpectObject("\"test\"", the_string); } @@ -1474,12 +1511,12 @@ THREADED_TEST(NumberObject) { CHECK(!boxed_not_number->IsNumberObject()); v8::Handle<v8::NumberObject> as_boxed = boxed_number.As<v8::NumberObject>(); CHECK(!as_boxed.IsEmpty()); - double the_number = as_boxed->NumberValue(); + double the_number = as_boxed->ValueOf(); CHECK_EQ(42.0, the_number); v8::Handle<v8::Value> new_boxed_number = v8::NumberObject::New(43); CHECK(new_boxed_number->IsNumberObject()); as_boxed = new_boxed_number.As<v8::NumberObject>(); - the_number = as_boxed->NumberValue(); + the_number = as_boxed->ValueOf(); CHECK_EQ(43.0, the_number); } @@ -1496,16 +1533,68 @@ THREADED_TEST(BooleanObject) { v8::Handle<v8::BooleanObject> as_boxed = boxed_boolean.As<v8::BooleanObject>(); CHECK(!as_boxed.IsEmpty()); - bool the_boolean = as_boxed->BooleanValue(); + bool the_boolean = as_boxed->ValueOf(); CHECK_EQ(true, the_boolean); v8::Handle<v8::Value> boxed_true = v8::BooleanObject::New(true); v8::Handle<v8::Value> boxed_false = v8::BooleanObject::New(false); CHECK(boxed_true->IsBooleanObject()); CHECK(boxed_false->IsBooleanObject()); as_boxed = boxed_true.As<v8::BooleanObject>(); - CHECK_EQ(true, as_boxed->BooleanValue()); + CHECK_EQ(true, as_boxed->ValueOf()); as_boxed = boxed_false.As<v8::BooleanObject>(); - CHECK_EQ(false, as_boxed->BooleanValue()); + CHECK_EQ(false, as_boxed->ValueOf()); +} + + +THREADED_TEST(PrimitiveAndWrappedBooleans) { + LocalContext env; + v8::HandleScope scope(env->GetIsolate()); + + Local<Value> primitive_false = Boolean::New(false); + CHECK(primitive_false->IsBoolean()); + CHECK(!primitive_false->IsBooleanObject()); + CHECK(!primitive_false->BooleanValue()); + CHECK(!primitive_false->IsTrue()); + CHECK(primitive_false->IsFalse()); + + Local<Value> false_value = BooleanObject::New(false); + CHECK(!false_value->IsBoolean()); + CHECK(false_value->IsBooleanObject()); + CHECK(false_value->BooleanValue()); + CHECK(!false_value->IsTrue()); + CHECK(!false_value->IsFalse()); + + Local<BooleanObject> false_boolean_object = false_value.As<BooleanObject>(); + CHECK(!false_boolean_object->IsBoolean()); + CHECK(false_boolean_object->IsBooleanObject()); + // TODO(svenpanne) Uncomment when BooleanObject::BooleanValue() is deleted. + // CHECK(false_boolean_object->BooleanValue()); + CHECK(!false_boolean_object->ValueOf()); + CHECK(!false_boolean_object->IsTrue()); + CHECK(!false_boolean_object->IsFalse()); + + Local<Value> primitive_true = Boolean::New(true); + CHECK(primitive_true->IsBoolean()); + CHECK(!primitive_true->IsBooleanObject()); + CHECK(primitive_true->BooleanValue()); + CHECK(primitive_true->IsTrue()); + CHECK(!primitive_true->IsFalse()); + + Local<Value> true_value = BooleanObject::New(true); + CHECK(!true_value->IsBoolean()); + CHECK(true_value->IsBooleanObject()); + CHECK(true_value->BooleanValue()); + CHECK(!true_value->IsTrue()); + CHECK(!true_value->IsFalse()); + + Local<BooleanObject> true_boolean_object = true_value.As<BooleanObject>(); + CHECK(!true_boolean_object->IsBoolean()); + CHECK(true_boolean_object->IsBooleanObject()); + // TODO(svenpanne) Uncomment when BooleanObject::BooleanValue() is deleted. + // CHECK(true_boolean_object->BooleanValue()); + CHECK(true_boolean_object->ValueOf()); + CHECK(!true_boolean_object->IsTrue()); + CHECK(!true_boolean_object->IsFalse()); } @@ -2531,7 +2620,7 @@ THREADED_TEST(SymbolProperties) { CHECK(sym_obj->Equals(sym2)); CHECK(!sym_obj->StrictEquals(sym2)); CHECK(v8::SymbolObject::Cast(*sym_obj)->Equals(sym_obj)); - CHECK(v8::SymbolObject::Cast(*sym_obj)->SymbolValue()->Equals(sym2)); + CHECK(v8::SymbolObject::Cast(*sym_obj)->ValueOf()->Equals(sym2)); // Make sure delete of a non-existent symbol property works. CHECK(obj->Delete(sym1)); @@ -13139,7 +13228,7 @@ THREADED_TEST(DateAccess) { v8::HandleScope scope(context->GetIsolate()); v8::Handle<v8::Value> date = v8::Date::New(1224744689038.0); CHECK(date->IsDate()); - CHECK_EQ(1224744689038.0, date.As<v8::Date>()->NumberValue()); + CHECK_EQ(1224744689038.0, date.As<v8::Date>()->ValueOf()); } diff --git a/deps/v8/test/cctest/test-cpu-profiler.cc b/deps/v8/test/cctest/test-cpu-profiler.cc index fe5e2788ff..d9ecc41a74 100644 --- a/deps/v8/test/cctest/test-cpu-profiler.cc +++ b/deps/v8/test/cctest/test-cpu-profiler.cc @@ -222,7 +222,7 @@ TEST(TickEvents) { processor.StopSynchronously(); processor.Join(); - CpuProfile* profile = profiles->StopProfiling("", 1); + CpuProfile* profile = profiles->StopProfiling(""); CHECK_NE(NULL, profile); // Check call trees. @@ -286,7 +286,7 @@ TEST(Issue1398) { processor.StopSynchronously(); processor.Join(); - CpuProfile* profile = profiles->StopProfiling("", 1); + CpuProfile* profile = profiles->StopProfiling(""); CHECK_NE(NULL, profile); int actual_depth = 0; diff --git a/deps/v8/test/cctest/test-deoptimization.cc b/deps/v8/test/cctest/test-deoptimization.cc index c164193ee5..dfc27548b5 100644 --- a/deps/v8/test/cctest/test-deoptimization.cc +++ b/deps/v8/test/cctest/test-deoptimization.cc @@ -77,27 +77,23 @@ class AlwaysOptimizeAllowNativesSyntaxNoInlining { // Utility class to set --allow-natives-syntax and --nouse-inlining when // constructed and return to their default state when destroyed. -class AllowNativesSyntaxNoInliningNoParallel { +class AllowNativesSyntaxNoInlining { public: - AllowNativesSyntaxNoInliningNoParallel() + AllowNativesSyntaxNoInlining() : allow_natives_syntax_(i::FLAG_allow_natives_syntax), - use_inlining_(i::FLAG_use_inlining), - parallel_recompilation_(i::FLAG_parallel_recompilation) { + use_inlining_(i::FLAG_use_inlining) { i::FLAG_allow_natives_syntax = true; i::FLAG_use_inlining = false; - i::FLAG_parallel_recompilation = false; } - ~AllowNativesSyntaxNoInliningNoParallel() { + ~AllowNativesSyntaxNoInlining() { i::FLAG_allow_natives_syntax = allow_natives_syntax_; i::FLAG_use_inlining = use_inlining_; - i::FLAG_parallel_recompilation = parallel_recompilation_; } private: bool allow_natives_syntax_; bool use_inlining_; - bool parallel_recompilation_; }; @@ -347,7 +343,7 @@ TEST(DeoptimizeBinaryOperationADDString) { const char* f_source = "function f(x, y) { return x + y; };"; { - AllowNativesSyntaxNoInliningNoParallel options; + AllowNativesSyntaxNoInlining options; // Compile function f and collect to type feedback to insert binary op stub // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -405,7 +401,7 @@ static void TestDeoptimizeBinaryOpHelper(LocalContext* env, binary_op); char* f_source = f_source_buffer.start(); - AllowNativesSyntaxNoInliningNoParallel options; + AllowNativesSyntaxNoInlining options; // Compile function f and collect to type feedback to insert binary op stub // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -497,7 +493,7 @@ TEST(DeoptimizeCompare) { const char* f_source = "function f(x, y) { return x < y; };"; { - AllowNativesSyntaxNoInliningNoParallel options; + AllowNativesSyntaxNoInlining options; // Compile function f and collect to type feedback to insert compare ic // call in the optimized code. i::FLAG_prepare_always_opt = true; @@ -544,7 +540,7 @@ TEST(DeoptimizeLoadICStoreIC) { const char* g2_source = "function g2(x, y) { x[y] = 1; };"; { - AllowNativesSyntaxNoInliningNoParallel options; + AllowNativesSyntaxNoInlining options; // Compile functions and collect to type feedback to insert ic // calls in the optimized code. i::FLAG_prepare_always_opt = true; @@ -624,7 +620,7 @@ TEST(DeoptimizeLoadICStoreICNested) { const char* g2_source = "function g2(x, y) { x[y] = 1; };"; { - AllowNativesSyntaxNoInliningNoParallel options; + AllowNativesSyntaxNoInlining options; // Compile functions and collect to type feedback to insert ic // calls in the optimized code. i::FLAG_prepare_always_opt = true; diff --git a/deps/v8/test/cctest/test-heap.cc b/deps/v8/test/cctest/test-heap.cc index 4d312f6665..6af9962bd1 100644 --- a/deps/v8/test/cctest/test-heap.cc +++ b/deps/v8/test/cctest/test-heap.cc @@ -2826,7 +2826,6 @@ void ReleaseStackTraceDataTest(const char* source, const char* accessor) { // to check whether the data is being released since the external string // resource's callback is fired when the external string is GC'ed. FLAG_use_ic = false; // ICs retain objects. - FLAG_parallel_recompilation = false; CcTest::InitializeVM(); v8::HandleScope scope(CcTest::isolate()); SourceResource* resource = new SourceResource(i::StrDup(source)); diff --git a/deps/v8/test/cctest/test-log.cc b/deps/v8/test/cctest/test-log.cc index bf1151e59b..8bcb5f7d29 100644 --- a/deps/v8/test/cctest/test-log.cc +++ b/deps/v8/test/cctest/test-log.cc @@ -60,7 +60,6 @@ class ScopedLoggerInitializer { : saved_log_(i::FLAG_log), saved_prof_lazy_(i::FLAG_prof_lazy), saved_prof_(i::FLAG_prof), - saved_prof_auto_(i::FLAG_prof_auto), temp_file_(NULL), // Need to run this prior to creating the scope. trick_to_run_init_flags_(init_flags_(prof_lazy)), @@ -76,7 +75,6 @@ class ScopedLoggerInitializer { if (temp_file_ != NULL) fclose(temp_file_); i::FLAG_prof_lazy = saved_prof_lazy_; i::FLAG_prof = saved_prof_; - i::FLAG_prof_auto = saved_prof_auto_; i::FLAG_log = saved_log_; } @@ -97,7 +95,6 @@ class ScopedLoggerInitializer { i::FLAG_log = true; i::FLAG_prof = true; i::FLAG_prof_lazy = prof_lazy; - i::FLAG_prof_auto = false; i::FLAG_logfile = i::Log::kLogToTemporaryFile; return prof_lazy; } @@ -105,7 +102,6 @@ class ScopedLoggerInitializer { const bool saved_log_; const bool saved_prof_lazy_; const bool saved_prof_; - const bool saved_prof_auto_; FILE* temp_file_; const bool trick_to_run_init_flags_; v8::HandleScope scope_; diff --git a/deps/v8/test/cctest/test-profile-generator.cc b/deps/v8/test/cctest/test-profile-generator.cc index 7b8278ba66..f56275c1be 100644 --- a/deps/v8/test/cctest/test-profile-generator.cc +++ b/deps/v8/test/cctest/test-profile-generator.cc @@ -41,7 +41,6 @@ using i::CpuProfilesCollection; using i::ProfileNode; using i::ProfileTree; using i::ProfileGenerator; -using i::SampleRateCalculator; using i::TickSample; using i::Vector; @@ -485,7 +484,7 @@ TEST(RecordTickSample) { sample3.frames_count = 2; generator.RecordTickSample(sample3); - CpuProfile* profile = profiles.StopProfiling("", 1); + CpuProfile* profile = profiles.StopProfiling(""); CHECK_NE(NULL, profile); ProfileTreeTestHelper top_down_test_helper(profile->top_down()); CHECK_EQ(NULL, top_down_test_helper.Walk(entry2)); @@ -505,56 +504,6 @@ TEST(RecordTickSample) { } -TEST(SampleRateCalculator) { - const double kSamplingIntervalMs = i::Logger::kSamplingIntervalMs; - - // Verify that ticking exactly in query intervals results in the - // initial sampling interval. - double time = 0.0; - SampleRateCalculator calc1; - CHECK_EQ(kSamplingIntervalMs, calc1.ticks_per_ms()); - calc1.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc1.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs; - calc1.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc1.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs; - calc1.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc1.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs; - calc1.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc1.ticks_per_ms()); - - SampleRateCalculator calc2; - time = 0.0; - CHECK_EQ(kSamplingIntervalMs, calc2.ticks_per_ms()); - calc2.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc2.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs * 0.5; - calc2.UpdateMeasurements(time); - // (1.0 + 2.0) / 2 - CHECK_EQ(kSamplingIntervalMs * 1.5, calc2.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs * 0.75; - calc2.UpdateMeasurements(time); - // (1.0 + 2.0 + 2.0) / 3 - CHECK_EQ(kSamplingIntervalMs * 5.0, floor(calc2.ticks_per_ms() * 3.0 + 0.5)); - - SampleRateCalculator calc3; - time = 0.0; - CHECK_EQ(kSamplingIntervalMs, calc3.ticks_per_ms()); - calc3.UpdateMeasurements(time); - CHECK_EQ(kSamplingIntervalMs, calc3.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs * 2; - calc3.UpdateMeasurements(time); - // (1.0 + 0.5) / 2 - CHECK_EQ(kSamplingIntervalMs * 0.75, calc3.ticks_per_ms()); - time += SampleRateCalculator::kWallTimeQueryIntervalMs * 1.5; - calc3.UpdateMeasurements(time); - // (1.0 + 0.5 + 0.5) / 3 - CHECK_EQ(kSamplingIntervalMs * 2.0, floor(calc3.ticks_per_ms() * 3.0 + 0.5)); -} - - static void CheckNodeIds(ProfileNode* node, int* expectedId) { CHECK_EQ((*expectedId)++, node->id()); for (int i = 0; i < node->children()->length(); i++) { @@ -598,7 +547,7 @@ TEST(SampleIds) { sample3.frames_count = 2; generator.RecordTickSample(sample3); - CpuProfile* profile = profiles.StopProfiling("", 1); + CpuProfile* profile = profiles.StopProfiling(""); int nodeId = 1; CheckNodeIds(profile->top_down()->root(), &nodeId); CHECK_EQ(7, nodeId - 1); @@ -627,7 +576,7 @@ TEST(NoSamples) { sample1.frames_count = 1; generator.RecordTickSample(sample1); - CpuProfile* profile = profiles.StopProfiling("", 1); + CpuProfile* profile = profiles.StopProfiling(""); int nodeId = 1; CheckNodeIds(profile->top_down()->root(), &nodeId); CHECK_EQ(3, nodeId - 1); diff --git a/deps/v8/test/mjsunit/array-literal-transitions.js b/deps/v8/test/mjsunit/array-literal-transitions.js index fab45ed720..ca6033b217 100644 --- a/deps/v8/test/mjsunit/array-literal-transitions.js +++ b/deps/v8/test/mjsunit/array-literal-transitions.js @@ -205,7 +205,9 @@ if (support_smi_only_arrays) { (function literals_after_osr() { var color = [0]; - // Trigger OSR. - while (%GetOptimizationStatus(literals_after_osr, "no sync") == 2) {} + // Trigger OSR, if optimization is not disabled. + if (%GetOptimizationStatus(literals_after_osr) != 4) { + while (%GetOptimizationCount(literals_after_osr) == 0) {} + } return [color[0]]; })(); diff --git a/deps/v8/test/mjsunit/array-store-and-grow.js b/deps/v8/test/mjsunit/array-store-and-grow.js index 88f3db8f64..a03a753e44 100644 --- a/deps/v8/test/mjsunit/array-store-and-grow.js +++ b/deps/v8/test/mjsunit/array-store-and-grow.js @@ -25,6 +25,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Flags: --allow-natives-syntax + // Verifies that the KeyedStoreIC correctly handles out-of-bounds stores // to an array that grow it by a single element. Test functions are // called twice to make sure that the IC is used, first call is handled @@ -184,3 +186,24 @@ a = []; array_store_1(a, 0, 0.5); assertEquals(0.5, a[0]); assertEquals(0.5, array_store_1([], 0, 0.5)); + +// Verify that a grow store will deoptimize if the max gap (difference between +// the end of an array capacity and a new index) is passed. The wrapper is to +// make sure array_store_10 isn't inlined. + +(function() { + function grow_store(a,b,c) { + a[b] = c; + } + + a = new Array(1); + grow_store(a,1,1); + grow_store(a,2,1); + %OptimizeFunctionOnNextCall(grow_store); + grow_store(a,10,1); + assertOptimized(grow_store); + grow_store(a,2048,1); + assertUnoptimized(grow_store); + %ClearFunctionTypeFeedback(grow_store); +})(); + diff --git a/deps/v8/test/mjsunit/compiler/dead-string-add-warm.js b/deps/v8/test/mjsunit/compiler/dead-string-add-warm.js new file mode 100644 index 0000000000..c211ebddc5 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/dead-string-add-warm.js @@ -0,0 +1,76 @@ +// Copyright 2013 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. + +// Flags: --allow-natives-syntax + +function dead1(a, b) { + var x = "a" + "b"; + return a; // x, "a", and "b" are dead code +} + +function dead2(a, b) { + var x = "0" + a; + var y = "0" + b; + return a; // x and y are both dead +} + +function dead3(a, b) { + a = a ? "1" : "0"; + b = b ? "1" : "0"; + var x = a + "0"; + var y = b + "0"; + return a; // x and y are both dead +} + +function run() { + assertEquals(33, dead1(33, 32)); + assertEquals(33, dead2(33, 32)); + assertEquals("1", dead3(33, 32)); + + assertEquals(31, dead1(31, 30)); + assertEquals(31, dead2(31, 30)); + assertEquals("1", dead3(31, 32)); + + assertEquals(0, dead1(0, 30)); + assertEquals(0, dead2(0, 30)); + assertEquals("0", dead3(0, 32)); + + assertEquals(true, dead1(true, 0)); + assertEquals(true, dead2(true, 0)); + assertEquals("1", dead3(true, 0)); + + assertEquals("true", dead1("true", 0)); + assertEquals("true", dead2("true", 0)); + assertEquals("1", dead3("true", 0)); +} + +run(); +run(); +%OptimizeFunctionOnNextCall(dead1); +%OptimizeFunctionOnNextCall(dead2); +%OptimizeFunctionOnNextCall(dead3); +run(); diff --git a/deps/v8/test/mjsunit/compiler/dead-string-add.js b/deps/v8/test/mjsunit/compiler/dead-string-add.js new file mode 100644 index 0000000000..04155efab6 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/dead-string-add.js @@ -0,0 +1,65 @@ +// Copyright 2013 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. + +function dead1(a, b) { + var x = "a" + "b"; + return a; // x, "a", and "b" are dead code +} + +function dead2(a, b) { + var x = a + "0"; + var y = b + "0"; + return a; // x and y are both dead +} + +function dead3(a, b) { + a = a ? "1" : "0"; + b = b ? "1" : "0"; + var x = a + "0"; + var y = b + "0"; + return a; // x and y are both dead +} + +assertEquals(33, dead1(33, 32)); +assertEquals(33, dead2(33, 32)); +assertEquals("1", dead3(33, 32)); + +assertEquals(31, dead1(31, 30)); +assertEquals(31, dead2(31, 30)); +assertEquals("1", dead3(31, 32)); + +assertEquals(0, dead1(0, 30)); +assertEquals(0, dead2(0, 30)); +assertEquals("0", dead3(0, 32)); + +assertEquals(true, dead1(true, 0)); +assertEquals(true, dead2(true, 0)); +assertEquals("1", dead3(true, 0)); + +assertEquals("true", dead1("true", 0)); +assertEquals("true", dead2("true", 0)); +assertEquals("1", dead3("true", 0)); diff --git a/deps/v8/test/mjsunit/compiler/dead-string-char-code-at.js b/deps/v8/test/mjsunit/compiler/dead-string-char-code-at.js new file mode 100644 index 0000000000..56835ce5a6 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/dead-string-char-code-at.js @@ -0,0 +1,81 @@ +// Copyright 2013 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. + +// Flags: --allow-natives-syntax + +var S1 = "string1"; +var S2 = "@@string2"; + +function dead1(a, b) { + var x = %StringCharCodeAt(a, 4); + return a; // x is dead code +} + +function dead2(a, b) { + var x = %StringCharCodeAt(a, 3); + var y = %StringCharCodeAt(b, 1); + return a; // x and y are both dead +} + +function dead3(a, b) { + a = a ? "11" : "12"; + b = b ? "13" : "14"; + var x = %StringCharCodeAt(a, 2); + var y = %StringCharCodeAt(b, 0); + return a; // x and y are both dead +} + +function test() { + var S3 = S1 + S2; + + assertEquals(S1, dead1(S1, S2)); + assertEquals(S1, dead2(S1, S2)); + assertEquals("11", dead3(S1, S2)); + + assertEquals(S2, dead1(S2, 677)); + assertEquals(S2, dead2(S2, S3)); + assertEquals("11", dead3(S2, S3)); + + assertEquals(S3, dead1(S3, 399)); + assertEquals(S3, dead2(S3, "false")); + assertEquals("12", dead3(0, 32)); + + assertEquals(S3, dead1(S3, 0)); + assertEquals(S3, dead2(S3, S1)); + assertEquals("11", dead3(S3, 0)); + + assertEquals("true", dead1("true", 0)); + assertEquals("true", dead2("true", S3)); + assertEquals("11", dead3("true", 0)); +} + +test(); +test(); +%OptimizeFunctionOnNextCall(dead1); +%OptimizeFunctionOnNextCall(dead2); +%OptimizeFunctionOnNextCall(dead3); +test(); diff --git a/deps/v8/test/mjsunit/compiler/dead-string-char-code-at2.js b/deps/v8/test/mjsunit/compiler/dead-string-char-code-at2.js new file mode 100644 index 0000000000..9f01541c90 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/dead-string-char-code-at2.js @@ -0,0 +1,81 @@ +// Copyright 2013 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. + +// Flags: --allow-natives-syntax + +var S1 = "string1"; +var S2 = "@@string2"; + +function dead1(a, b) { + var x = %_StringCharCodeAt(a, 4); + return a; // x is dead code +} + +function dead2(a, b) { + var x = %_StringCharCodeAt(a, 3); + var y = %_StringCharCodeAt(b, 1); + return a; // x and y are both dead +} + +function dead3(a, b) { + a = a ? "11" : "12"; + b = b ? "13" : "14"; + var x = %_StringCharCodeAt(a, 2); + var y = %_StringCharCodeAt(b, 0); + return a; // x and y are both dead +} + +function test() { + var S3 = S1 + S2; + + assertEquals(S1, dead1(S1, S2)); + assertEquals(S1, dead2(S1, S2)); + assertEquals("11", dead3(S1, S2)); + + assertEquals(S2, dead1(S2, 677)); + assertEquals(S2, dead2(S2, S3)); + assertEquals("11", dead3(S2, S3)); + + assertEquals(S3, dead1(S3, 399)); + assertEquals(S3, dead2(S3, "false")); + assertEquals("12", dead3(0, 32)); + + assertEquals(S3, dead1(S3, 0)); + assertEquals(S3, dead2(S3, S1)); + assertEquals("11", dead3(S3, 0)); + + assertEquals("true", dead1("true", 0)); + assertEquals("true", dead2("true", S3)); + assertEquals("11", dead3("true", 0)); +} + +test(); +test(); +%OptimizeFunctionOnNextCall(dead1); +%OptimizeFunctionOnNextCall(dead2); +%OptimizeFunctionOnNextCall(dead3); +test(); diff --git a/deps/v8/test/mjsunit/compiler/dead-string-char-from-code.js b/deps/v8/test/mjsunit/compiler/dead-string-char-from-code.js new file mode 100644 index 0000000000..1de5d9e44b --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/dead-string-char-from-code.js @@ -0,0 +1,76 @@ +// Copyright 2013 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. + +// Flags: --allow-natives-syntax + +function dead1(a, b) { + var x = %_StringCharFromCode(a); + return a; // x is dead code +} + +function dead2(a, b) { + var x = %_StringCharFromCode(a); + var y = %_StringCharFromCode(b); + return a; // x and y are both dead +} + +function dead3(a, b) { + a = a ? 11 : 12; + b = b ? 13 : 14; + var x = %_StringCharFromCode(a); + var y = %_StringCharFromCode(b); + return a; // x and y are both dead +} + +function test() { + assertEquals(33, dead1(33, 32)); + assertEquals(33, dead2(33, 32)); + assertEquals(11, dead3(33, 32)); + + assertEquals(31, dead1(31, 30)); + assertEquals(31, dead2(31, 30)); + assertEquals(11, dead3(31, 32)); + + assertEquals(0, dead1(0, 30)); + assertEquals(0, dead2(0, 30)); + assertEquals(12, dead3(0, 32)); + + assertEquals(true, dead1(true, 0)); + assertEquals(true, dead2(true, 0)); + assertEquals(11, dead3(true, 0)); + + assertEquals("true", dead1("true", 0)); + assertEquals("true", dead2("true", 0)); + assertEquals(11, dead3("true", 0)); +} + +test(); +test(); +%OptimizeFunctionOnNextCall(dead1); +%OptimizeFunctionOnNextCall(dead2); +%OptimizeFunctionOnNextCall(dead3); +test(); diff --git a/deps/v8/test/mjsunit/count-based-osr.js b/deps/v8/test/mjsunit/count-based-osr.js index 5ce4dc5cc4..f06013083f 100644 --- a/deps/v8/test/mjsunit/count-based-osr.js +++ b/deps/v8/test/mjsunit/count-based-osr.js @@ -25,15 +25,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --count-based-interrupts --interrupt-budget=10 --weighted-back-edges // Flags: --allow-natives-syntax // Test that OSR works properly when using count-based interrupting/profiling. function osr_this() { var a = 1; - // Trigger OSR. - while (%GetOptimizationStatus(osr_this, "no sync") == 2) {} + // Trigger OSR. First check if optimization is disabled. + if (%GetOptimizationStatus(osr_this) == 4) return 1; + while (%GetOptimizationCount(osr_this) == 0) {} return a; } assertEquals(1, osr_this()); diff --git a/deps/v8/test/mjsunit/elements-transition-and-store.js b/deps/v8/test/mjsunit/elements-transition-and-store.js index 78ca597ba9..7a07b3eeca 100644 --- a/deps/v8/test/mjsunit/elements-transition-and-store.js +++ b/deps/v8/test/mjsunit/elements-transition-and-store.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --compiled-transitions --notrack-allocation-sites +// Flags: --notrack-allocation-sites function foo(a, v) { a[0] = v; diff --git a/deps/v8/test/mjsunit/generated-transition-stub.js b/deps/v8/test/mjsunit/generated-transition-stub.js index 8b890c0bad..9e3fa923b2 100644 --- a/deps/v8/test/mjsunit/generated-transition-stub.js +++ b/deps/v8/test/mjsunit/generated-transition-stub.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --compiled_transitions +// Flags: --allow-natives-syntax %NeverOptimizeFunction(test); function test() { diff --git a/deps/v8/test/mjsunit/math-min-max.js b/deps/v8/test/mjsunit/math-min-max.js index e4fd313538..a4d1b27c70 100644 --- a/deps/v8/test/mjsunit/math-min-max.js +++ b/deps/v8/test/mjsunit/math-min-max.js @@ -177,6 +177,21 @@ function crankshaft_test_2() { run(crankshaft_test_2); +var o = { a: 1, b: 2 }; + +// Test smi-based Math.min. +function f(o) { + return Math.min(o.a, o.b); +} + +assertEquals(1, f(o)); +assertEquals(1, f(o)); +%OptimizeFunctionOnNextCall(f); +assertEquals(1, f(o)); +o.a = 5; +o.b = 4; +assertEquals(4, f(o)); + // Test overriding Math.min and Math.max Math.min = function(a, b) { return a + b; } Math.max = function(a, b) { return a - b; } diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index 37e6e0f0ae..ee35af5a61 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -253,8 +253,3 @@ array-feedback: SKIP # Deopt every n garbage collections collides with the deopt every n times flag. regress/regress-2653: SKIP - -# Issue 2795: -array-store-and-grow: SKIP if $mode == debug - - diff --git a/deps/v8/test/mjsunit/regress/regress-1118.js b/deps/v8/test/mjsunit/regress/regress-1118.js index 4d27963779..4fd23456be 100644 --- a/deps/v8/test/mjsunit/regress/regress-1118.js +++ b/deps/v8/test/mjsunit/regress/regress-1118.js @@ -52,8 +52,10 @@ function h() { g(); } else { // Run for a bit as long as h is unoptimized. - while (%GetOptimizationStatus(h, "no sync") == 2) { - for (var j = 0; j < 100; j++) g(); + if (%GetOptimizationStatus(h) != 4) { + while (%GetOptimizationCount(h) == 0) { + for (var j = 0; j < 100; j++) g(); + } } g(); } diff --git a/deps/v8/test/mjsunit/regress/regress-2618.js b/deps/v8/test/mjsunit/regress/regress-2618.js index 3509db2d45..d1afa368dc 100644 --- a/deps/v8/test/mjsunit/regress/regress-2618.js +++ b/deps/v8/test/mjsunit/regress/regress-2618.js @@ -38,8 +38,7 @@ function f() { } f(); -assertOptimized(f); - +assertTrue(%GetOptimizationCount(f) > 0 || %GetOptimizationStatus(f) == 4); function g() { for (var i = 0; i < 1; i++) { } @@ -70,4 +69,4 @@ function g() { } g(); -assertOptimized(g); +assertTrue(%GetOptimizationCount(g) > 0 || %GetOptimizationStatus(g) == 4); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-150545.js b/deps/v8/test/mjsunit/regress/regress-crbug-150545.js index 19f7e68250..8238d2fa0d 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-150545.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-150545.js @@ -45,8 +45,10 @@ function outer() { inner(1,2,3); - // Trigger OSR. - while (%GetOptimizationStatus(outer, "no sync") == 2) {} + // Trigger OSR, if optimization is not disabled. + if (%GetOptimizationStatus(outer) != 4) { + while (%GetOptimizationCount(outer) == 0) {} + } } outer(); diff --git a/deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js b/deps/v8/test/mjsunit/regress/regress-crbug-258519.js index 0283c38b99..b2015a8426 100644 --- a/deps/v8/test/mjsunit/regress/regress-prepare-break-while-recompile.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-258519.js @@ -25,33 +25,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --expose-debug-as debug --allow-natives-syntax -// Flags: --parallel-recompilation-delay=300 +// Flags: --allow-natives-syntax -Debug = debug.Debug - -function foo() { - var x = 1; - return x; +var a = { + compare_null: function(x) { return null != x; }, + kaboom: function() {} } -function bar() { - var x = 2; - return x; +function crash(x) { + var b = a; + b.compare_null(x) && b.kaboom(); + return "ok"; } -foo(); -// Mark and trigger parallel optimization. -%OptimizeFunctionOnNextCall(foo, "parallel"); -foo(); - -// Set break points on an unrelated function. This clears both optimized -// and (shared) unoptimized code on foo, and sets both to lazy-compile builtin. -// Clear the break point immediately after to deactivate the debugger. -Debug.setBreakPoint(bar, 0, 0); -Debug.clearAllBreakPoints(); - -// Install optimized code when parallel optimization finishes. -// This needs to be able to deal with shared code being a builtin. -assertUnoptimized(foo, "sync"); - +assertEquals("ok", crash(null)); +assertEquals("ok", crash(null)); +%OptimizeFunctionOnNextCall(crash); +// Used to throw: "TypeError: Cannot call method 'kaboom' of undefined". +assertEquals("ok", crash(1)); diff --git a/deps/v8/test/mjsunit/stack-traces-custom-lazy.js b/deps/v8/test/mjsunit/stack-traces-custom-lazy.js new file mode 100644 index 0000000000..91d97f3739 --- /dev/null +++ b/deps/v8/test/mjsunit/stack-traces-custom-lazy.js @@ -0,0 +1,49 @@ +// Copyright 2013 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. + +function testPrepareStackTrace(closure) { + var error = undefined; + try { + closure(); + assertUnreachable(); + } catch (e) { + error = e; + } + + // We expect custom formatting to be lazy. Setting the custom + // function right before calling error.stack should be fine. + Error.prepareStackTrace = function(e, frames) { + return "bar"; + } + + assertEquals("bar", error.stack); + Error.prepareStackTrace = undefined; +} + +testPrepareStackTrace(function() { throw new Error("foo"); }); +testPrepareStackTrace(function f() { f(); }); + diff --git a/deps/v8/test/mjsunit/stack-traces.js b/deps/v8/test/mjsunit/stack-traces.js index 4a37ee6fa4..46a16eb87a 100644 --- a/deps/v8/test/mjsunit/stack-traces.js +++ b/deps/v8/test/mjsunit/stack-traces.js @@ -315,7 +315,11 @@ assertTrue(fired); Error.prepareStackTrace = function() { throw new Error("abc"); }; var message; try { - throw new Error(); + try { + throw new Error(); + } catch (e) { + e.stack; + } } catch (e) { message = e.message; } @@ -324,6 +328,6 @@ assertEquals("abc", message); // Test that modifying Error.prepareStackTrace by itself works. Error.prepareStackTrace = function() { Error.prepareStackTrace = "custom"; }; -new Error(); +new Error().stack; assertEquals("custom", Error.prepareStackTrace); diff --git a/deps/v8/test/mjsunit/transition-elements-kind.js b/deps/v8/test/mjsunit/transition-elements-kind.js index ba05c950d9..9fac78036e 100644 --- a/deps/v8/test/mjsunit/transition-elements-kind.js +++ b/deps/v8/test/mjsunit/transition-elements-kind.js @@ -25,8 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --compiled-transitions -// Flags: --track-allocation-sites +// Flags: --allow-natives-syntax --track-allocation-sites // Allocation site for empty double arrays. function foo() { diff --git a/deps/v8/test/webkit/fast/js/deep-recursion-test-expected.txt b/deps/v8/test/webkit/fast/js/deep-recursion-test-expected.txt new file mode 100644 index 0000000000..874fad021c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/deep-recursion-test-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This test how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. +FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. +FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. +FAIL msg should be RangeError: Maximum call stack size exceeded.. Was RangeError: Maximum call stack size exceeded. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/deep-recursion-test.js b/deps/v8/test/webkit/fast/js/deep-recursion-test.js new file mode 100644 index 0000000000..59df2f1c9a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/deep-recursion-test.js @@ -0,0 +1,78 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("This test how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow."); + + function simpleRecursion(depth) { + if (depth) + simpleRecursion(depth - 1); + } + + try { + simpleRecursion(17472); + } catch (ex) { + debug("FAIL: " + ex); + } + + try { + simpleRecursion(10000000); + } catch (ex) { + var msg = String(eval(ex)); + shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); + } + + try { + simpleRecursion(1000000000); + } catch (ex) { + var msg = String(eval(ex)); + shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); + } + + var tooFewArgsDepth = 0; + + function tooFewArgsRecursion(a) { + if (tooFewArgsDepth) { + tooFewArgsDepth--; + tooFewArgsRecursion(); + } + } + + try { + tooFewArgsDepth = 10000000; + tooFewArgsRecursion(); + } catch (ex) { + var msg = String(eval(ex)); + shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); + } + + function tooManyArgsRecursion(depth) { + if (depth) + tooManyArgsRecursion(depth - 1, 1); + } + + try { + tooManyArgsRecursion(10000000, 1); + } catch (ex) { + var msg = String(eval(ex)); + shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); + }
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/function-decompilation-operators-expected.txt b/deps/v8/test/webkit/fast/js/function-decompilation-operators-expected.txt new file mode 100644 index 0000000000..e47775499b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-decompilation-operators-expected.txt @@ -0,0 +1,83 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This test checks toString() round-trip decompilation for binary and unary operators. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS decompiledFunction is 'function () { x + + y;}' +PASS decompiledFunction is 'function () { x + - y;}' +PASS decompiledFunction is 'function () { x - + y;}' +PASS decompiledFunction is 'function () { x - - y;}' +PASS decompiledFunction is 'function () { x * + y;}' +PASS decompiledFunction is 'function () { x * - y;}' +PASS decompiledFunction is 'function () { x / + y;}' +PASS decompiledFunction is 'function () { x / - y;}' +PASS decompiledFunction is 'function () { x % + y;}' +PASS decompiledFunction is 'function () { x % - y;}' +PASS decompiledFunction is 'function () { x++ + y;}' +PASS decompiledFunction is 'function () { x++ - y;}' +PASS decompiledFunction is 'function () { x++ * y;}' +PASS decompiledFunction is 'function () { x++ / y;}' +PASS decompiledFunction is 'function () { x-- + y;}' +PASS decompiledFunction is 'function () { x-- - y;}' +PASS decompiledFunction is 'function () { x-- * y;}' +PASS decompiledFunction is 'function () { x-- / y;}' +PASS decompiledFunction is 'function () { x + ++y;}' +PASS decompiledFunction is 'function () { x - ++y;}' +PASS decompiledFunction is 'function () { x * ++y;}' +PASS decompiledFunction is 'function () { x / ++y;}' +PASS decompiledFunction is 'function () { x + --y;}' +PASS decompiledFunction is 'function () { x - --y;}' +PASS decompiledFunction is 'function () { x * --y;}' +PASS decompiledFunction is 'function () { x / --y;}' +PASS decompiledFunction is 'function () { x++ + ++y;}' +PASS decompiledFunction is 'function () { x++ - ++y;}' +PASS decompiledFunction is 'function () { x++ * ++y;}' +PASS decompiledFunction is 'function () { x++ / ++y;}' +PASS decompiledFunction is 'function () { x-- + ++y;}' +PASS decompiledFunction is 'function () { x-- - ++y;}' +PASS decompiledFunction is 'function () { x-- * ++y;}' +PASS decompiledFunction is 'function () { x-- / ++y;}' +PASS decompiledFunction is 'function () { x++ + --y;}' +PASS decompiledFunction is 'function () { x++ - --y;}' +PASS decompiledFunction is 'function () { x++ * --y;}' +PASS decompiledFunction is 'function () { x++ / --y;}' +PASS decompiledFunction is 'function () { x-- + --y;}' +PASS decompiledFunction is 'function () { x-- - --y;}' +PASS decompiledFunction is 'function () { x-- * --y;}' +PASS decompiledFunction is 'function () { x-- / --y;}' +PASS decompiledFunction is 'function () { + + x;}' +PASS decompiledFunction is 'function () { + - x;}' +PASS decompiledFunction is 'function () { - + x;}' +PASS decompiledFunction is 'function () { - - x;}' +PASS decompiledFunction is 'function () { 1;}' +PASS decompiledFunction is 'function () { -1;}' +PASS decompiledFunction is 'function () { - -1;}' +PASS decompiledFunction is 'function () { - - 0;}' +PASS decompiledFunction is 'function () { - - NaN;}' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/function-decompilation-operators.js b/deps/v8/test/webkit/fast/js/function-decompilation-operators.js new file mode 100644 index 0000000000..759767f88e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/function-decompilation-operators.js @@ -0,0 +1,83 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("This test checks toString() round-trip decompilation for binary and unary operators."); + + var tests = [ + "x + + y", + "x + - y", + "x - + y", + "x - - y", + "x * + y", + "x * - y", + "x / + y", + "x / - y", + "x % + y", + "x % - y", + "x++ + y", + "x++ - y", + "x++ * y", + "x++ / y", + "x-- + y", + "x-- - y", + "x-- * y", + "x-- / y", + "x + ++y", + "x - ++y", + "x * ++y", + "x / ++y", + "x + --y", + "x - --y", + "x * --y", + "x / --y", + "x++ + ++y", + "x++ - ++y", + "x++ * ++y", + "x++ / ++y", + "x-- + ++y", + "x-- - ++y", + "x-- * ++y", + "x-- / ++y", + "x++ + --y", + "x++ - --y", + "x++ * --y", + "x++ / --y", + "x-- + --y", + "x-- - --y", + "x-- * --y", + "x-- / --y", + "+ + x", + "+ - x", + "- + x", + "- - x", + "1", + "-1", + "- -1", + "- - 0", + "- - NaN" + ]; + + for (test in tests) { + var decompiledFunction = eval("(function () { " + tests[test] + ";})").toString().replace(/\n/g, ""); + shouldBe("decompiledFunction", "'function () { " + tests[test] + ";}'"); + }
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Array-expected.txt b/deps/v8/test/webkit/fast/js/kde/Array-expected.txt new file mode 100644 index 0000000000..a6bb94821b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Array-expected.txt @@ -0,0 +1,114 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Array().length is 0 +PASS (new Array()).length is 0 +PASS (new Array(3)).length is 3 +PASS (new Array(11, 22)).length is 2 +PASS (new Array(11, 22))[0] is 11 +PASS Array(11, 22)[1] is 22 +PASS (new Array(11, 22))[3] is undefined. +PASS String(new Array(11, 22)) is '11,22' +PASS var a = []; a[0] = 33; a[0] is 33 +PASS var a = []; a[0] = 33; a.length is 1 +PASS var a = [11, 22]; a.length = 1; String(a); is '11' +PASS var a = [11, 22]; a.length = 1; a.length; is 1 +PASS caught; is true +PASS ename is 'RangeError' +PASS caught; is true +PASS ename is 'RangeError' +PASS var a = [11, 22]; a.length = 1; a[1]; is undefined. +PASS Array().toString() is '' +PASS Array(3).toString() is ',,' +PASS Array(11, 22).toString() is '11,22' +PASS String(Array(11, 22).concat(33)) is '11,22,33' +PASS String(Array(2).concat(33, 44)) is ',,33,44' +PASS String(Array(2).concat(Array(2))) is ',,,' +PASS String(Array(11,22).concat(Array(33,44))) is '11,22,33,44' +PASS String(Array(1,2).concat(3,Array(4,5))) is '1,2,3,4,5' +PASS var a = new Array(1,2,3); delete a[1]; String(a.concat(4)) is '1,,3,4' +PASS [1,2,3,4].slice(1, 3).toString() is '2,3' +PASS [1,2,3,4].slice(-3, -1).toString() is '2,3' +PASS [1,2].slice(-9, 0).length is 0 +PASS [1,2].slice(1).toString() is '2' +PASS [1,2].slice().toString() is '1,2' +PASS (new Array('a')).length is 1 +PASS (new Array('a'))[0] is 'a' +PASS (new Array('a'))[1] is undefined. +PASS Array('a').length is 1 +PASS Array('a')[0] is 'a' +PASS String(Array()) is '' +PASS String(Array('a','b')) is 'a,b' +PASS [].length is 0 +PASS ['a'].length is 1 +PASS ['a'][0] is 'a' +PASS ['a',,'c'][2] is 'c' +PASS ['a',undefined,'c'][1] is undefined +PASS ['a',,'c'][1] is undefined +PASS 1 in ['a',,'c'] is false +PASS 1 in ['a',undefined,'c'] is true +PASS 1 in arrayWithDeletion is false +PASS forInSum([]) is '' +PASS forInSum(Array()) is '' +PASS forInSum(Array('a')) is 'a' +PASS forInSum([,undefined,'x','aa']) is 'undefinedxaa' +PASS forInSum(a0) is '' +PASS forInSum(a1) is 'a' +PASS String([].sort()) is '' +PASS String([3,1,'2'].sort()) is '1,2,3' +PASS String([,'x','aa'].sort()) is 'aa,x,' +PASS String([,undefined,'x','aa'].sort()) is 'aa,x,,' +PASS 2 in [,undefined,'x','aa'].sort() is true +PASS 3 in [,undefined,'x','aa'].sort() is false +PASS var a = ['aa', 'b', 'cccc', 'ddd']; String(a.sort(comp)) is 'b,aa,ddd,cccc' +PASS [0, Infinity].sort(function(a, b) { return a - b }).toString() is '0,Infinity' +PASS [].unshift('a') is 1 +PASS ['c'].unshift('a', 'b') is 3 +PASS var a = []; a.unshift('a'); String(a) is 'a' +PASS var a = ['c']; a.unshift('a', 'b'); String(a) is 'a,b,c' +PASS String(['a', 'b', 'c'].splice(1, 2, 'x', 'y')) is 'b,c' +PASS arr.length is 40 +PASS arr[maxint] is "test" +PASS arr.length is 40 +PASS arr[maxint] is undefined +PASS arr.length is maxint +PASS arr[maxint-1] is "test2" +PASS arr.length is 40 +PASS arr[55.5] is "test" +PASS arr[65.11111111111111111111111111111] is "test" +PASS arr.length is 40 +PASS arr[55.5] is undefined +PASS arr[65.11111111111111111111111111111] is undefined +PASS propnames.length is 3 +PASS propnames[0] is '0' +PASS propnames[1] is '1' +PASS propnames[2] is '2' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Array.js b/deps/v8/test/webkit/fast/js/kde/Array.js new file mode 100644 index 0000000000..26bf331588 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Array.js @@ -0,0 +1,236 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// 15.4 Array Objects +// (c) 2001 Harri Porten <porten@kde.org> + +shouldBe("Array().length", "0"); +shouldBe("(new Array()).length", "0"); +shouldBe("(new Array(3)).length", "3"); +shouldBe("(new Array(11, 22)).length", "2"); +shouldBe("(new Array(11, 22))[0]", "11"); +shouldBe("Array(11, 22)[1]", "22"); +shouldBeUndefined("(new Array(11, 22))[3]"); +shouldBe("String(new Array(11, 22))", "'11,22'"); +shouldBe("var a = []; a[0] = 33; a[0]", "33"); +shouldBe("var a = []; a[0] = 33; a.length", "1"); +shouldBe("var a = [11, 22]; a.length = 1; String(a);", "'11'"); +shouldBe("var a = [11, 22]; a.length = 1; a.length;", "1"); + +// range checks +var caught = false; +var ename = ""; +try { + [].length = -1; +} catch (e) { + // expect Range Error + caught = true; + ename = e.name; +} + +shouldBeTrue("caught;"); +shouldBe("ename", "'RangeError'"); + +caught = false; +ename = ""; +try { + new Array(Infinity); +} catch (e) { + // expect Range Error + caught = true; + ename = e.name; +} +shouldBeTrue("caught;"); +shouldBe("ename", "'RangeError'"); + +shouldBeUndefined("var a = [11, 22]; a.length = 1; a[1];"); +shouldBe("Array().toString()", "''"); +shouldBe("Array(3).toString()", "',,'"); +shouldBe("Array(11, 22).toString()", "'11,22'"); +shouldBe("String(Array(11, 22).concat(33))", "'11,22,33'"); +shouldBe("String(Array(2).concat(33, 44))", "',,33,44'"); +shouldBe("String(Array(2).concat(Array(2)))", "',,,'"); +shouldBe("String(Array(11,22).concat(Array(33,44)))", "'11,22,33,44'"); +shouldBe("String(Array(1,2).concat(3,Array(4,5)))", "'1,2,3,4,5'"); +shouldBe("var a = new Array(1,2,3); delete a[1]; String(a.concat(4))", "'1,,3,4'"); + +shouldBe("[1,2,3,4].slice(1, 3).toString()", "'2,3'"); +shouldBe("[1,2,3,4].slice(-3, -1).toString()", "'2,3'"); +shouldBe("[1,2].slice(-9, 0).length", "0"); +shouldBe("[1,2].slice(1).toString()", "'2'"); +shouldBe("[1,2].slice().toString()", "'1,2'"); + +// 2nd set. +shouldBe("(new Array('a')).length", "1"); +shouldBe("(new Array('a'))[0]", "'a'"); +shouldBeUndefined("(new Array('a'))[1]"); + +shouldBe("Array('a').length", "1"); +shouldBe("Array('a')[0]", "'a'"); + +shouldBe("String(Array())", "''"); +shouldBe("String(Array('a','b'))", "'a,b'"); + +shouldBe("[].length", "0"); +shouldBe("['a'].length", "1"); +shouldBe("['a'][0]", "'a'"); +shouldBe("['a',,'c'][2]", "'c'"); +shouldBe("['a',undefined,'c'][1]", "undefined"); +shouldBe("['a',,'c'][1]", "undefined"); +shouldBe("1 in ['a',,'c']", "false"); +shouldBe("1 in ['a',undefined,'c']", "true"); + +var arrayWithDeletion = ['a','b','c']; +delete arrayWithDeletion[1]; +shouldBe("1 in arrayWithDeletion", "false"); + +function forInSum(_a) { + var s = ''; + for (i in _a) + s += _a[i]; + return s; +} + +shouldBe("forInSum([])", "''"); +shouldBe("forInSum(Array())", "''"); +shouldBe("forInSum(Array('a'))", "'a'"); +shouldBe("forInSum([,undefined,'x','aa'])", "'undefinedxaa'"); + +var a0 = []; +shouldBe("forInSum(a0)", "''"); + +var a1 = [ 'a' ]; +shouldBe("forInSum(a1)", "'a'"); + +shouldBe("String([].sort())", "''") +shouldBe("String([3,1,'2'].sort())", "'1,2,3'"); +shouldBe("String([,'x','aa'].sort())", "'aa,x,'"); +shouldBe("String([,undefined,'x','aa'].sort())", "'aa,x,,'"); +shouldBe("2 in [,undefined,'x','aa'].sort()", "true"); +shouldBe("3 in [,undefined,'x','aa'].sort()", "false"); + +// sort by length +function comp(a, b) { + var la = String(a).length; + var lb = String(b).length; + if (la < lb) + return -1; + else if (la > lb) + return 1; + else + return 0; +} +shouldBe("var a = ['aa', 'b', 'cccc', 'ddd']; String(a.sort(comp))", "'b,aa,ddd,cccc'"); + +// +/-Infinity as function return value +shouldBe("[0, Infinity].sort(function(a, b) { return a - b }).toString()", "'0,Infinity'"); + +// Array.unshift() +shouldBe("[].unshift('a')", "1"); +shouldBe("['c'].unshift('a', 'b')", "3"); +shouldBe("var a = []; a.unshift('a'); String(a)", "'a'"); +shouldBe("var a = ['c']; a.unshift('a', 'b'); String(a)", "'a,b,c'"); + +// Array.splice() +shouldBe("String(['a', 'b', 'c'].splice(1, 2, 'x', 'y'))", "'b,c'"); + +var maxint = Math.pow(2,32)-1; +var arr = new Array(); + +// 2^32 should not be treated as a valid array index, i.e. +// setting the property on the array should not result in +// the length being modified + +arr.length = 40; +arr[maxint] = "test"; +shouldBe("arr.length","40"); +shouldBe("arr[maxint]","\"test\""); +delete arr[maxint]; +shouldBe("arr.length","40"); +shouldBe("arr[maxint]","undefined"); +arr[maxint-1] = "test2"; +shouldBe("arr.length","maxint"); +shouldBe("arr[maxint-1]","\"test2\""); + +// Floating point numbers also should not be treated as valid array indices. +arr.length = 40; +arr[55.5] = "test"; // does fit in a JSImmediate number +arr[65.11111111111111111111111111111] = "test"; // does not fit in a JSImmediate number +shouldBe("arr.length","40"); +shouldBe("arr[55.5]","\"test\""); +shouldBe("arr[65.11111111111111111111111111111]","\"test\""); +delete arr[55.5]; +delete arr[65.11111111111111111111111111111]; +shouldBe("arr.length","40"); +shouldBe("arr[55.5]","undefined"); +shouldBe("arr[65.11111111111111111111111111111]","undefined"); + +arr = new Array('a','b','c'); +arr.__proto__ = { 1: 'x' }; +var propnames = new Array(); +for (i in arr) + propnames.push(i); +propnames.sort(); +shouldBe("propnames.length","3"); +shouldBe("propnames[0]","'0'"); +shouldBe("propnames[1]","'1'"); +shouldBe("propnames[2]","'2'"); + +function testToString() { + // backup + var backupNumberToString = Number.prototype.toString; + var backupNumberToLocaleString = Number.prototype.toLocaleString; + var backupRegExpToString = RegExp.prototype.toString; + var backupRegExpToLocaleString = RegExp.prototype.toLocaleString; + + // change functions + Number.prototype.toString = function() { return "toString"; } + Number.prototype.toLocaleString = function() { return "toLocaleString"; } + RegExp.prototype.toString = function() { return "toString2"; } + RegExp.prototype.toLocaleString = function() { return "toLocaleString2"; } + + // the tests + shouldBe("[1].toString()", "'1'"); + shouldBe("[1].toLocaleString()", "'toLocaleString'"); + Number.prototype.toLocaleString = "invalid"; + shouldBe("[1].toLocaleString()", "'1'"); + shouldBe("[/r/].toString()", "'toString2'"); + shouldBe("[/r/].toLocaleString()", "'toLocaleString2'"); + RegExp.prototype.toLocaleString = "invalid"; + shouldBe("[/r/].toLocaleString()", "'toString2'"); + + var caught = false; + try { + [{ toString : 0 }].toString(); + } catch (e) { + caught = true; + } + shouldBeTrue("caught"); + + // restore + Number.prototype.toString = backupNumberToString; + Number.prototype.toLocaleString = backupNumberToLocaleString; + RegExp.prototype.toString = backupRegExpToString; + RegExp.prototype.toLocaleString = backupRegExpToLocaleString; +}
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Boolean-expected.txt b/deps/v8/test/webkit/fast/js/kde/Boolean-expected.txt new file mode 100644 index 0000000000..2c326f4227 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Boolean-expected.txt @@ -0,0 +1,40 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Boolean() is false +PASS Boolean(true) is true +PASS Boolean(false) is false +PASS (new Boolean(true)).valueOf() is true +PASS (new Boolean(false)).valueOf() is false +PASS (new Boolean(Boolean(true))).valueOf() is true +PASS true.valueOf() === true is true +PASS false.toString() === 'false' is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Boolean.js b/deps/v8/test/webkit/fast/js/kde/Boolean.js new file mode 100644 index 0000000000..dbc117a726 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Boolean.js @@ -0,0 +1,32 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Boolean()", "false"); +shouldBe("Boolean(true)", "true"); +shouldBe("Boolean(false)", "false"); +shouldBe("(new Boolean(true)).valueOf()", "true"); +shouldBe("(new Boolean(false)).valueOf()", "false"); +shouldBe("(new Boolean(Boolean(true))).valueOf()", "true"); +shouldBeTrue("true.valueOf() === true"); +shouldBeTrue("false.toString() === 'false'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Date-setYear-expected.txt b/deps/v8/test/webkit/fast/js/kde/Date-setYear-expected.txt new file mode 100644 index 0000000000..00192e1665 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Date-setYear-expected.txt @@ -0,0 +1,42 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Start Of Test +PASS d.setYear(-1), d.getFullYear() is -1 +PASS d.setYear(0), d.getFullYear() is 1900 +PASS d.setYear(1), d.getFullYear() is 1901 +PASS d.setYear(99), d.getFullYear() is 1999 +PASS d.setYear(100), d.getFullYear() is 100 +PASS d.setYear(2050), d.getFullYear() is 2050 +PASS d.setYear(1899), d.getFullYear() is 1899 +PASS d.setYear(2000), d.getFullYear() is 2000 +PASS d.setYear(2100), d.getFullYear() is 2100 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Date-setYear.js b/deps/v8/test/webkit/fast/js/kde/Date-setYear.js new file mode 100644 index 0000000000..4ccf02517a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Date-setYear.js @@ -0,0 +1,36 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +debug("Start Of Test"); + +var d = new Date(); +shouldBe("d.setYear(-1), d.getFullYear()", "-1"); +shouldBe("d.setYear(0), d.getFullYear()", "1900"); +shouldBe("d.setYear(1), d.getFullYear()", "1901"); +shouldBe("d.setYear(99), d.getFullYear()", "1999"); +shouldBe("d.setYear(100), d.getFullYear()", "100"); +shouldBe("d.setYear(2050), d.getFullYear()", "2050"); +shouldBe("d.setYear(1899), d.getFullYear()", "1899"); +shouldBe("d.setYear(2000), d.getFullYear()", "2000"); +shouldBe("d.setYear(2100), d.getFullYear()", "2100");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Error-expected.txt b/deps/v8/test/webkit/fast/js/kde/Error-expected.txt new file mode 100644 index 0000000000..a913a37e96 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Error-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Error('msg').message is 'msg' +PASS (new Error('msg')).message is 'msg' +PASS (new Error('msg')).name is 'Error' +PASS Object.prototype.toString.apply(Error()) is '[object Error]' +PASS Object.prototype.toString.apply(Error) is '[object Function]' +PASS Object.prototype.toString.apply(EvalError) is '[object Function]' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Error.js b/deps/v8/test/webkit/fast/js/kde/Error.js new file mode 100644 index 0000000000..6ecd5c3c8f --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Error.js @@ -0,0 +1,35 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// Error constructor called as a function +shouldBe("Error('msg').message", "'msg'"); + +// Error Constructor called as part of a new expression +shouldBe("(new Error('msg')).message", "'msg'"); +// moved to evil-n.js shouldBeUndefined("(new Error()).message"); +shouldBe("(new Error('msg')).name", "'Error'"); + +shouldBe("Object.prototype.toString.apply(Error())", "'[object Error]'"); +shouldBe("Object.prototype.toString.apply(Error)", "'[object Function]'"); +shouldBe("Object.prototype.toString.apply(EvalError)", "'[object Function]'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/GlobalObject-expected.txt b/deps/v8/test/webkit/fast/js/kde/GlobalObject-expected.txt new file mode 100644 index 0000000000..55696b5366 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/GlobalObject-expected.txt @@ -0,0 +1,91 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS h.charCodeAt(1) is 239 +PASS u.charCodeAt(1) is 4660 +PASS escape(h) is 'a%EFc' +PASS escape(u) is 'a%u1234c' +PASS escape(z) is '%00' +PASS unescape(escape(h)) is h +PASS unescape(escape(u)) is u +PASS unescape(escape(z)) is z +PASS isNaN(NaN) is true +PASS isNaN('NaN') is true +PASS isNaN('1') is false +PASS isFinite(1) is true +PASS isFinite('1') is true +PASS isFinite('a') is false +PASS isNaN(parseInt("Hello", 8)) is true +PASS isNaN(parseInt("FFF", 10)) is true +PASS isNaN(parseInt(".5", 10)) is true +PASS isFinite(Infinity) is false +PASS isFinite('Infinity') is false +PASS isNaN(parseInt()) is true +PASS isNaN(parseInt('')) is true +PASS isNaN(parseInt(' ')) is true +PASS isNaN(parseInt('a')) is true +PASS parseInt(1) is 1 +PASS parseInt(1234567890123456) is 1234567890123456 +PASS parseInt(1.2) is 1 +PASS parseInt(' 2.3') is 2 +PASS parseInt('0x10') is 16 +PASS parseInt('11', 0) is 11 +PASS parseInt('F', 16) is 15 +PASS isNaN(parseInt('10', 40)) is true +PASS parseInt('3x') is 3 +PASS parseInt('3 x') is 3 +PASS isNaN(parseInt('Infinity')) is true +PASS parseInt("15") is 15 +PASS parseInt("015") is 15 +PASS parseInt("0xf") is 15 +PASS parseInt("15", 0) is 15 +PASS parseInt("15", 10) is 15 +PASS parseInt("F", 16) is 15 +PASS parseInt("17", 8) is 15 +PASS parseInt("15.99", 10) is 15 +PASS parseInt("FXX123", 16) is 15 +PASS parseInt("1111", 2) is 15 +PASS parseInt("15*3", 10) is 15 +PASS parseInt("0x7", 10) is 0 +PASS parseInt("1x7", 10) is 1 +PASS isNaN(parseFloat()) is true +PASS isNaN(parseFloat('')) is true +PASS isNaN(parseFloat(' ')) is true +PASS isNaN(parseFloat('a')) is true +PASS parseFloat(1) is 1 +PASS parseFloat(' 2.3') is 2.3 +PASS parseFloat('3.1 x', 3) is 3.1 +PASS parseFloat('3.1x', 3) is 3.1 +PASS isFinite(parseFloat('Infinity')) is false +PASS delete NaN is false +PASS delete Infinity is false +PASS delete undefined is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/GlobalObject.js b/deps/v8/test/webkit/fast/js/kde/GlobalObject.js new file mode 100644 index 0000000000..112aea8cfd --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/GlobalObject.js @@ -0,0 +1,99 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var h = "a\xefc"; +var u = "a\u1234c"; +var z = "\x00"; + +shouldBe("h.charCodeAt(1)", "239"); +shouldBe("u.charCodeAt(1)", "4660"); +shouldBe("escape(h)", "'a%EFc'"); +shouldBe("escape(u)", "'a%u1234c'"); +shouldBe("escape(z)", "'%00'"); +shouldBe("unescape(escape(h))", "h"); +shouldBe("unescape(escape(u))", "u"); +shouldBe("unescape(escape(z))", "z"); + +shouldBeTrue("isNaN(NaN)"); +shouldBeTrue("isNaN('NaN')"); +shouldBeFalse("isNaN('1')"); + +shouldBeTrue("isFinite(1)"); +shouldBeTrue("isFinite('1')"); + +// all should return NaN because 1st char is non-number +shouldBeFalse("isFinite('a')"); +shouldBe('isNaN(parseInt("Hello", 8))', "true"); +shouldBe('isNaN(parseInt("FFF", 10))', "true"); +shouldBe('isNaN(parseInt(".5", 10))', "true"); + +shouldBeFalse("isFinite(Infinity)"); +shouldBeFalse("isFinite('Infinity')"); + +shouldBeTrue("isNaN(parseInt())"); +shouldBeTrue("isNaN(parseInt(''))"); +shouldBeTrue("isNaN(parseInt(' '))"); +shouldBeTrue("isNaN(parseInt('a'))"); +shouldBe("parseInt(1)", "1"); +shouldBe("parseInt(1234567890123456)", "1234567890123456"); +shouldBe("parseInt(1.2)", "1"); +shouldBe("parseInt(' 2.3')", "2"); +shouldBe("parseInt('0x10')", "16"); +shouldBe("parseInt('11', 0)", "11"); +shouldBe("parseInt('F', 16)", "15"); + +shouldBeTrue("isNaN(parseInt('10', 40))"); +shouldBe("parseInt('3x')", "3"); +shouldBe("parseInt('3 x')", "3"); +shouldBeTrue("isNaN(parseInt('Infinity'))"); + +// all should return 15 +shouldBe('parseInt("15")', "15"); +shouldBe('parseInt("015")', "15"); // ES5 prohibits parseInt from handling octal, see annex E. +shouldBe('parseInt("0xf")', "15"); +shouldBe('parseInt("15", 0)', "15"); +shouldBe('parseInt("15", 10)', "15"); +shouldBe('parseInt("F", 16)', "15"); +shouldBe('parseInt("17", 8)', "15"); +shouldBe('parseInt("15.99", 10)', "15"); +shouldBe('parseInt("FXX123", 16)', "15"); +shouldBe('parseInt("1111", 2)', "15"); +shouldBe('parseInt("15*3", 10)', "15"); + +// this should be 0 +shouldBe('parseInt("0x7", 10)', "0"); +shouldBe('parseInt("1x7", 10)', "1"); + +shouldBeTrue("isNaN(parseFloat())"); +shouldBeTrue("isNaN(parseFloat(''))"); +shouldBeTrue("isNaN(parseFloat(' '))"); +shouldBeTrue("isNaN(parseFloat('a'))"); +shouldBe("parseFloat(1)", "1"); +shouldBe("parseFloat(' 2.3')", "2.3"); +shouldBe("parseFloat('3.1 x', 3)", "3.1"); +shouldBe("parseFloat('3.1x', 3)", "3.1"); +shouldBeFalse("isFinite(parseFloat('Infinity'))"); +shouldBeFalse("delete NaN"); +shouldBeFalse("delete Infinity"); +shouldBeFalse("delete undefined");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Number-expected.txt b/deps/v8/test/webkit/fast/js/kde/Number-expected.txt new file mode 100644 index 0000000000..afb413cda5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Number-expected.txt @@ -0,0 +1,486 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Number() is 0 +PASS Number(1) is 1 +PASS Number(1.1) is 1.1 +PASS Number('1.2') is 1.2 +PASS isNaN(Number('a')) is true +PASS (new Number()).valueOf() is 0 +PASS (new Number(.4)).valueOf() is 0.4 +PASS (new Number('1.')).valueOf() is 1 +PASS isNaN(new Number('a')) is true +PASS isNaN(Number.NaN) is true +PASS Number.NEGATIVE_INFINITY is -Infinity +PASS Number.POSITIVE_INFINITY is Infinity +PASS (1).toString() is '1' +PASS typeof (1).toString() is 'string' +PASS (10).toString(16) is 'a' +PASS (8.5).toString(16) is '8.8' +PASS (-8.5).toString(16) is '-8.8' +PASS Number.NaN.toString(16) is 'NaN' +PASS Number.POSITIVE_INFINITY.toString(16) is 'Infinity' +PASS Number.NEGATIVE_INFINITY.toString(16) is '-Infinity' +PASS Number.MAX_VALUE.toString(2).length is 1024 +PASS (1).valueOf() is 1 +PASS typeof (1).valueOf() is 'number' +PASS Number(1234.567).toFixed(0) is "1235" +PASS Number(1234.567).toFixed(undefined) is "1235" +PASS Number(-1234.567).toFixed(0) is "-1235" +PASS Number(-1234.567).toFixed(undefined) is "-1235" +PASS Number(0).toFixed(7) is "0.0000000" +PASS Number(0.003).toFixed(0) is "0" +PASS Number(-0.003).toFixed(0) is "-0" +PASS Number(40.1234567890123).toFixed(7) is "40.1234568" +PASS Number(-40.1234567890123).toFixed(7) is "-40.1234568" +PASS Number(4).toFixed(7) is "4.0000000" +PASS Number(-4).toFixed(7) is "-4.0000000" +PASS Number(0.000056).toFixed(7) is "0.0000560" +PASS Number(-0.000056).toFixed(7) is "-0.0000560" +PASS Number(NaN).toFixed(7) is "NaN" +PASS Number(Infinity).toFixed(7) is "Infinity" +PASS Number(-Infinity).toFixed(7) is "-Infinity" +PASS Number(Math.pow(10,4)).toFixed(13) is "10000.0000000000000" +PASS Number(Math.pow(10,17)).toFixed(16) is "100000000000000000.0000000000000000" +PASS Number(Math.pow(10,18)).toFixed(17) is "1000000000000000000.00000000000000000" +PASS Number(Math.pow(10,19)).toFixed(18) is "10000000000000000000.000000000000000000" +PASS Number(Math.pow(10,17)).toFixed(20) is "100000000000000000.00000000000000000000" +PASS Number(Math.pow(10,18)).toFixed(20) is "1000000000000000000.00000000000000000000" +PASS Number(Math.pow(10,19)).toFixed(20) is "10000000000000000000.00000000000000000000" +PASS Number(Math.pow(10,20)).toFixed(20) is "100000000000000000000.00000000000000000000" +PASS Number(Math.pow(10,21)).toFixed(20) is "1e+21" +PASS Number(-Math.pow(10,4)).toFixed(13) is "-10000.0000000000000" +PASS Number(-Math.pow(10,17)).toFixed(16) is "-100000000000000000.0000000000000000" +PASS Number(-Math.pow(10,18)).toFixed(17) is "-1000000000000000000.00000000000000000" +PASS Number(-Math.pow(10,19)).toFixed(18) is "-10000000000000000000.000000000000000000" +PASS Number(-Math.pow(10,17)).toFixed(20) is "-100000000000000000.00000000000000000000" +PASS Number(-Math.pow(10,18)).toFixed(20) is "-1000000000000000000.00000000000000000000" +PASS Number(-Math.pow(10,19)).toFixed(20) is "-10000000000000000000.00000000000000000000" +PASS Number(-Math.pow(10,20)).toFixed(20) is "-100000000000000000000.00000000000000000000" +PASS Number(-Math.pow(10,21)).toFixed(20) is "-1e+21" +PASS toFixedOrException(2,-1).indexOf('Range') >= 0 is true +PASS Number(2).toFixed(0) is "2" +PASS Number(2).toFixed(20) is "2.00000000000000000000" +PASS toFixedOrException(2,21).indexOf('Range') >= 0 is true +PASS toFixedOrException(-2,-1).indexOf('Range') >= 0 is true +PASS Number(-2).toFixed(0) is "-2" +PASS Number(-2).toFixed(20) is "-2.00000000000000000000" +PASS toFixedOrException(-2,21).indexOf('Range') >= 0 is true +PASS Number(NaN).toExponential() is "NaN" +PASS Number(Infinity).toExponential() is "Infinity" +PASS Number(-Infinity).toExponential() is "-Infinity" +PASS Number(NaN).toExponential(4) is "NaN" +PASS Number(Infinity).toExponential(4) is "Infinity" +PASS Number(-Infinity).toExponential(4) is "-Infinity" +PASS Number(123.456).toExponential() is "1.23456e+2" +PASS try { Number(123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(123.456).toExponential(0) is "1e+2" +PASS Number(123.456).toExponential(1) is "1.2e+2" +PASS Number(123.456).toExponential(2) is "1.23e+2" +PASS Number(123.456).toExponential(3) is "1.235e+2" +PASS Number(123.456).toExponential(4) is "1.2346e+2" +PASS Number(123.456).toExponential(5) is "1.23456e+2" +PASS Number(123.456).toExponential(6) is "1.234560e+2" +PASS Number(123.456).toExponential(7) is "1.2345600e+2" +PASS Number(123.456).toExponential(8) is "1.23456000e+2" +PASS Number(123.456).toExponential(9) is "1.234560000e+2" +PASS Number(123.456).toExponential(10) is "1.2345600000e+2" +PASS Number(123.456).toExponential(11) is "1.23456000000e+2" +PASS Number(123.456).toExponential(12) is "1.234560000000e+2" +PASS Number(123.456).toExponential(13) is "1.2345600000000e+2" +PASS Number(123.456).toExponential(14) is "1.23456000000000e+2" +PASS Number(123.456).toExponential(15) is "1.234560000000000e+2" +PASS Number(123.456).toExponential(16) is "1.2345600000000000e+2" +PASS Number(123.456).toExponential(17) is "1.23456000000000003e+2" +PASS Number(123.456).toExponential(18) is "1.234560000000000031e+2" +PASS Number(123.456).toExponential(19) is "1.2345600000000000307e+2" +PASS Number(123.456).toExponential(20) is "1.23456000000000003070e+2" +PASS try { Number(123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-123.456).toExponential() is "-1.23456e+2" +PASS try { Number(-123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-123.456).toExponential(0) is "-1e+2" +PASS Number(-123.456).toExponential(1) is "-1.2e+2" +PASS Number(-123.456).toExponential(2) is "-1.23e+2" +PASS Number(-123.456).toExponential(3) is "-1.235e+2" +PASS Number(-123.456).toExponential(4) is "-1.2346e+2" +PASS Number(-123.456).toExponential(5) is "-1.23456e+2" +PASS Number(-123.456).toExponential(6) is "-1.234560e+2" +PASS Number(-123.456).toExponential(7) is "-1.2345600e+2" +PASS Number(-123.456).toExponential(8) is "-1.23456000e+2" +PASS Number(-123.456).toExponential(9) is "-1.234560000e+2" +PASS Number(-123.456).toExponential(10) is "-1.2345600000e+2" +PASS Number(-123.456).toExponential(11) is "-1.23456000000e+2" +PASS Number(-123.456).toExponential(12) is "-1.234560000000e+2" +PASS Number(-123.456).toExponential(13) is "-1.2345600000000e+2" +PASS Number(-123.456).toExponential(14) is "-1.23456000000000e+2" +PASS Number(-123.456).toExponential(15) is "-1.234560000000000e+2" +PASS Number(-123.456).toExponential(16) is "-1.2345600000000000e+2" +PASS Number(-123.456).toExponential(17) is "-1.23456000000000003e+2" +PASS Number(-123.456).toExponential(18) is "-1.234560000000000031e+2" +PASS Number(-123.456).toExponential(19) is "-1.2345600000000000307e+2" +PASS Number(-123.456).toExponential(20) is "-1.23456000000000003070e+2" +PASS try { Number(-123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(.000123456).toExponential() is "1.23456e-4" +PASS try { Number(.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(.000123456).toExponential(0) is "1e-4" +PASS Number(.000123456).toExponential(1) is "1.2e-4" +PASS Number(.000123456).toExponential(2) is "1.23e-4" +PASS Number(.000123456).toExponential(3) is "1.235e-4" +PASS Number(.000123456).toExponential(4) is "1.2346e-4" +PASS Number(.000123456).toExponential(5) is "1.23456e-4" +PASS Number(.000123456).toExponential(6) is "1.234560e-4" +PASS Number(.000123456).toExponential(7) is "1.2345600e-4" +PASS Number(.000123456).toExponential(8) is "1.23456000e-4" +PASS Number(.000123456).toExponential(9) is "1.234560000e-4" +PASS Number(.000123456).toExponential(10) is "1.2345600000e-4" +PASS Number(.000123456).toExponential(11) is "1.23456000000e-4" +PASS Number(.000123456).toExponential(12) is "1.234560000000e-4" +PASS Number(.000123456).toExponential(13) is "1.2345600000000e-4" +PASS Number(.000123456).toExponential(14) is "1.23456000000000e-4" +PASS Number(.000123456).toExponential(15) is "1.234560000000000e-4" +PASS Number(.000123456).toExponential(16) is "1.2345600000000001e-4" +PASS Number(.000123456).toExponential(17) is "1.23456000000000005e-4" +PASS Number(.000123456).toExponential(18) is "1.234560000000000052e-4" +PASS Number(.000123456).toExponential(19) is "1.2345600000000000519e-4" +PASS Number(.000123456).toExponential(20) is "1.23456000000000005188e-4" +PASS try { Number(.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-.000123456).toExponential() is "-1.23456e-4" +PASS try { Number(-.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-.000123456).toExponential(0) is "-1e-4" +PASS Number(-.000123456).toExponential(1) is "-1.2e-4" +PASS Number(-.000123456).toExponential(2) is "-1.23e-4" +PASS Number(-.000123456).toExponential(3) is "-1.235e-4" +PASS Number(-.000123456).toExponential(4) is "-1.2346e-4" +PASS Number(-.000123456).toExponential(5) is "-1.23456e-4" +PASS Number(-.000123456).toExponential(6) is "-1.234560e-4" +PASS Number(-.000123456).toExponential(7) is "-1.2345600e-4" +PASS Number(-.000123456).toExponential(8) is "-1.23456000e-4" +PASS Number(-.000123456).toExponential(9) is "-1.234560000e-4" +PASS Number(-.000123456).toExponential(10) is "-1.2345600000e-4" +PASS Number(-.000123456).toExponential(11) is "-1.23456000000e-4" +PASS Number(-.000123456).toExponential(12) is "-1.234560000000e-4" +PASS Number(-.000123456).toExponential(13) is "-1.2345600000000e-4" +PASS Number(-.000123456).toExponential(14) is "-1.23456000000000e-4" +PASS Number(-.000123456).toExponential(15) is "-1.234560000000000e-4" +PASS Number(-.000123456).toExponential(16) is "-1.2345600000000001e-4" +PASS Number(-.000123456).toExponential(17) is "-1.23456000000000005e-4" +PASS Number(-.000123456).toExponential(18) is "-1.234560000000000052e-4" +PASS Number(-.000123456).toExponential(19) is "-1.2345600000000000519e-4" +PASS Number(-.000123456).toExponential(20) is "-1.23456000000000005188e-4" +PASS try { Number(-.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(123.4567890123456789012).toExponential() is "1.2345678901234568e+2" +PASS try { Number(123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(123.4567890123456789012).toExponential(0) is "1e+2" +PASS Number(123.4567890123456789012).toExponential(1) is "1.2e+2" +PASS Number(123.4567890123456789012).toExponential(2) is "1.23e+2" +PASS Number(123.4567890123456789012).toExponential(3) is "1.235e+2" +PASS Number(123.4567890123456789012).toExponential(4) is "1.2346e+2" +PASS Number(123.4567890123456789012).toExponential(5) is "1.23457e+2" +PASS Number(123.4567890123456789012).toExponential(6) is "1.234568e+2" +PASS Number(123.4567890123456789012).toExponential(7) is "1.2345679e+2" +PASS Number(123.4567890123456789012).toExponential(8) is "1.23456789e+2" +PASS Number(123.4567890123456789012).toExponential(9) is "1.234567890e+2" +PASS Number(123.4567890123456789012).toExponential(10) is "1.2345678901e+2" +PASS Number(123.4567890123456789012).toExponential(11) is "1.23456789012e+2" +PASS Number(123.4567890123456789012).toExponential(12) is "1.234567890123e+2" +PASS Number(123.4567890123456789012).toExponential(13) is "1.2345678901235e+2" +PASS Number(123.4567890123456789012).toExponential(14) is "1.23456789012346e+2" +PASS Number(123.4567890123456789012).toExponential(15) is "1.234567890123457e+2" +PASS Number(123.4567890123456789012).toExponential(16) is "1.2345678901234568e+2" +PASS Number(123.4567890123456789012).toExponential(17) is "1.23456789012345681e+2" +PASS Number(123.4567890123456789012).toExponential(18) is "1.234567890123456806e+2" +PASS Number(123.4567890123456789012).toExponential(19) is "1.2345678901234568059e+2" +PASS Number(123.4567890123456789012).toExponential(20) is "1.23456789012345680590e+2" +PASS try { Number(123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-123.4567890123456789012).toExponential() is "-1.2345678901234568e+2" +PASS try { Number(-123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(-123.4567890123456789012).toExponential(0) is "-1e+2" +PASS Number(-123.4567890123456789012).toExponential(1) is "-1.2e+2" +PASS Number(-123.4567890123456789012).toExponential(2) is "-1.23e+2" +PASS Number(-123.4567890123456789012).toExponential(3) is "-1.235e+2" +PASS Number(-123.4567890123456789012).toExponential(4) is "-1.2346e+2" +PASS Number(-123.4567890123456789012).toExponential(5) is "-1.23457e+2" +PASS Number(-123.4567890123456789012).toExponential(6) is "-1.234568e+2" +PASS Number(-123.4567890123456789012).toExponential(7) is "-1.2345679e+2" +PASS Number(-123.4567890123456789012).toExponential(8) is "-1.23456789e+2" +PASS Number(-123.4567890123456789012).toExponential(9) is "-1.234567890e+2" +PASS Number(-123.4567890123456789012).toExponential(10) is "-1.2345678901e+2" +PASS Number(-123.4567890123456789012).toExponential(11) is "-1.23456789012e+2" +PASS Number(-123.4567890123456789012).toExponential(12) is "-1.234567890123e+2" +PASS Number(-123.4567890123456789012).toExponential(13) is "-1.2345678901235e+2" +PASS Number(-123.4567890123456789012).toExponential(14) is "-1.23456789012346e+2" +PASS Number(-123.4567890123456789012).toExponential(15) is "-1.234567890123457e+2" +PASS Number(-123.4567890123456789012).toExponential(16) is "-1.2345678901234568e+2" +PASS Number(-123.4567890123456789012).toExponential(17) is "-1.23456789012345681e+2" +PASS Number(-123.4567890123456789012).toExponential(18) is "-1.234567890123456806e+2" +PASS Number(-123.4567890123456789012).toExponential(19) is "-1.2345678901234568059e+2" +PASS Number(-123.4567890123456789012).toExponential(20) is "-1.23456789012345680590e+2" +PASS try { Number(-123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(.0000000000000000000001).toExponential() is "1e-22" +PASS Number(.0000000000000000000012).toExponential() is "1.2e-21" +PASS Number(.0000000000000000000123).toExponential() is "1.23e-20" +PASS Number(.0000000000000000000123).toExponential() is "1.23e-20" +PASS Number(.0000000000000000001234).toExponential() is "1.234e-19" +PASS Number(.0000000000000000012345).toExponential() is "1.2345e-18" +PASS Number(.0000000000000000123456).toExponential() is "1.23456e-17" +PASS Number(.0000000000000001234567).toExponential() is "1.234567e-16" +PASS Number(.0000000000000012345678).toExponential() is "1.2345678e-15" +PASS Number(.0000000000000123456789).toExponential() is "1.23456789e-14" +PASS Number(.0000000000001234567890).toExponential() is "1.23456789e-13" +PASS Number(.0000000000012345678901).toExponential() is "1.2345678901e-12" +PASS Number(.0000000000123456789012).toExponential() is "1.23456789012e-11" +PASS Number(.0000000001234567890123).toExponential() is "1.234567890123e-10" +PASS Number(.0000000012345678901234).toExponential() is "1.2345678901234e-9" +PASS Number(.0000000123456789012345).toExponential() is "1.23456789012345e-8" +PASS Number(.0000001234567890123456).toExponential() is "1.234567890123456e-7" +PASS Number(.0000012345678901234567).toExponential() is "1.2345678901234567e-6" +PASS Number(.0000123456789012345678).toExponential() is "1.2345678901234568e-5" +PASS Number(.0001234567890123456789).toExponential() is "1.2345678901234567e-4" +PASS Number(.0012345678901234567890).toExponential() is "1.2345678901234567e-3" +PASS Number(.0123456789012345678901).toExponential() is "1.2345678901234568e-2" +PASS Number(1.234567890123456789012).toExponential() is "1.2345678901234567e+0" +PASS Number(12.34567890123456789012).toExponential() is "1.2345678901234567e+1" +PASS Number(123.4567890123456789012).toExponential() is "1.2345678901234568e+2" +PASS Number(1234.567890123456789012).toExponential() is "1.234567890123457e+3" +PASS Number(12345.67890123456789012).toExponential() is "1.2345678901234567e+4" +PASS Number(123456.7890123456789012).toExponential() is "1.2345678901234567e+5" +PASS Number(1234567.890123456789012).toExponential() is "1.2345678901234567e+6" +PASS Number(12345678.90123456789012).toExponential() is "1.2345678901234567e+7" +PASS Number(123456789.0123456789012).toExponential() is "1.2345678901234567e+8" +PASS Number(1234567890.123456789012).toExponential() is "1.2345678901234567e+9" +PASS Number(12345678901.23456789012).toExponential() is "1.2345678901234568e+10" +PASS Number(123456789012.3456789012).toExponential() is "1.2345678901234567e+11" +PASS Number(1234567890123.456789012).toExponential() is "1.2345678901234568e+12" +PASS Number(12345678901234.56789012).toExponential() is "1.2345678901234568e+13" +PASS Number(123456789012345.6789012).toExponential() is "1.2345678901234567e+14" +PASS Number(1234567890123456.789012).toExponential() is "1.2345678901234568e+15" +PASS Number(12345678901234567.89012).toExponential() is "1.2345678901234568e+16" +PASS Number(123456789012345678.9012).toExponential() is "1.2345678901234568e+17" +PASS Number(1234567890123456789.012).toExponential() is "1.2345678901234568e+18" +PASS Number(12345678901234567890.12).toExponential() is "1.2345678901234567e+19" +PASS Number(123456789012345678901.2).toExponential() is "1.2345678901234568e+20" +PASS Number(-.0000000000000000000001).toExponential() is "-1e-22" +PASS Number(-.0000000000000000000012).toExponential() is "-1.2e-21" +PASS Number(-.0000000000000000000123).toExponential() is "-1.23e-20" +PASS Number(-.0000000000000000000123).toExponential() is "-1.23e-20" +PASS Number(-.0000000000000000001234).toExponential() is "-1.234e-19" +PASS Number(-.0000000000000000012345).toExponential() is "-1.2345e-18" +PASS Number(-.0000000000000000123456).toExponential() is "-1.23456e-17" +PASS Number(-.0000000000000001234567).toExponential() is "-1.234567e-16" +PASS Number(-.0000000000000012345678).toExponential() is "-1.2345678e-15" +PASS Number(-.0000000000000123456789).toExponential() is "-1.23456789e-14" +PASS Number(-.0000000000001234567890).toExponential() is "-1.23456789e-13" +PASS Number(-.0000000000012345678901).toExponential() is "-1.2345678901e-12" +PASS Number(-.0000000000123456789012).toExponential() is "-1.23456789012e-11" +PASS Number(-.0000000001234567890123).toExponential() is "-1.234567890123e-10" +PASS Number(-.0000000012345678901234).toExponential() is "-1.2345678901234e-9" +PASS Number(-.0000000123456789012345).toExponential() is "-1.23456789012345e-8" +PASS Number(-.0000001234567890123456).toExponential() is "-1.234567890123456e-7" +PASS Number(-.0000012345678901234567).toExponential() is "-1.2345678901234567e-6" +PASS Number(-.0000123456789012345678).toExponential() is "-1.2345678901234568e-5" +PASS Number(-.0001234567890123456789).toExponential() is "-1.2345678901234567e-4" +PASS Number(-.0012345678901234567890).toExponential() is "-1.2345678901234567e-3" +PASS Number(-.0123456789012345678901).toExponential() is "-1.2345678901234568e-2" +PASS Number(-1.234567890123456789012).toExponential() is "-1.2345678901234567e+0" +PASS Number(-12.34567890123456789012).toExponential() is "-1.2345678901234567e+1" +PASS Number(-123.4567890123456789012).toExponential() is "-1.2345678901234568e+2" +PASS Number(-1234.567890123456789012).toExponential() is "-1.234567890123457e+3" +PASS Number(-12345.67890123456789012).toExponential() is "-1.2345678901234567e+4" +PASS Number(-123456.7890123456789012).toExponential() is "-1.2345678901234567e+5" +PASS Number(-1234567.890123456789012).toExponential() is "-1.2345678901234567e+6" +PASS Number(-12345678.90123456789012).toExponential() is "-1.2345678901234567e+7" +PASS Number(-123456789.0123456789012).toExponential() is "-1.2345678901234567e+8" +PASS Number(-1234567890.123456789012).toExponential() is "-1.2345678901234567e+9" +PASS Number(-12345678901.23456789012).toExponential() is "-1.2345678901234568e+10" +PASS Number(-123456789012.3456789012).toExponential() is "-1.2345678901234567e+11" +PASS Number(-1234567890123.456789012).toExponential() is "-1.2345678901234568e+12" +PASS Number(-12345678901234.56789012).toExponential() is "-1.2345678901234568e+13" +PASS Number(-123456789012345.6789012).toExponential() is "-1.2345678901234567e+14" +PASS Number(-1234567890123456.789012).toExponential() is "-1.2345678901234568e+15" +PASS Number(-12345678901234567.89012).toExponential() is "-1.2345678901234568e+16" +PASS Number(-123456789012345678.9012).toExponential() is "-1.2345678901234568e+17" +PASS Number(-1234567890123456789.012).toExponential() is "-1.2345678901234568e+18" +PASS Number(-12345678901234567890.12).toExponential() is "-1.2345678901234567e+19" +PASS Number(-123456789012345678901.2).toExponential() is "-1.2345678901234568e+20" +PASS try { Number(1).toPrecision(-1); } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS try { Number(1).toPrecision(0); } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS try { Number(1).toPrecision(1); } catch (e) { String(e); } is "1" +PASS try { Number(1).toPrecision(21); } catch (e) { String(e); } is "1.00000000000000000000" +PASS try { Number(1).toPrecision(22); } catch (e) { String(e).indexOf('Range') >= 0; } is true +PASS Number(NaN).toPrecision() is "NaN" +PASS Number(NaN).toPrecision(1) is "NaN" +PASS Number(Infinity).toPrecision() is "Infinity" +PASS Number(Infinity).toPrecision(1) is "Infinity" +PASS Number(-Infinity).toPrecision() is "-Infinity" +PASS Number(-Infinity).toPrecision(1) is "-Infinity" +PASS Number(.0000000012345).toPrecision(2) is "1.2e-9" +PASS Number(.000000012345).toPrecision(2) is "1.2e-8" +PASS Number(.00000012345).toPrecision(2) is "1.2e-7" +PASS Number(.0000012345).toPrecision(2) is "0.0000012" +PASS Number(.000012345).toPrecision(2) is "0.000012" +PASS Number(.00012345).toPrecision(2) is "0.00012" +PASS Number(.0012345).toPrecision(2) is "0.0012" +PASS Number(.012345).toPrecision(2) is "0.012" +PASS Number(.12345).toPrecision(2) is "0.12" +PASS Number(1.2345).toPrecision(2) is "1.2" +PASS Number(12.345).toPrecision(2) is "12" +PASS Number(123.45).toPrecision(2) is "1.2e+2" +PASS Number(1234.5).toPrecision(2) is "1.2e+3" +PASS Number(12345).toPrecision(2) is "1.2e+4" +PASS Number(12345.67).toPrecision(4) is "1.235e+4" +PASS Number(12344.67).toPrecision(4) is "1.234e+4" +PASS Number(0.0001234567890123456789012345).toPrecision() is "0.00012345678901234567" +PASS Number(0.0001234567890123456789012345).toPrecision(1) is "0.0001" +PASS Number(0.0001234567890123456789012345).toPrecision(2) is "0.00012" +PASS Number(0.0001234567890123456789012345).toPrecision(3) is "0.000123" +PASS Number(0.0001234567890123456789012345).toPrecision(4) is "0.0001235" +PASS Number(0.0001234567890123456789012345).toPrecision(5) is "0.00012346" +PASS Number(0.0001234567890123456789012345).toPrecision(6) is "0.000123457" +PASS Number(0.0001234567890123456789012345).toPrecision(7) is "0.0001234568" +PASS Number(0.0001234567890123456789012345).toPrecision(8) is "0.00012345679" +PASS Number(0.0001234567890123456789012345).toPrecision(9) is "0.000123456789" +PASS Number(0.0001234567890123456789012345).toPrecision(10) is "0.0001234567890" +PASS Number(0.0001234567890123456789012345).toPrecision(11) is "0.00012345678901" +PASS Number(0.0001234567890123456789012345).toPrecision(12) is "0.000123456789012" +PASS Number(0.0001234567890123456789012345).toPrecision(13) is "0.0001234567890123" +PASS Number(0.0001234567890123456789012345).toPrecision(14) is "0.00012345678901235" +PASS Number(0.0001234567890123456789012345).toPrecision(15) is "0.000123456789012346" +PASS Number(0.0001234567890123456789012345).toPrecision(16) is "0.0001234567890123457" +PASS Number(0.0001234567890123456789012345).toPrecision(17) is "0.00012345678901234567" +PASS Number(0.0001234567890123456789012345).toPrecision(18) is "0.000123456789012345671" +PASS Number(0.0001234567890123456789012345).toPrecision(19) is "0.0001234567890123456713" +PASS Number(0.0001234567890123456789012345).toPrecision(20) is "0.00012345678901234567130" +PASS Number(0.0001234567890123456789012345).toPrecision(21) is "0.000123456789012345671298" +PASS Number(12345.67890123456789012345).toPrecision() is "12345.678901234567" +PASS Number(12345.67890123456789012345).toPrecision(1) is "1e+4" +PASS Number(12345.67890123456789012345).toPrecision(2) is "1.2e+4" +PASS Number(12345.67890123456789012345).toPrecision(3) is "1.23e+4" +PASS Number(12345.67890123456789012345).toPrecision(4) is "1.235e+4" +PASS Number(12345.67890123456789012345).toPrecision(5) is "12346" +PASS Number(12345.67890123456789012345).toPrecision(6) is "12345.7" +PASS Number(12345.67890123456789012345).toPrecision(7) is "12345.68" +PASS Number(12345.67890123456789012345).toPrecision(8) is "12345.679" +PASS Number(12345.67890123456789012345).toPrecision(9) is "12345.6789" +PASS Number(12345.67890123456789012345).toPrecision(10) is "12345.67890" +PASS Number(12345.67890123456789012345).toPrecision(11) is "12345.678901" +PASS Number(12345.67890123456789012345).toPrecision(12) is "12345.6789012" +PASS Number(12345.67890123456789012345).toPrecision(13) is "12345.67890123" +PASS Number(12345.67890123456789012345).toPrecision(14) is "12345.678901235" +PASS Number(12345.67890123456789012345).toPrecision(15) is "12345.6789012346" +PASS Number(12345.67890123456789012345).toPrecision(16) is "12345.67890123457" +PASS Number(12345.67890123456789012345).toPrecision(17) is "12345.678901234567" +PASS Number(12345.67890123456789012345).toPrecision(18) is "12345.6789012345671" +PASS Number(12345.67890123456789012345).toPrecision(19) is "12345.67890123456709" +PASS Number(12345.67890123456789012345).toPrecision(20) is "12345.678901234567093" +PASS Number(12345.67890123456789012345).toPrecision(21) is "12345.6789012345670926" +PASS Number(-.0000000012345).toPrecision(2) is "-1.2e-9" +PASS Number(-.000000012345).toPrecision(2) is "-1.2e-8" +PASS Number(-.00000012345).toPrecision(2) is "-1.2e-7" +PASS Number(-.0000012345).toPrecision(2) is "-0.0000012" +PASS Number(-.000012345).toPrecision(2) is "-0.000012" +PASS Number(-.00012345).toPrecision(2) is "-0.00012" +PASS Number(-.0012345).toPrecision(2) is "-0.0012" +PASS Number(-.012345).toPrecision(2) is "-0.012" +PASS Number(-.12345).toPrecision(2) is "-0.12" +PASS Number(-1.2345).toPrecision(2) is "-1.2" +PASS Number(-12.345).toPrecision(2) is "-12" +PASS Number(-123.45).toPrecision(2) is "-1.2e+2" +PASS Number(-1234.5).toPrecision(2) is "-1.2e+3" +PASS Number(-12345).toPrecision(2) is "-1.2e+4" +PASS Number(-12345.67).toPrecision(4) is "-1.235e+4" +PASS Number(-12344.67).toPrecision(4) is "-1.234e+4" +PASS Number(-0.0001234567890123456789012345).toPrecision() is "-0.00012345678901234567" +PASS Number(-0.0001234567890123456789012345).toPrecision(1) is "-0.0001" +PASS Number(-0.0001234567890123456789012345).toPrecision(2) is "-0.00012" +PASS Number(-0.0001234567890123456789012345).toPrecision(3) is "-0.000123" +PASS Number(-0.0001234567890123456789012345).toPrecision(4) is "-0.0001235" +PASS Number(-0.0001234567890123456789012345).toPrecision(5) is "-0.00012346" +PASS Number(-0.0001234567890123456789012345).toPrecision(6) is "-0.000123457" +PASS Number(-0.0001234567890123456789012345).toPrecision(7) is "-0.0001234568" +PASS Number(-0.0001234567890123456789012345).toPrecision(8) is "-0.00012345679" +PASS Number(-0.0001234567890123456789012345).toPrecision(9) is "-0.000123456789" +PASS Number(-0.0001234567890123456789012345).toPrecision(10) is "-0.0001234567890" +PASS Number(-0.0001234567890123456789012345).toPrecision(11) is "-0.00012345678901" +PASS Number(-0.0001234567890123456789012345).toPrecision(12) is "-0.000123456789012" +PASS Number(-0.0001234567890123456789012345).toPrecision(13) is "-0.0001234567890123" +PASS Number(-0.0001234567890123456789012345).toPrecision(14) is "-0.00012345678901235" +PASS Number(-0.0001234567890123456789012345).toPrecision(15) is "-0.000123456789012346" +PASS Number(-0.0001234567890123456789012345).toPrecision(16) is "-0.0001234567890123457" +PASS Number(-0.0001234567890123456789012345).toPrecision(17) is "-0.00012345678901234567" +PASS Number(-0.0001234567890123456789012345).toPrecision(18) is "-0.000123456789012345671" +PASS Number(-0.0001234567890123456789012345).toPrecision(19) is "-0.0001234567890123456713" +PASS Number(-0.0001234567890123456789012345).toPrecision(20) is "-0.00012345678901234567130" +PASS Number(-0.0001234567890123456789012345).toPrecision(21) is "-0.000123456789012345671298" +PASS Number(-12345.67890123456789012345).toPrecision() is "-12345.678901234567" +PASS Number(-12345.67890123456789012345).toPrecision(1) is "-1e+4" +PASS Number(-12345.67890123456789012345).toPrecision(2) is "-1.2e+4" +PASS Number(-12345.67890123456789012345).toPrecision(3) is "-1.23e+4" +PASS Number(-12345.67890123456789012345).toPrecision(4) is "-1.235e+4" +PASS Number(-12345.67890123456789012345).toPrecision(5) is "-12346" +PASS Number(-12345.67890123456789012345).toPrecision(6) is "-12345.7" +PASS Number(-12345.67890123456789012345).toPrecision(7) is "-12345.68" +PASS Number(-12345.67890123456789012345).toPrecision(8) is "-12345.679" +PASS Number(-12345.67890123456789012345).toPrecision(9) is "-12345.6789" +PASS Number(-12345.67890123456789012345).toPrecision(10) is "-12345.67890" +PASS Number(-12345.67890123456789012345).toPrecision(11) is "-12345.678901" +PASS Number(-12345.67890123456789012345).toPrecision(12) is "-12345.6789012" +PASS Number(-12345.67890123456789012345).toPrecision(13) is "-12345.67890123" +PASS Number(-12345.67890123456789012345).toPrecision(14) is "-12345.678901235" +PASS Number(-12345.67890123456789012345).toPrecision(15) is "-12345.6789012346" +PASS Number(-12345.67890123456789012345).toPrecision(16) is "-12345.67890123457" +PASS Number(-12345.67890123456789012345).toPrecision(17) is "-12345.678901234567" +PASS Number(-12345.67890123456789012345).toPrecision(18) is "-12345.6789012345671" +PASS Number(-12345.67890123456789012345).toPrecision(19) is "-12345.67890123456709" +PASS Number(-12345.67890123456789012345).toPrecision(20) is "-12345.678901234567093" +PASS Number(-12345.67890123456789012345).toPrecision(21) is "-12345.6789012345670926" +PASS Number(0).toPrecision() is "0" +PASS Number(0).toPrecision(1) is "0" +PASS Number(0).toPrecision(2) is "0.0" +PASS Number(0).toPrecision(3) is "0.00" +PASS Number(0).toPrecision(4) is "0.000" +PASS Number(0).toPrecision(5) is "0.0000" +PASS Number(0).toPrecision(6) is "0.00000" +PASS Number(0).toPrecision(7) is "0.000000" +PASS Number(0).toPrecision(8) is "0.0000000" +PASS Number(0).toPrecision(9) is "0.00000000" +PASS Number(0).toPrecision(10) is "0.000000000" +PASS Number(0).toPrecision(11) is "0.0000000000" +PASS Number(0).toPrecision(12) is "0.00000000000" +PASS Number(0).toPrecision(13) is "0.000000000000" +PASS Number(0).toPrecision(14) is "0.0000000000000" +PASS Number(0).toPrecision(15) is "0.00000000000000" +PASS Number(0).toPrecision(16) is "0.000000000000000" +PASS Number(0).toPrecision(17) is "0.0000000000000000" +PASS Number(0).toPrecision(18) is "0.00000000000000000" +PASS Number(0).toPrecision(19) is "0.000000000000000000" +PASS Number(0).toPrecision(20) is "0.0000000000000000000" +PASS Number(0).toPrecision(21) is "0.00000000000000000000" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Number.js b/deps/v8/test/webkit/fast/js/kde/Number.js new file mode 100644 index 0000000000..358fe7a09f --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Number.js @@ -0,0 +1,499 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Number()", "0"); +shouldBe("Number(1)", "1"); +shouldBe("Number(1.1)", "1.1"); +shouldBe("Number('1.2')", "1.2"); +shouldBe("isNaN(Number('a'))", "true"); + +shouldBe("(new Number()).valueOf()", "0"); +shouldBe("(new Number(.4)).valueOf()", "0.4"); +shouldBe("(new Number('1.')).valueOf()", "1"); +shouldBe("isNaN(new Number('a'))", "true"); + +shouldBe("isNaN(Number.NaN)", "true"); +shouldBe("Number.NEGATIVE_INFINITY", "-Infinity"); +shouldBe("Number.POSITIVE_INFINITY", "Infinity"); + +shouldBe("(1).toString()", "'1'"); +shouldBe("typeof (1).toString()", "'string'"); +shouldBe("(10).toString(16)", "'a'"); +shouldBe("(8.5).toString(16)", "'8.8'"); +shouldBe("(-8.5).toString(16)", "'-8.8'"); +shouldBe("Number.NaN.toString(16)", "'NaN'"); +shouldBe("Number.POSITIVE_INFINITY.toString(16)", "'Infinity'"); +shouldBe("Number.NEGATIVE_INFINITY.toString(16)", "'-Infinity'"); +shouldBe("Number.MAX_VALUE.toString(2).length", "1024"); +shouldBe("(1).valueOf()", "1"); +shouldBe("typeof (1).valueOf()", "'number'"); + +function toFixedOrException(val,fractionDigits) +{ + var s = ""; + try { + s = String(Number(val).toFixed(fractionDigits)); + } + catch (e) { + s = String(e); + } + return s; +} + +shouldBe("Number(1234.567).toFixed(0)","\"1235\""); +shouldBe("Number(1234.567).toFixed(undefined)","\"1235\""); +shouldBe("Number(-1234.567).toFixed(0)","\"-1235\""); +shouldBe("Number(-1234.567).toFixed(undefined)","\"-1235\""); +shouldBe("Number(0).toFixed(7)","\"0.0000000\""); +shouldBe("Number(0.003).toFixed(0)","\"0\""); +shouldBe("Number(-0.003).toFixed(0)","\"-0\""); +shouldBe("Number(40.1234567890123).toFixed(7)","\"40.1234568\""); +shouldBe("Number(-40.1234567890123).toFixed(7)","\"-40.1234568\""); +shouldBe("Number(4).toFixed(7)","\"4.0000000\""); +shouldBe("Number(-4).toFixed(7)","\"-4.0000000\""); +shouldBe("Number(0.000056).toFixed(7)","\"0.0000560\""); +shouldBe("Number(-0.000056).toFixed(7)","\"-0.0000560\""); +shouldBe("Number(NaN).toFixed(7)","\"NaN\""); +shouldBe("Number(Infinity).toFixed(7)","\"Infinity\""); +shouldBe("Number(-Infinity).toFixed(7)","\"-Infinity\""); +shouldBe("Number(Math.pow(10,4)).toFixed(13)","\"10000.0000000000000\""); +shouldBe("Number(Math.pow(10,17)).toFixed(16)","\"100000000000000000.0000000000000000\""); +shouldBe("Number(Math.pow(10,18)).toFixed(17)","\"1000000000000000000.00000000000000000\""); +shouldBe("Number(Math.pow(10,19)).toFixed(18)","\"10000000000000000000.000000000000000000\""); +shouldBe("Number(Math.pow(10,17)).toFixed(20)","\"100000000000000000.00000000000000000000\""); +shouldBe("Number(Math.pow(10,18)).toFixed(20)","\"1000000000000000000.00000000000000000000\""); +shouldBe("Number(Math.pow(10,19)).toFixed(20)","\"10000000000000000000.00000000000000000000\""); +shouldBe("Number(Math.pow(10,20)).toFixed(20)","\"100000000000000000000.00000000000000000000\""); +shouldBe("Number(Math.pow(10,21)).toFixed(20)","\"1e+21\""); +shouldBe("Number(-Math.pow(10,4)).toFixed(13)","\"-10000.0000000000000\""); +shouldBe("Number(-Math.pow(10,17)).toFixed(16)","\"-100000000000000000.0000000000000000\""); +shouldBe("Number(-Math.pow(10,18)).toFixed(17)","\"-1000000000000000000.00000000000000000\""); +shouldBe("Number(-Math.pow(10,19)).toFixed(18)","\"-10000000000000000000.000000000000000000\""); +shouldBe("Number(-Math.pow(10,17)).toFixed(20)","\"-100000000000000000.00000000000000000000\""); +shouldBe("Number(-Math.pow(10,18)).toFixed(20)","\"-1000000000000000000.00000000000000000000\""); +shouldBe("Number(-Math.pow(10,19)).toFixed(20)","\"-10000000000000000000.00000000000000000000\""); +shouldBe("Number(-Math.pow(10,20)).toFixed(20)","\"-100000000000000000000.00000000000000000000\""); +shouldBe("Number(-Math.pow(10,21)).toFixed(20)","\"-1e+21\""); +shouldBeTrue("toFixedOrException(2,-1).indexOf('Range') >= 0"); +shouldBe("Number(2).toFixed(0)","\"2\""); +shouldBe("Number(2).toFixed(20)","\"2.00000000000000000000\""); +shouldBeTrue("toFixedOrException(2,21).indexOf('Range') >= 0"); +shouldBeTrue("toFixedOrException(-2,-1).indexOf('Range') >= 0"); +shouldBe("Number(-2).toFixed(0)","\"-2\""); +shouldBe("Number(-2).toFixed(20)","\"-2.00000000000000000000\""); +shouldBeTrue("toFixedOrException(-2,21).indexOf('Range') >= 0"); + + + + +shouldBe("Number(NaN).toExponential()","\"NaN\""); +shouldBe("Number(Infinity).toExponential()","\"Infinity\""); +shouldBe("Number(-Infinity).toExponential()","\"-Infinity\""); +shouldBe("Number(NaN).toExponential(4)","\"NaN\""); +shouldBe("Number(Infinity).toExponential(4)","\"Infinity\""); +shouldBe("Number(-Infinity).toExponential(4)","\"-Infinity\""); +shouldBe("Number(123.456).toExponential()","\"1.23456e+2\""); +shouldBeTrue("try { Number(123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(123.456).toExponential(0)","\"1e+2\""); +shouldBe("Number(123.456).toExponential(1)","\"1.2e+2\""); +shouldBe("Number(123.456).toExponential(2)","\"1.23e+2\""); +shouldBe("Number(123.456).toExponential(3)","\"1.235e+2\""); +shouldBe("Number(123.456).toExponential(4)","\"1.2346e+2\""); +shouldBe("Number(123.456).toExponential(5)","\"1.23456e+2\""); +shouldBe("Number(123.456).toExponential(6)","\"1.234560e+2\""); +shouldBe("Number(123.456).toExponential(7)","\"1.2345600e+2\""); +shouldBe("Number(123.456).toExponential(8)","\"1.23456000e+2\""); +shouldBe("Number(123.456).toExponential(9)","\"1.234560000e+2\""); +shouldBe("Number(123.456).toExponential(10)","\"1.2345600000e+2\""); +shouldBe("Number(123.456).toExponential(11)","\"1.23456000000e+2\""); +shouldBe("Number(123.456).toExponential(12)","\"1.234560000000e+2\""); +shouldBe("Number(123.456).toExponential(13)","\"1.2345600000000e+2\""); +shouldBe("Number(123.456).toExponential(14)","\"1.23456000000000e+2\""); +shouldBe("Number(123.456).toExponential(15)","\"1.234560000000000e+2\""); +shouldBe("Number(123.456).toExponential(16)","\"1.2345600000000000e+2\""); +shouldBe("Number(123.456).toExponential(17)","\"1.23456000000000003e+2\""); +shouldBe("Number(123.456).toExponential(18)","\"1.234560000000000031e+2\""); +shouldBe("Number(123.456).toExponential(19)","\"1.2345600000000000307e+2\""); +shouldBe("Number(123.456).toExponential(20)","\"1.23456000000000003070e+2\""); +shouldBeTrue("try { Number(123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-123.456).toExponential()","\"-1.23456e+2\""); +shouldBeTrue("try { Number(-123.456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-123.456).toExponential(0)","\"-1e+2\""); +shouldBe("Number(-123.456).toExponential(1)","\"-1.2e+2\""); +shouldBe("Number(-123.456).toExponential(2)","\"-1.23e+2\""); +shouldBe("Number(-123.456).toExponential(3)","\"-1.235e+2\""); +shouldBe("Number(-123.456).toExponential(4)","\"-1.2346e+2\""); +shouldBe("Number(-123.456).toExponential(5)","\"-1.23456e+2\""); +shouldBe("Number(-123.456).toExponential(6)","\"-1.234560e+2\""); +shouldBe("Number(-123.456).toExponential(7)","\"-1.2345600e+2\""); +shouldBe("Number(-123.456).toExponential(8)","\"-1.23456000e+2\""); +shouldBe("Number(-123.456).toExponential(9)","\"-1.234560000e+2\""); +shouldBe("Number(-123.456).toExponential(10)","\"-1.2345600000e+2\""); +shouldBe("Number(-123.456).toExponential(11)","\"-1.23456000000e+2\""); +shouldBe("Number(-123.456).toExponential(12)","\"-1.234560000000e+2\""); +shouldBe("Number(-123.456).toExponential(13)","\"-1.2345600000000e+2\""); +shouldBe("Number(-123.456).toExponential(14)","\"-1.23456000000000e+2\""); +shouldBe("Number(-123.456).toExponential(15)","\"-1.234560000000000e+2\""); +shouldBe("Number(-123.456).toExponential(16)","\"-1.2345600000000000e+2\""); +shouldBe("Number(-123.456).toExponential(17)","\"-1.23456000000000003e+2\""); +shouldBe("Number(-123.456).toExponential(18)","\"-1.234560000000000031e+2\""); +shouldBe("Number(-123.456).toExponential(19)","\"-1.2345600000000000307e+2\""); +shouldBe("Number(-123.456).toExponential(20)","\"-1.23456000000000003070e+2\""); +shouldBeTrue("try { Number(-123.456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(.000123456).toExponential()","\"1.23456e-4\""); +shouldBeTrue("try { Number(.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(.000123456).toExponential(0)","\"1e-4\""); +shouldBe("Number(.000123456).toExponential(1)","\"1.2e-4\""); +shouldBe("Number(.000123456).toExponential(2)","\"1.23e-4\""); +shouldBe("Number(.000123456).toExponential(3)","\"1.235e-4\""); +shouldBe("Number(.000123456).toExponential(4)","\"1.2346e-4\""); +shouldBe("Number(.000123456).toExponential(5)","\"1.23456e-4\""); +shouldBe("Number(.000123456).toExponential(6)","\"1.234560e-4\""); +shouldBe("Number(.000123456).toExponential(7)","\"1.2345600e-4\""); +shouldBe("Number(.000123456).toExponential(8)","\"1.23456000e-4\""); +shouldBe("Number(.000123456).toExponential(9)","\"1.234560000e-4\""); +shouldBe("Number(.000123456).toExponential(10)","\"1.2345600000e-4\""); +shouldBe("Number(.000123456).toExponential(11)","\"1.23456000000e-4\""); +shouldBe("Number(.000123456).toExponential(12)","\"1.234560000000e-4\""); +shouldBe("Number(.000123456).toExponential(13)","\"1.2345600000000e-4\""); +shouldBe("Number(.000123456).toExponential(14)","\"1.23456000000000e-4\""); +shouldBe("Number(.000123456).toExponential(15)","\"1.234560000000000e-4\""); +shouldBe("Number(.000123456).toExponential(16)","\"1.2345600000000001e-4\""); +shouldBe("Number(.000123456).toExponential(17)","\"1.23456000000000005e-4\""); +shouldBe("Number(.000123456).toExponential(18)","\"1.234560000000000052e-4\""); +shouldBe("Number(.000123456).toExponential(19)","\"1.2345600000000000519e-4\""); +shouldBe("Number(.000123456).toExponential(20)","\"1.23456000000000005188e-4\""); +shouldBeTrue("try { Number(.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-.000123456).toExponential()","\"-1.23456e-4\""); +shouldBeTrue("try { Number(-.000123456).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-.000123456).toExponential(0)","\"-1e-4\""); +shouldBe("Number(-.000123456).toExponential(1)","\"-1.2e-4\""); +shouldBe("Number(-.000123456).toExponential(2)","\"-1.23e-4\""); +shouldBe("Number(-.000123456).toExponential(3)","\"-1.235e-4\""); +shouldBe("Number(-.000123456).toExponential(4)","\"-1.2346e-4\""); +shouldBe("Number(-.000123456).toExponential(5)","\"-1.23456e-4\""); +shouldBe("Number(-.000123456).toExponential(6)","\"-1.234560e-4\""); +shouldBe("Number(-.000123456).toExponential(7)","\"-1.2345600e-4\""); +shouldBe("Number(-.000123456).toExponential(8)","\"-1.23456000e-4\""); +shouldBe("Number(-.000123456).toExponential(9)","\"-1.234560000e-4\""); +shouldBe("Number(-.000123456).toExponential(10)","\"-1.2345600000e-4\""); +shouldBe("Number(-.000123456).toExponential(11)","\"-1.23456000000e-4\""); +shouldBe("Number(-.000123456).toExponential(12)","\"-1.234560000000e-4\""); +shouldBe("Number(-.000123456).toExponential(13)","\"-1.2345600000000e-4\""); +shouldBe("Number(-.000123456).toExponential(14)","\"-1.23456000000000e-4\""); +shouldBe("Number(-.000123456).toExponential(15)","\"-1.234560000000000e-4\""); +shouldBe("Number(-.000123456).toExponential(16)","\"-1.2345600000000001e-4\""); +shouldBe("Number(-.000123456).toExponential(17)","\"-1.23456000000000005e-4\""); +shouldBe("Number(-.000123456).toExponential(18)","\"-1.234560000000000052e-4\""); +shouldBe("Number(-.000123456).toExponential(19)","\"-1.2345600000000000519e-4\""); +shouldBe("Number(-.000123456).toExponential(20)","\"-1.23456000000000005188e-4\""); +shouldBeTrue("try { Number(-.000123456).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(123.4567890123456789012).toExponential()","\"1.2345678901234568e+2\""); +shouldBeTrue("try { Number(123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(123.4567890123456789012).toExponential(0)","\"1e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(1)","\"1.2e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(2)","\"1.23e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(3)","\"1.235e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(4)","\"1.2346e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(5)","\"1.23457e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(6)","\"1.234568e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(7)","\"1.2345679e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(8)","\"1.23456789e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(9)","\"1.234567890e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(10)","\"1.2345678901e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(11)","\"1.23456789012e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(12)","\"1.234567890123e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(13)","\"1.2345678901235e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(14)","\"1.23456789012346e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(15)","\"1.234567890123457e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(16)","\"1.2345678901234568e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(17)","\"1.23456789012345681e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(18)","\"1.234567890123456806e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(19)","\"1.2345678901234568059e+2\""); +shouldBe("Number(123.4567890123456789012).toExponential(20)","\"1.23456789012345680590e+2\""); +shouldBeTrue("try { Number(123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-123.4567890123456789012).toExponential()","\"-1.2345678901234568e+2\""); +shouldBeTrue("try { Number(-123.4567890123456789012).toExponential(-1) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(-123.4567890123456789012).toExponential(0)","\"-1e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(1)","\"-1.2e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(2)","\"-1.23e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(3)","\"-1.235e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(4)","\"-1.2346e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(5)","\"-1.23457e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(6)","\"-1.234568e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(7)","\"-1.2345679e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(8)","\"-1.23456789e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(9)","\"-1.234567890e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(10)","\"-1.2345678901e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(11)","\"-1.23456789012e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(12)","\"-1.234567890123e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(13)","\"-1.2345678901235e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(14)","\"-1.23456789012346e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(15)","\"-1.234567890123457e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(16)","\"-1.2345678901234568e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(17)","\"-1.23456789012345681e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(18)","\"-1.234567890123456806e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(19)","\"-1.2345678901234568059e+2\""); +shouldBe("Number(-123.4567890123456789012).toExponential(20)","\"-1.23456789012345680590e+2\""); +shouldBeTrue("try { Number(-123.4567890123456789012).toExponential(21) } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(.0000000000000000000001).toExponential()","\"1e-22\""); +shouldBe("Number(.0000000000000000000012).toExponential()","\"1.2e-21\""); +shouldBe("Number(.0000000000000000000123).toExponential()","\"1.23e-20\""); +shouldBe("Number(.0000000000000000000123).toExponential()","\"1.23e-20\""); +shouldBe("Number(.0000000000000000001234).toExponential()","\"1.234e-19\""); +shouldBe("Number(.0000000000000000012345).toExponential()","\"1.2345e-18\""); +shouldBe("Number(.0000000000000000123456).toExponential()","\"1.23456e-17\""); +shouldBe("Number(.0000000000000001234567).toExponential()","\"1.234567e-16\""); +shouldBe("Number(.0000000000000012345678).toExponential()","\"1.2345678e-15\""); +shouldBe("Number(.0000000000000123456789).toExponential()","\"1.23456789e-14\""); +shouldBe("Number(.0000000000001234567890).toExponential()","\"1.23456789e-13\""); +shouldBe("Number(.0000000000012345678901).toExponential()","\"1.2345678901e-12\""); +shouldBe("Number(.0000000000123456789012).toExponential()","\"1.23456789012e-11\""); +shouldBe("Number(.0000000001234567890123).toExponential()","\"1.234567890123e-10\""); +shouldBe("Number(.0000000012345678901234).toExponential()","\"1.2345678901234e-9\""); +shouldBe("Number(.0000000123456789012345).toExponential()","\"1.23456789012345e-8\""); +shouldBe("Number(.0000001234567890123456).toExponential()","\"1.234567890123456e-7\""); +shouldBe("Number(.0000012345678901234567).toExponential()","\"1.2345678901234567e-6\""); +shouldBe("Number(.0000123456789012345678).toExponential()","\"1.2345678901234568e-5\""); +shouldBe("Number(.0001234567890123456789).toExponential()","\"1.2345678901234567e-4\""); +shouldBe("Number(.0012345678901234567890).toExponential()","\"1.2345678901234567e-3\""); +shouldBe("Number(.0123456789012345678901).toExponential()","\"1.2345678901234568e-2\""); +shouldBe("Number(1.234567890123456789012).toExponential()","\"1.2345678901234567e+0\""); +shouldBe("Number(12.34567890123456789012).toExponential()","\"1.2345678901234567e+1\""); +shouldBe("Number(123.4567890123456789012).toExponential()","\"1.2345678901234568e+2\""); +shouldBe("Number(1234.567890123456789012).toExponential()","\"1.234567890123457e+3\""); +shouldBe("Number(12345.67890123456789012).toExponential()","\"1.2345678901234567e+4\""); +shouldBe("Number(123456.7890123456789012).toExponential()","\"1.2345678901234567e+5\""); +shouldBe("Number(1234567.890123456789012).toExponential()","\"1.2345678901234567e+6\""); +shouldBe("Number(12345678.90123456789012).toExponential()","\"1.2345678901234567e+7\""); +shouldBe("Number(123456789.0123456789012).toExponential()","\"1.2345678901234567e+8\""); +shouldBe("Number(1234567890.123456789012).toExponential()","\"1.2345678901234567e+9\""); +shouldBe("Number(12345678901.23456789012).toExponential()","\"1.2345678901234568e+10\""); +shouldBe("Number(123456789012.3456789012).toExponential()","\"1.2345678901234567e+11\""); +shouldBe("Number(1234567890123.456789012).toExponential()","\"1.2345678901234568e+12\""); +shouldBe("Number(12345678901234.56789012).toExponential()","\"1.2345678901234568e+13\""); +shouldBe("Number(123456789012345.6789012).toExponential()","\"1.2345678901234567e+14\""); +shouldBe("Number(1234567890123456.789012).toExponential()","\"1.2345678901234568e+15\""); +shouldBe("Number(12345678901234567.89012).toExponential()","\"1.2345678901234568e+16\""); +shouldBe("Number(123456789012345678.9012).toExponential()","\"1.2345678901234568e+17\""); +shouldBe("Number(1234567890123456789.012).toExponential()","\"1.2345678901234568e+18\""); +shouldBe("Number(12345678901234567890.12).toExponential()","\"1.2345678901234567e+19\""); +shouldBe("Number(123456789012345678901.2).toExponential()","\"1.2345678901234568e+20\""); +shouldBe("Number(-.0000000000000000000001).toExponential()","\"-1e-22\""); +shouldBe("Number(-.0000000000000000000012).toExponential()","\"-1.2e-21\""); +shouldBe("Number(-.0000000000000000000123).toExponential()","\"-1.23e-20\""); +shouldBe("Number(-.0000000000000000000123).toExponential()","\"-1.23e-20\""); +shouldBe("Number(-.0000000000000000001234).toExponential()","\"-1.234e-19\""); +shouldBe("Number(-.0000000000000000012345).toExponential()","\"-1.2345e-18\""); +shouldBe("Number(-.0000000000000000123456).toExponential()","\"-1.23456e-17\""); +shouldBe("Number(-.0000000000000001234567).toExponential()","\"-1.234567e-16\""); +shouldBe("Number(-.0000000000000012345678).toExponential()","\"-1.2345678e-15\""); +shouldBe("Number(-.0000000000000123456789).toExponential()","\"-1.23456789e-14\""); +shouldBe("Number(-.0000000000001234567890).toExponential()","\"-1.23456789e-13\""); +shouldBe("Number(-.0000000000012345678901).toExponential()","\"-1.2345678901e-12\""); +shouldBe("Number(-.0000000000123456789012).toExponential()","\"-1.23456789012e-11\""); +shouldBe("Number(-.0000000001234567890123).toExponential()","\"-1.234567890123e-10\""); +shouldBe("Number(-.0000000012345678901234).toExponential()","\"-1.2345678901234e-9\""); +shouldBe("Number(-.0000000123456789012345).toExponential()","\"-1.23456789012345e-8\""); +shouldBe("Number(-.0000001234567890123456).toExponential()","\"-1.234567890123456e-7\""); +shouldBe("Number(-.0000012345678901234567).toExponential()","\"-1.2345678901234567e-6\""); +shouldBe("Number(-.0000123456789012345678).toExponential()","\"-1.2345678901234568e-5\""); +shouldBe("Number(-.0001234567890123456789).toExponential()","\"-1.2345678901234567e-4\""); +shouldBe("Number(-.0012345678901234567890).toExponential()","\"-1.2345678901234567e-3\""); +shouldBe("Number(-.0123456789012345678901).toExponential()","\"-1.2345678901234568e-2\""); +shouldBe("Number(-1.234567890123456789012).toExponential()","\"-1.2345678901234567e+0\""); +shouldBe("Number(-12.34567890123456789012).toExponential()","\"-1.2345678901234567e+1\""); +shouldBe("Number(-123.4567890123456789012).toExponential()","\"-1.2345678901234568e+2\""); +shouldBe("Number(-1234.567890123456789012).toExponential()","\"-1.234567890123457e+3\""); +shouldBe("Number(-12345.67890123456789012).toExponential()","\"-1.2345678901234567e+4\""); +shouldBe("Number(-123456.7890123456789012).toExponential()","\"-1.2345678901234567e+5\""); +shouldBe("Number(-1234567.890123456789012).toExponential()","\"-1.2345678901234567e+6\""); +shouldBe("Number(-12345678.90123456789012).toExponential()","\"-1.2345678901234567e+7\""); +shouldBe("Number(-123456789.0123456789012).toExponential()","\"-1.2345678901234567e+8\""); +shouldBe("Number(-1234567890.123456789012).toExponential()","\"-1.2345678901234567e+9\""); +shouldBe("Number(-12345678901.23456789012).toExponential()","\"-1.2345678901234568e+10\""); +shouldBe("Number(-123456789012.3456789012).toExponential()","\"-1.2345678901234567e+11\""); +shouldBe("Number(-1234567890123.456789012).toExponential()","\"-1.2345678901234568e+12\""); +shouldBe("Number(-12345678901234.56789012).toExponential()","\"-1.2345678901234568e+13\""); +shouldBe("Number(-123456789012345.6789012).toExponential()","\"-1.2345678901234567e+14\""); +shouldBe("Number(-1234567890123456.789012).toExponential()","\"-1.2345678901234568e+15\""); +shouldBe("Number(-12345678901234567.89012).toExponential()","\"-1.2345678901234568e+16\""); +shouldBe("Number(-123456789012345678.9012).toExponential()","\"-1.2345678901234568e+17\""); +shouldBe("Number(-1234567890123456789.012).toExponential()","\"-1.2345678901234568e+18\""); +shouldBe("Number(-12345678901234567890.12).toExponential()","\"-1.2345678901234567e+19\""); +shouldBe("Number(-123456789012345678901.2).toExponential()","\"-1.2345678901234568e+20\""); + +shouldBeTrue("try { Number(1).toPrecision(-1); } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBeTrue("try { Number(1).toPrecision(0); } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("try { Number(1).toPrecision(1); } catch (e) { String(e); }","\"1\""); +shouldBe("try { Number(1).toPrecision(21); } catch (e) { String(e); }","\"1.00000000000000000000\""); +shouldBeTrue("try { Number(1).toPrecision(22); } catch (e) { String(e).indexOf('Range') >= 0; }"); +shouldBe("Number(NaN).toPrecision()","\"NaN\""); +shouldBe("Number(NaN).toPrecision(1)","\"NaN\""); +shouldBe("Number(Infinity).toPrecision()","\"Infinity\""); +shouldBe("Number(Infinity).toPrecision(1)","\"Infinity\""); +shouldBe("Number(-Infinity).toPrecision()","\"-Infinity\""); +shouldBe("Number(-Infinity).toPrecision(1)","\"-Infinity\""); +shouldBe("Number(.0000000012345).toPrecision(2)","\"1.2e-9\""); +shouldBe("Number(.000000012345).toPrecision(2)","\"1.2e-8\""); +shouldBe("Number(.00000012345).toPrecision(2)","\"1.2e-7\""); +shouldBe("Number(.0000012345).toPrecision(2)","\"0.0000012\""); +shouldBe("Number(.000012345).toPrecision(2)","\"0.000012\""); +shouldBe("Number(.00012345).toPrecision(2)","\"0.00012\""); +shouldBe("Number(.0012345).toPrecision(2)","\"0.0012\""); +shouldBe("Number(.012345).toPrecision(2)","\"0.012\""); +shouldBe("Number(.12345).toPrecision(2)","\"0.12\""); +shouldBe("Number(1.2345).toPrecision(2)","\"1.2\""); +shouldBe("Number(12.345).toPrecision(2)","\"12\""); +shouldBe("Number(123.45).toPrecision(2)","\"1.2e+2\""); +shouldBe("Number(1234.5).toPrecision(2)","\"1.2e+3\""); +shouldBe("Number(12345).toPrecision(2)","\"1.2e+4\""); +shouldBe("Number(12345.67).toPrecision(4)","\"1.235e+4\""); +shouldBe("Number(12344.67).toPrecision(4)","\"1.234e+4\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision()","\"0.00012345678901234567\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(1)","\"0.0001\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(2)","\"0.00012\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(3)","\"0.000123\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(4)","\"0.0001235\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(5)","\"0.00012346\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(6)","\"0.000123457\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(7)","\"0.0001234568\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(8)","\"0.00012345679\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(9)","\"0.000123456789\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(10)","\"0.0001234567890\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(11)","\"0.00012345678901\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(12)","\"0.000123456789012\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(13)","\"0.0001234567890123\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(14)","\"0.00012345678901235\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(15)","\"0.000123456789012346\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(16)","\"0.0001234567890123457\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(17)","\"0.00012345678901234567\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(18)","\"0.000123456789012345671\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(19)","\"0.0001234567890123456713\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(20)","\"0.00012345678901234567130\""); +shouldBe("Number(0.0001234567890123456789012345).toPrecision(21)","\"0.000123456789012345671298\""); +shouldBe("Number(12345.67890123456789012345).toPrecision()","\"12345.678901234567\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(1)","\"1e+4\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(2)","\"1.2e+4\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(3)","\"1.23e+4\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(4)","\"1.235e+4\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(5)","\"12346\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(6)","\"12345.7\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(7)","\"12345.68\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(8)","\"12345.679\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(9)","\"12345.6789\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(10)","\"12345.67890\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(11)","\"12345.678901\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(12)","\"12345.6789012\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(13)","\"12345.67890123\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(14)","\"12345.678901235\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(15)","\"12345.6789012346\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(16)","\"12345.67890123457\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(17)","\"12345.678901234567\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(18)","\"12345.6789012345671\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(19)","\"12345.67890123456709\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(20)","\"12345.678901234567093\""); +shouldBe("Number(12345.67890123456789012345).toPrecision(21)","\"12345.6789012345670926\""); +shouldBe("Number(-.0000000012345).toPrecision(2)","\"-1.2e-9\""); +shouldBe("Number(-.000000012345).toPrecision(2)","\"-1.2e-8\""); +shouldBe("Number(-.00000012345).toPrecision(2)","\"-1.2e-7\""); +shouldBe("Number(-.0000012345).toPrecision(2)","\"-0.0000012\""); +shouldBe("Number(-.000012345).toPrecision(2)","\"-0.000012\""); +shouldBe("Number(-.00012345).toPrecision(2)","\"-0.00012\""); +shouldBe("Number(-.0012345).toPrecision(2)","\"-0.0012\""); +shouldBe("Number(-.012345).toPrecision(2)","\"-0.012\""); +shouldBe("Number(-.12345).toPrecision(2)","\"-0.12\""); +shouldBe("Number(-1.2345).toPrecision(2)","\"-1.2\""); +shouldBe("Number(-12.345).toPrecision(2)","\"-12\""); +shouldBe("Number(-123.45).toPrecision(2)","\"-1.2e+2\""); +shouldBe("Number(-1234.5).toPrecision(2)","\"-1.2e+3\""); +shouldBe("Number(-12345).toPrecision(2)","\"-1.2e+4\""); +shouldBe("Number(-12345.67).toPrecision(4)","\"-1.235e+4\""); +shouldBe("Number(-12344.67).toPrecision(4)","\"-1.234e+4\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision()","\"-0.00012345678901234567\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(1)","\"-0.0001\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(2)","\"-0.00012\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(3)","\"-0.000123\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(4)","\"-0.0001235\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(5)","\"-0.00012346\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(6)","\"-0.000123457\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(7)","\"-0.0001234568\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(8)","\"-0.00012345679\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(9)","\"-0.000123456789\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(10)","\"-0.0001234567890\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(11)","\"-0.00012345678901\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(12)","\"-0.000123456789012\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(13)","\"-0.0001234567890123\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(14)","\"-0.00012345678901235\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(15)","\"-0.000123456789012346\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(16)","\"-0.0001234567890123457\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(17)","\"-0.00012345678901234567\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(18)","\"-0.000123456789012345671\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(19)","\"-0.0001234567890123456713\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(20)","\"-0.00012345678901234567130\""); +shouldBe("Number(-0.0001234567890123456789012345).toPrecision(21)","\"-0.000123456789012345671298\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision()","\"-12345.678901234567\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(1)","\"-1e+4\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(2)","\"-1.2e+4\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(3)","\"-1.23e+4\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(4)","\"-1.235e+4\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(5)","\"-12346\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(6)","\"-12345.7\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(7)","\"-12345.68\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(8)","\"-12345.679\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(9)","\"-12345.6789\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(10)","\"-12345.67890\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(11)","\"-12345.678901\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(12)","\"-12345.6789012\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(13)","\"-12345.67890123\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(14)","\"-12345.678901235\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(15)","\"-12345.6789012346\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(16)","\"-12345.67890123457\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(17)","\"-12345.678901234567\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(18)","\"-12345.6789012345671\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(19)","\"-12345.67890123456709\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(20)","\"-12345.678901234567093\""); +shouldBe("Number(-12345.67890123456789012345).toPrecision(21)","\"-12345.6789012345670926\""); +shouldBe("Number(0).toPrecision()","\"0\""); +shouldBe("Number(0).toPrecision(1)","\"0\""); +shouldBe("Number(0).toPrecision(2)","\"0.0\""); +shouldBe("Number(0).toPrecision(3)","\"0.00\""); +shouldBe("Number(0).toPrecision(4)","\"0.000\""); +shouldBe("Number(0).toPrecision(5)","\"0.0000\""); +shouldBe("Number(0).toPrecision(6)","\"0.00000\""); +shouldBe("Number(0).toPrecision(7)","\"0.000000\""); +shouldBe("Number(0).toPrecision(8)","\"0.0000000\""); +shouldBe("Number(0).toPrecision(9)","\"0.00000000\""); +shouldBe("Number(0).toPrecision(10)","\"0.000000000\""); +shouldBe("Number(0).toPrecision(11)","\"0.0000000000\""); +shouldBe("Number(0).toPrecision(12)","\"0.00000000000\""); +shouldBe("Number(0).toPrecision(13)","\"0.000000000000\""); +shouldBe("Number(0).toPrecision(14)","\"0.0000000000000\""); +shouldBe("Number(0).toPrecision(15)","\"0.00000000000000\""); +shouldBe("Number(0).toPrecision(16)","\"0.000000000000000\""); +shouldBe("Number(0).toPrecision(17)","\"0.0000000000000000\""); +shouldBe("Number(0).toPrecision(18)","\"0.00000000000000000\""); +shouldBe("Number(0).toPrecision(19)","\"0.000000000000000000\""); +shouldBe("Number(0).toPrecision(20)","\"0.0000000000000000000\""); +shouldBe("Number(0).toPrecision(21)","\"0.00000000000000000000\"");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Object-expected.txt b/deps/v8/test/webkit/fast/js/kde/Object-expected.txt new file mode 100644 index 0000000000..8c1372d11d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Object-expected.txt @@ -0,0 +1,44 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS typeof Object() is 'object' +PASS var o = Object(); o.x = 11; o.x; is 11 +PASS Object(1).valueOf() is 1 +PASS Object(true).valueOf() is true +PASS Object('s').valueOf() is 's' +PASS typeof (new Object()) is 'object' +PASS (new Object(1)).valueOf() is 1 +PASS (new Object(true)).valueOf() is true +PASS (new Object('s')).valueOf() is 's' +PASS String(Object()) is '[object Object]' +PASS Object().toString() is '[object Object]' +PASS String(Object().valueOf()) is '[object Object]' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Object.js b/deps/v8/test/webkit/fast/js/kde/Object.js new file mode 100644 index 0000000000..2637309464 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Object.js @@ -0,0 +1,42 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("typeof Object()", "'object'"); +shouldBe("var o = Object(); o.x = 11; o.x;", "11"); // wanted behaviour ? +// shouldBe("Object(undefined)", ???); +// shouldBe("Object(null)", ???); +shouldBe("Object(1).valueOf()", "1"); +shouldBe("Object(true).valueOf()", "true"); +shouldBe("Object('s').valueOf()", "'s'"); + +shouldBe("typeof (new Object())", "'object'"); +// shouldBe("new Object(undefined)", ???); +// shouldBe("new Object(null)", ???); +shouldBe("(new Object(1)).valueOf()", "1"); +shouldBe("(new Object(true)).valueOf()", "true"); +shouldBe("(new Object('s')).valueOf()", "'s'"); + +shouldBe("String(Object())", "'[object Object]'"); +shouldBe("Object().toString()", "'[object Object]'"); +shouldBe("String(Object().valueOf())", "'[object Object]'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/Prototype-expected.txt b/deps/v8/test/webkit/fast/js/kde/Prototype-expected.txt new file mode 100644 index 0000000000..46ecf5b68d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Prototype-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS s.area() is 9 +PASS b.name is 'a book' +PASS b.author is 'Fred' +PASS delete Boolean.prototype is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/Prototype.js b/deps/v8/test/webkit/fast/js/kde/Prototype.js new file mode 100644 index 0000000000..a2971fde18 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/Prototype.js @@ -0,0 +1,58 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +/////////////////////////////////////////////////////// + +function Square(x) +{ + this.x = x; +} + +new Square(0); // create prototype + +function Square_area() { return this.x * this.x; } +Square.prototype.area = Square_area; +var s = new Square(3); +shouldBe("s.area()", "9"); + +/////////////////////////////////////////////////////// + +function Item(name){ + this.name = name; +} + +function Book(name, author){ + this.base = Item; // set Item constructor as method of Book object + this.base(name); // set the value of name property + this.author = author; +} +Book.prototype = new Item; +var b = new Book("a book", "Fred"); // create object instance +//edebug(e"b.name")); +shouldBe("b.name", "'a book'"); +shouldBe("b.author", "'Fred'"); // outpus "Fred" + +/////////////////////////////////////////////////////// + +shouldBe("delete Boolean.prototype", "false");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/RegExp-expected.txt b/deps/v8/test/webkit/fast/js/kde/RegExp-expected.txt new file mode 100644 index 0000000000..cf39931d53 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/RegExp-expected.txt @@ -0,0 +1,126 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS (new RegExp()).source is '(?:)' +PASS Boolean(new RegExp()) is true +PASS isNaN(Number(new RegExp())) is true +PASS RegExp(/x/).source is 'x' +PASS RegExp('x', 'g').global is true +PASS RegExp('x').source is 'x' +PASS new RegExp('x').source is 'x' +PASS (/a/).global is false +PASS typeof (/a/).global is 'boolean' +PASS rg.global is true +PASS (/a/).ignoreCase is false +PASS ri.ignoreCase is true +PASS (/a/).multiline is false +PASS rm.multiline is true +PASS rg.toString() is '/a/g' +PASS ri.toString() is '/a/i' +PASS rm.toString() is '/a/m' +PASS rg.global is true +PASS ri.ignoreCase is true +PASS rm.multiline is true +PASS Boolean(/a/.test) is true +PASS /(b)c/.exec('abcd').toString() is "bc,b" +PASS /(b)c/.exec('abcd').length is 2 +PASS /(b)c/.exec('abcd').index is 1 +PASS /(b)c/.exec('abcd').input is 'abcd' +PASS rs.source is 'foo' +PASS var r = new RegExp(/x/); r.global=true; r.lastIndex = -1; typeof r.test('a') is 'boolean' +PASS 'abcdefghi'.match(/(abc)def(ghi)/).toString() is 'abcdefghi,abc,ghi' +PASS /(abc)def(ghi)/.exec('abcdefghi').toString() is 'abcdefghi,abc,ghi' +PASS RegExp.$1 is 'abc' +PASS RegExp.$2 is 'ghi' +PASS RegExp.$3 is '' +PASS 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/).toString() is 'abcdefghi,abcdefghi,bcdefgh,cdefg,def,e' +PASS RegExp.$1 is 'abcdefghi' +PASS RegExp.$2 is 'bcdefgh' +PASS RegExp.$3 is 'cdefg' +PASS RegExp.$4 is 'def' +PASS RegExp.$5 is 'e' +PASS RegExp.$6 is '' +PASS '(100px 200px 150px 15px)'.match(/\((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*\)/).toString() is '(100px 200px 150px 15px),100,px,200,px,150,px,15,px' +PASS RegExp.$1 is '100' +PASS RegExp.$3 is '200' +PASS RegExp.$5 is '150' +PASS RegExp.$7 is '15' +PASS ''.match(/((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*)/) is null +PASS RegExp.$1 is '100' +PASS RegExp.$3 is '200' +PASS RegExp.$5 is '150' +PASS RegExp.$7 is '15' +PASS 'faure@kde.org'.match(invalidChars) == null is true +PASS 'faure-kde@kde.org'.match(invalidChars) == null is false +PASS 'test1test2'.replace('test','X') is 'X1test2' +PASS 'test1test2'.replace(/\d/,'X') is 'testXtest2' +PASS '1test2test3'.replace(/\d/,'') is 'test2test3' +PASS 'test1test2'.replace(/test/g,'X') is 'X1X2' +PASS '1test2test3'.replace(/\d/g,'') is 'testtest' +PASS '1test2test3'.replace(/x/g,'') is '1test2test3' +PASS 'test1test2'.replace(/(te)(st)/g,'$2$1') is 'stte1stte2' +PASS 'foo+bar'.replace(/\+/g,'%2B') is 'foo%2Bbar' +PASS caught is true +PASS 'foo'.replace(/z?/g,'x') is 'xfxoxox' +PASS 'test test'.replace(/\s*/g,'') is 'testtest' +PASS 'abc$%@'.replace(/[^0-9a-z]*/gi,'') is 'abc' +PASS 'ab'.replace(/[^\d\.]*/gi,'') is '' +PASS '1ab'.replace(/[^\d\.]*/gi,'') is '1' +PASS '1test2test3blah'.split(/test/).toString() is '1,2,3blah' +PASS reg.exec(str).toString() is '98 ,98 ' +PASS reg.lastIndex is 3 +PASS RegExp.$1 is '98 ' +PASS RegExp.$2 is '' +PASS reg.exec(str).toString() is '76 ,76 ' +PASS reg.lastIndex is 6 +PASS RegExp.$1 is '76 ' +PASS RegExp.$2 is '' +PASS reg.exec(str) is null +PASS reg.lastIndex is 0 +PASS myRe=/d(b+)d/g; myArray = myRe.exec('cdbbdbsbz'); myRe.lastIndex is 5 +PASS reg.ignoreCase == true is true +PASS reg.global === false is true +PASS reg.multiline === false is true +PASS reg.test('UGO') is true +PASS reg.x = 1; reg.x is 1 +PASS var r2 = reg; r2.x = 2; reg.x is 2 +PASS str.match(re).toString() is 'Chapter 3.4.5.1,Chapter 3.4.5.1,.1' +PASS str.match(/d/gi).toString() is 'D,d' +PASS /\u0061/.source is '\\u0061' +PASS 'abc'.match(/\u0062/).toString() is 'b' +PASS Object.prototype.toString.apply(RegExp.prototype) is '[object RegExp]' +PASS typeof RegExp.prototype.toString() is 'string' +PASS new RegExp().toString() is '/(?:)/' +PASS (new RegExp('(?:)')).source is '(?:)' +PASS /(?:)/.toString() is '/(?:)/' +PASS /(?:)/.source is '(?:)' +Done. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/RegExp.js b/deps/v8/test/webkit/fast/js/kde/RegExp.js new file mode 100644 index 0000000000..eea6a8776e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/RegExp.js @@ -0,0 +1,182 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("(new RegExp()).source", "'(?:)'"); +shouldBe("Boolean(new RegExp())", "true"); +shouldBeTrue("isNaN(Number(new RegExp()))"); + +// RegExp constructor called as a function +shouldBe("RegExp(/x/).source", "'x'"); +//shouldBe("RegExp(/x/, 'g').source", "'/x/'"); // can't supply flags when constructing one RegExp from another, says mozilla +shouldBe("RegExp('x', 'g').global", "true"); +shouldBe("RegExp('x').source", "'x'"); + +// RegExp constructor +shouldBe("new RegExp('x').source", "'x'"); + +var ri = /a/i; +var rm = /a/m; +var rg = /a/g; + +shouldBeFalse("(/a/).global"); +shouldBe("typeof (/a/).global", "'boolean'"); +shouldBeTrue("rg.global"); +shouldBeFalse("(/a/).ignoreCase"); +shouldBeTrue("ri.ignoreCase"); +shouldBeFalse("(/a/).multiline"); +shouldBeTrue("rm.multiline"); +shouldBe("rg.toString()", "'/a/g'"); +shouldBe("ri.toString()", "'/a/i'"); +shouldBe("rm.toString()", "'/a/m'"); + +// check properety attributes +rg.global = false; +shouldBeTrue("rg.global"); +ri.ignoreCase = false; +shouldBeTrue("ri.ignoreCase"); +rm.multiline = false; +shouldBeTrue("rm.multiline"); + +shouldBe("Boolean(/a/.test)", "true"); +shouldBe("/(b)c/.exec('abcd').toString()", "\"bc,b\""); +shouldBe("/(b)c/.exec('abcd').length", "2"); +shouldBe("/(b)c/.exec('abcd').index", "1"); +shouldBe("/(b)c/.exec('abcd').input", "'abcd'"); + +var rs = /foo/; +rs.source = "bar"; +shouldBe("rs.source", "'foo'"); + +shouldBe("var r = new RegExp(/x/); r.global=true; r.lastIndex = -1; typeof r.test('a')", "'boolean'"); + +shouldBe("'abcdefghi'.match(/(abc)def(ghi)/).toString()","'abcdefghi,abc,ghi'"); +shouldBe("/(abc)def(ghi)/.exec('abcdefghi').toString()","'abcdefghi,abc,ghi'"); +shouldBe("RegExp.$1","'abc'"); +shouldBe("RegExp.$2","'ghi'"); +shouldBe("RegExp.$3","''"); + +shouldBe("'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/).toString()", "'abcdefghi,abcdefghi,bcdefgh,cdefg,def,e'"); +shouldBe("RegExp.$1","'abcdefghi'"); +shouldBe("RegExp.$2","'bcdefgh'"); +shouldBe("RegExp.$3","'cdefg'"); +shouldBe("RegExp.$4","'def'"); +shouldBe("RegExp.$5","'e'"); +shouldBe("RegExp.$6","''"); + +shouldBe("'(100px 200px 150px 15px)'.match(/\\((\\d+)(px)* (\\d+)(px)* (\\d+)(px)* (\\d+)(px)*\\)/).toString()","'(100px 200px 150px 15px),100,px,200,px,150,px,15,px'"); +shouldBe("RegExp.$1","'100'"); +shouldBe("RegExp.$3","'200'"); +shouldBe("RegExp.$5","'150'"); +shouldBe("RegExp.$7","'15'"); +shouldBe("''.match(/\((\\d+)(px)* (\\d+)(px)* (\\d+)(px)* (\\d+)(px)*\)/)","null"); +// After a failed match, cached results on the RegExp object are unchanged. +shouldBe("RegExp.$1","'100'"); +shouldBe("RegExp.$3","'200'"); +shouldBe("RegExp.$5","'150'"); +shouldBe("RegExp.$7","'15'"); + +var invalidChars = /[^@\.\w]/g; // #47092 +shouldBe("'faure@kde.org'.match(invalidChars) == null", "true"); +shouldBe("'faure-kde@kde.org'.match(invalidChars) == null", "false"); + +shouldBe("'test1test2'.replace('test','X')","'X1test2'"); +shouldBe("'test1test2'.replace(/\\d/,'X')","'testXtest2'"); +shouldBe("'1test2test3'.replace(/\\d/,'')","'test2test3'"); +shouldBe("'test1test2'.replace(/test/g,'X')","'X1X2'"); +shouldBe("'1test2test3'.replace(/\\d/g,'')","'testtest'"); +shouldBe("'1test2test3'.replace(/x/g,'')","'1test2test3'"); +shouldBe("'test1test2'.replace(/(te)(st)/g,'$2$1')","'stte1stte2'"); +shouldBe("'foo+bar'.replace(/\\+/g,'%2B')", "'foo%2Bbar'"); +var caught = false; try { new RegExp("+"); } catch (e) { caught = true; } +shouldBeTrue("caught"); // #40435 +shouldBe("'foo'.replace(/z?/g,'x')", "'xfxoxox'"); +shouldBe("'test test'.replace(/\\s*/g,'')","'testtest'"); // #50985 +shouldBe("'abc$%@'.replace(/[^0-9a-z]*/gi,'')","'abc'"); // #50848 +shouldBe("'ab'.replace(/[^\\d\\.]*/gi,'')","''"); // #75292 +shouldBe("'1ab'.replace(/[^\\d\\.]*/gi,'')","'1'"); // #75292 + +shouldBe("'1test2test3blah'.split(/test/).toString()","'1,2,3blah'"); +var reg = /(\d\d )/g; +var str = new String('98 76 blah'); +shouldBe("reg.exec(str).toString()","'98 ,98 '"); +shouldBe("reg.lastIndex","3"); +shouldBe("RegExp.$1","'98 '"); +shouldBe("RegExp.$2","''"); + +shouldBe("reg.exec(str).toString()","'76 ,76 '"); +shouldBe("reg.lastIndex","6"); +shouldBe("RegExp.$1","'76 '"); +shouldBe("RegExp.$2","''"); + +shouldBe("reg.exec(str)","null"); +shouldBe("reg.lastIndex","0"); + +// http://www.devguru.com/Technologies/ecmascript/quickref/regexp_lastindex.html +// Looks IE-only though +//shouldBe( "var re=/ships*\s/; re.exec('the hardships of traveling'); re.lastIndex", "14" ); +//shouldBe( "var re=/ships*\s/; str='the hardships of traveling'; re.exec(str); re.exec(str); re.lastIndex", "0" ); + +// http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/regexp.html +shouldBe( "myRe=/d(b+)d/g; myArray = myRe.exec('cdbbdbsbz'); myRe.lastIndex", "5" ); + +reg = /^u/i; +shouldBeTrue("reg.ignoreCase == true"); +shouldBeTrue("reg.global === false"); +shouldBeTrue("reg.multiline === false"); +shouldBeTrue("reg.test('UGO')"); + +// regexp are writable ? +shouldBe("reg.x = 1; reg.x", "1"); +// shared data ? +shouldBe("var r2 = reg; r2.x = 2; reg.x", "2"); + +var str = new String("For more information, see Chapter 3.4.5.1"); +re = /(chapter \d+(\.\d)*)/i; +// This returns the array containing Chapter 3.4.5.1,Chapter 3.4.5.1,.1 +// 'Chapter 3.4.5.1' is the first match and the first value remembered from (Chapter \d+(\.\d)*). +// '.1' is the second value remembered from (\.\d) +shouldBe("str.match(re).toString()","'Chapter 3.4.5.1,Chapter 3.4.5.1,.1'"); + +str = "abcDdcba"; +// The returned array contains D, d. +shouldBe("str.match(/d/gi).toString()","'D,d'"); + +// unicode escape sequence +shouldBe("/\\u0061/.source", "'\\\\u0061'"); +shouldBe("'abc'.match(/\\u0062/).toString()", "'b'"); + +shouldBe("Object.prototype.toString.apply(RegExp.prototype)", + Â Â Â Â Â Â Â "'[object RegExp]'"); + +// not sure what this should return. most importantly +// it doesn't throw an exception +shouldBe("typeof RegExp.prototype.toString()", "'string'"); + +// Empty regular expressions have string representation /(?:)/ +shouldBe("new RegExp().toString()", "'/(?:)/'"); +shouldBe("(new RegExp('(?:)')).source", "'(?:)'"); +shouldBe("/(?:)/.toString()", "'/(?:)/'"); +shouldBe("/(?:)/.source", "'(?:)'"); + +debug("Done.");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/arguments-scope-expected.txt b/deps/v8/test/webkit/fast/js/kde/arguments-scope-expected.txt new file mode 100644 index 0000000000..1f5bb58600 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/arguments-scope-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS test0 +PASS test1 +PASS test2 +PASS test3 +PASS test4.(1) +PASS test4.(2) +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/arguments-scope.js b/deps/v8/test/webkit/fast/js/kde/arguments-scope.js new file mode 100644 index 0000000000..cef3698b5e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/arguments-scope.js @@ -0,0 +1,73 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// We can't use normal shouldBe here, since they'd eval in the wrong context... + +function shouldBeOfType(msg, val, type) { + if (typeof(val) != type) + testFailed(msg + ": value has type " + typeof(val) + " , not:" + type); + else + testPassed(msg); +} + +function test0() { + var arguments; + // var execution should not overwrite something that was + // in scope beforehand -- e.g. the arguments thing + shouldBeOfType("test0", arguments, 'object'); + } + +function test1() { + // No need to undef-initialize something in scope already! + shouldBeOfType("test1", arguments, 'object'); + var arguments; +} + +function test2(arguments) { + // Formals OTOH can overwrite the args object + shouldBeOfType("test2", arguments, 'number'); +} + + +function test3() { + // Ditto for functions.. + shouldBeOfType("test3", arguments, 'function'); + function arguments() {} +} + +function test4() { + // Here, the -declaration- part of the var below should have no + // effect.. + shouldBeOfType('test4.(1)', arguments, 'object'); + var arguments = 4; + // .. but the assignment shoud just happen + shouldBeOfType('test4.(2)', arguments, 'number'); +} + + +test0(); +test1(); +test2(42); +test3(); +test4();
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/assignments-expected.txt b/deps/v8/test/webkit/fast/js/kde/assignments-expected.txt new file mode 100644 index 0000000000..c81e053e62 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/assignments-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS var i = 1; i is 1 +PASS j = k = 2 is 2 +PASS var i; i is undefined. +PASS var i = 1; i <<= 2 is 4 +PASS var i = 8; i >>= 1 is 4 +PASS var i = 1; i >>= 2 is 0 +PASS var i = -8; i >>= 24 is -1 +PASS var i = 8; i >>>= 2 is 2 +PASS var i = -8; i >>>= 24 is 255 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/assignments.js b/deps/v8/test/webkit/fast/js/kde/assignments.js new file mode 100644 index 0000000000..2cb49cf933 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/assignments.js @@ -0,0 +1,36 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// simple assignment +shouldBe("var i = 1; i", "1"); +shouldBe("j = k = 2", "2"); +shouldBeUndefined("var i; i"); + +// compound assignments +shouldBe("var i = 1; i <<= 2", "4"); +shouldBe("var i = 8; i >>= 1", "4"); +shouldBe("var i = 1; i >>= 2", "0"); +shouldBe("var i = -8; i >>= 24", "-1"); +shouldBe("var i = 8; i >>>= 2", "2"); +shouldBe("var i = -8; i >>>= 24", "255");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/cast-expected.txt b/deps/v8/test/webkit/fast/js/kde/cast-expected.txt new file mode 100644 index 0000000000..8043fdcbcf --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/cast-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Boolean(1) === true is true +PASS var s = String; s(1) === '1' is true +PASS n = Number; n(true) === 1 is true +PASS String(Array('a', 'b' Â Â Â Â Â Â Â )) is 'a,b' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/cast.js b/deps/v8/test/webkit/fast/js/kde/cast.js new file mode 100644 index 0000000000..c8d3792a63 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/cast.js @@ -0,0 +1,28 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBeTrue("Boolean(1) === true"); +shouldBeTrue("var s = String; s(1) === '1'"); +shouldBeTrue("n = Number; n(true) === 1"); +shouldBe("String(Array('a', 'b' Â Â Â Â Â Â Â ))", "'a,b'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/comment-1-expected.txt b/deps/v8/test/webkit/fast/js/kde/comment-1-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/comment-1-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/comment-1.js b/deps/v8/test/webkit/fast/js/kde/comment-1.js new file mode 100644 index 0000000000..043f052f47 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/comment-1.js @@ -0,0 +1,25 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// comment with linebreak
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/comment-2-expected.txt b/deps/v8/test/webkit/fast/js/kde/comment-2-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/comment-2-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/comment-2.js b/deps/v8/test/webkit/fast/js/kde/comment-2.js new file mode 100644 index 0000000000..043f052f47 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/comment-2.js @@ -0,0 +1,25 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// comment with linebreak
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/completion-expected.txt b/deps/v8/test/webkit/fast/js/kde/completion-expected.txt new file mode 100644 index 0000000000..7ed22bbb88 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/completion-expected.txt @@ -0,0 +1,39 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS foo(), i is 2 +PASS caught is true +PASS val is 11 +PASS val is 12 +PASS val is 13 +PASS val is 14 +PASS val is 15 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/completion.js b/deps/v8/test/webkit/fast/js/kde/completion.js new file mode 100644 index 0000000000..f75c98f401 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/completion.js @@ -0,0 +1,49 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var i = 1; + +function foo() { + i = 2; + return; + i = 3; +} + +shouldBe("foo(), i", "2"); + +var caught = false; +try { eval("return;"); } catch(e) { caught = true; } +shouldBeTrue("caught"); + +// value completions take precedence +var val = eval("11; { }"); +shouldBe("val", "11"); +val = eval("12; ;"); +shouldBe("val", "12"); +val = eval("13; if(false);"); +shouldBe("val", "13"); +val = eval("14; function f() {}"); +shouldBe("val", "14"); +val = eval("15; var v = 0"); +shouldBe("val", "15");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/conditional-expected.txt b/deps/v8/test/webkit/fast/js/kde/conditional-expected.txt new file mode 100644 index 0000000000..29f10f8ec1 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/conditional-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS true ? 1 : 2 is 1 +PASS false ? 1 : 2 is 2 +PASS 'abc' ? 1 : 2 is 1 +PASS null ? 1 : 2 is 2 +PASS undefined ? 1 : 2 is 2 +PASS /*var a=1;if (undefined) a = 2;*/ a is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/conditional.js b/deps/v8/test/webkit/fast/js/kde/conditional.js new file mode 100644 index 0000000000..ee9c0bf867 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/conditional.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("true ? 1 : 2", "1"); +shouldBe("false ? 1 : 2", "2"); +shouldBe("'abc' ? 1 : 2", "1"); +shouldBe("null ? 1 : 2", "2"); +shouldBe("undefined ? 1 : 2", "2"); +var a = 1; +if ( undefined ) + a = 2; +shouldBe("/*var a=1;if (undefined) a = 2;*/ a", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/constructor_length-expected.txt b/deps/v8/test/webkit/fast/js/kde/constructor_length-expected.txt new file mode 100644 index 0000000000..0d93a6a4a3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/constructor_length-expected.txt @@ -0,0 +1,47 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Object.length is 1 +PASS Function.length is 1 +PASS Array.length is 1 +PASS String.length is 1 +PASS Boolean.length is 1 +PASS Number.length is 1 +PASS Date.length is 7 +PASS RegExp.length is 2 +PASS Error.length is 1 +PASS EvalError.length is 1 +PASS RangeError.length is 1 +PASS ReferenceError.length is 1 +PASS SyntaxError.length is 1 +PASS TypeError.length is 1 +PASS URIError.length is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/constructor_length.js b/deps/v8/test/webkit/fast/js/kde/constructor_length.js new file mode 100644 index 0000000000..5ec9dda0ad --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/constructor_length.js @@ -0,0 +1,39 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Object.length","1"); +shouldBe("Function.length","1"); +shouldBe("Array.length","1"); +shouldBe("String.length","1"); +shouldBe("Boolean.length","1"); +shouldBe("Number.length","1"); +shouldBe("Date.length","7"); +shouldBe("RegExp.length","2"); +shouldBe("Error.length","1"); +shouldBe("EvalError.length","1"); +shouldBe("RangeError.length","1"); +shouldBe("ReferenceError.length","1"); +shouldBe("SyntaxError.length","1"); +shouldBe("TypeError.length","1"); +shouldBe("URIError.length","1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/crash-1-expected.txt b/deps/v8/test/webkit/fast/js/kde/crash-1-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/crash-1-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/crash-1.js b/deps/v8/test/webkit/fast/js/kde/crash-1.js new file mode 100644 index 0000000000..316ce51342 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/crash-1.js @@ -0,0 +1,32 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// infinite recursion +try { + var v = []; + v[0] = v; + v.toString(); +} catch (e) { + debug("OK. Caught an exception."); +}
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/crash-2-expected.txt b/deps/v8/test/webkit/fast/js/kde/crash-2-expected.txt new file mode 100644 index 0000000000..3bfd0b3cfb --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/crash-2-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +OK. Caught an exception +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/crash-2.js b/deps/v8/test/webkit/fast/js/kde/crash-2.js new file mode 100644 index 0000000000..84bd67f32b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/crash-2.js @@ -0,0 +1,34 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// infinite recursion 2 +function foo() { + foo(); +} + +try { + foo(); +} catch (e) { + debug("OK. Caught an exception"); +}
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/delete-expected.txt b/deps/v8/test/webkit/fast/js/kde/delete-expected.txt new file mode 100644 index 0000000000..0c87f6ddab --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/delete-expected.txt @@ -0,0 +1,35 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS a = 1; delete a; is true +PASS delete nonexistant; is true +PASS delete NaN is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/delete.js b/deps/v8/test/webkit/fast/js/kde/delete.js new file mode 100644 index 0000000000..0acb308de4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/delete.js @@ -0,0 +1,27 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("a = 1; delete a;", "true"); +shouldBe("delete nonexistant;", "true"); +shouldBe("delete NaN", "false");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/empty-expected.txt b/deps/v8/test/webkit/fast/js/kde/empty-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/empty-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/empty.js b/deps/v8/test/webkit/fast/js/kde/empty.js new file mode 100644 index 0000000000..f09008a591 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/empty.js @@ -0,0 +1,24 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/encode_decode_uri-expected.txt b/deps/v8/test/webkit/fast/js/kde/encode_decode_uri-expected.txt new file mode 100644 index 0000000000..82405fd9a3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/encode_decode_uri-expected.txt @@ -0,0 +1,1128 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS decodeURI(encodeURI(String.fromCharCode(0))) is String.fromCharCode(0) +PASS decodeURI(encodeURI(String.fromCharCode(55295))) is String.fromCharCode(55295) +PASS decodeURI(encodeURI(String.fromCharCode(57344))) is String.fromCharCode(57344) +PASS decodeURI(encodeURI(String.fromCharCode(65533))) is String.fromCharCode(65533) +PASS decodeURI(encodeURI(String.fromCharCode(65534))) is String.fromCharCode(65534) +PASS decodeURI(encodeURI(String.fromCharCode(65535))) is String.fromCharCode(65535) +PASS encodeURI(String.fromCharCode(56320)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(57343)) threw exception URIError: URI malformed. +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(56320))) is String.fromCharCode(55296) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(56319) + String.fromCharCode(56320))) is String.fromCharCode(56319) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(57343))) is String.fromCharCode(55296) + String.fromCharCode(57343) +PASS decodeURI(encodeURI(String.fromCharCode(56319) + String.fromCharCode(57343))) is String.fromCharCode(56319) + String.fromCharCode(57343) +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(0)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55295)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55296)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(56319)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(57344)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(57344)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(65533)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(65534)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(65535)) threw exception URIError: URI malformed. +PASS decodeURI(encodeURI(String.fromCharCode(1))) is String.fromCharCode(1) +PASS decodeURI(encodeURI(String.fromCharCode(252))) is String.fromCharCode(252) +PASS decodeURI(encodeURI(String.fromCharCode(503))) is String.fromCharCode(503) +PASS decodeURI(encodeURI(String.fromCharCode(754))) is String.fromCharCode(754) +PASS decodeURI(encodeURI(String.fromCharCode(1005))) is String.fromCharCode(1005) +PASS decodeURI(encodeURI(String.fromCharCode(1256))) is String.fromCharCode(1256) +PASS decodeURI(encodeURI(String.fromCharCode(1507))) is String.fromCharCode(1507) +PASS decodeURI(encodeURI(String.fromCharCode(1758))) is String.fromCharCode(1758) +PASS decodeURI(encodeURI(String.fromCharCode(2009))) is String.fromCharCode(2009) +PASS decodeURI(encodeURI(String.fromCharCode(2260))) is String.fromCharCode(2260) +PASS decodeURI(encodeURI(String.fromCharCode(2511))) is String.fromCharCode(2511) +PASS decodeURI(encodeURI(String.fromCharCode(2762))) is String.fromCharCode(2762) +PASS decodeURI(encodeURI(String.fromCharCode(3013))) is String.fromCharCode(3013) +PASS decodeURI(encodeURI(String.fromCharCode(3264))) is String.fromCharCode(3264) +PASS decodeURI(encodeURI(String.fromCharCode(3515))) is String.fromCharCode(3515) +PASS decodeURI(encodeURI(String.fromCharCode(3766))) is String.fromCharCode(3766) +PASS decodeURI(encodeURI(String.fromCharCode(4017))) is String.fromCharCode(4017) +PASS decodeURI(encodeURI(String.fromCharCode(4268))) is String.fromCharCode(4268) +PASS decodeURI(encodeURI(String.fromCharCode(4519))) is String.fromCharCode(4519) +PASS decodeURI(encodeURI(String.fromCharCode(4770))) is String.fromCharCode(4770) +PASS decodeURI(encodeURI(String.fromCharCode(5021))) is String.fromCharCode(5021) +PASS decodeURI(encodeURI(String.fromCharCode(5272))) is String.fromCharCode(5272) +PASS decodeURI(encodeURI(String.fromCharCode(5523))) is String.fromCharCode(5523) +PASS decodeURI(encodeURI(String.fromCharCode(5774))) is String.fromCharCode(5774) +PASS decodeURI(encodeURI(String.fromCharCode(6025))) is String.fromCharCode(6025) +PASS decodeURI(encodeURI(String.fromCharCode(6276))) is String.fromCharCode(6276) +PASS decodeURI(encodeURI(String.fromCharCode(6527))) is String.fromCharCode(6527) +PASS decodeURI(encodeURI(String.fromCharCode(6778))) is String.fromCharCode(6778) +PASS decodeURI(encodeURI(String.fromCharCode(7029))) is String.fromCharCode(7029) +PASS decodeURI(encodeURI(String.fromCharCode(7280))) is String.fromCharCode(7280) +PASS decodeURI(encodeURI(String.fromCharCode(7531))) is String.fromCharCode(7531) +PASS decodeURI(encodeURI(String.fromCharCode(7782))) is String.fromCharCode(7782) +PASS decodeURI(encodeURI(String.fromCharCode(8033))) is String.fromCharCode(8033) +PASS decodeURI(encodeURI(String.fromCharCode(8284))) is String.fromCharCode(8284) +PASS decodeURI(encodeURI(String.fromCharCode(8535))) is String.fromCharCode(8535) +PASS decodeURI(encodeURI(String.fromCharCode(8786))) is String.fromCharCode(8786) +PASS decodeURI(encodeURI(String.fromCharCode(9037))) is String.fromCharCode(9037) +PASS decodeURI(encodeURI(String.fromCharCode(9288))) is String.fromCharCode(9288) +PASS decodeURI(encodeURI(String.fromCharCode(9539))) is String.fromCharCode(9539) +PASS decodeURI(encodeURI(String.fromCharCode(9790))) is String.fromCharCode(9790) +PASS decodeURI(encodeURI(String.fromCharCode(10041))) is String.fromCharCode(10041) +PASS decodeURI(encodeURI(String.fromCharCode(10292))) is String.fromCharCode(10292) +PASS decodeURI(encodeURI(String.fromCharCode(10543))) is String.fromCharCode(10543) +PASS decodeURI(encodeURI(String.fromCharCode(10794))) is String.fromCharCode(10794) +PASS decodeURI(encodeURI(String.fromCharCode(11045))) is String.fromCharCode(11045) +PASS decodeURI(encodeURI(String.fromCharCode(11296))) is String.fromCharCode(11296) +PASS decodeURI(encodeURI(String.fromCharCode(11547))) is String.fromCharCode(11547) +PASS decodeURI(encodeURI(String.fromCharCode(11798))) is String.fromCharCode(11798) +PASS decodeURI(encodeURI(String.fromCharCode(12049))) is String.fromCharCode(12049) +PASS decodeURI(encodeURI(String.fromCharCode(12300))) is String.fromCharCode(12300) +PASS decodeURI(encodeURI(String.fromCharCode(12551))) is String.fromCharCode(12551) +PASS decodeURI(encodeURI(String.fromCharCode(12802))) is String.fromCharCode(12802) +PASS decodeURI(encodeURI(String.fromCharCode(13053))) is String.fromCharCode(13053) +PASS decodeURI(encodeURI(String.fromCharCode(13304))) is String.fromCharCode(13304) +PASS decodeURI(encodeURI(String.fromCharCode(13555))) is String.fromCharCode(13555) +PASS decodeURI(encodeURI(String.fromCharCode(13806))) is String.fromCharCode(13806) +PASS decodeURI(encodeURI(String.fromCharCode(14057))) is String.fromCharCode(14057) +PASS decodeURI(encodeURI(String.fromCharCode(14308))) is String.fromCharCode(14308) +PASS decodeURI(encodeURI(String.fromCharCode(14559))) is String.fromCharCode(14559) +PASS decodeURI(encodeURI(String.fromCharCode(14810))) is String.fromCharCode(14810) +PASS decodeURI(encodeURI(String.fromCharCode(15061))) is String.fromCharCode(15061) +PASS decodeURI(encodeURI(String.fromCharCode(15312))) is String.fromCharCode(15312) +PASS decodeURI(encodeURI(String.fromCharCode(15563))) is String.fromCharCode(15563) +PASS decodeURI(encodeURI(String.fromCharCode(15814))) is String.fromCharCode(15814) +PASS decodeURI(encodeURI(String.fromCharCode(16065))) is String.fromCharCode(16065) +PASS decodeURI(encodeURI(String.fromCharCode(16316))) is String.fromCharCode(16316) +PASS decodeURI(encodeURI(String.fromCharCode(16567))) is String.fromCharCode(16567) +PASS decodeURI(encodeURI(String.fromCharCode(16818))) is String.fromCharCode(16818) +PASS decodeURI(encodeURI(String.fromCharCode(17069))) is String.fromCharCode(17069) +PASS decodeURI(encodeURI(String.fromCharCode(17320))) is String.fromCharCode(17320) +PASS decodeURI(encodeURI(String.fromCharCode(17571))) is String.fromCharCode(17571) +PASS decodeURI(encodeURI(String.fromCharCode(17822))) is String.fromCharCode(17822) +PASS decodeURI(encodeURI(String.fromCharCode(18073))) is String.fromCharCode(18073) +PASS decodeURI(encodeURI(String.fromCharCode(18324))) is String.fromCharCode(18324) +PASS decodeURI(encodeURI(String.fromCharCode(18575))) is String.fromCharCode(18575) +PASS decodeURI(encodeURI(String.fromCharCode(18826))) is String.fromCharCode(18826) +PASS decodeURI(encodeURI(String.fromCharCode(19077))) is String.fromCharCode(19077) +PASS decodeURI(encodeURI(String.fromCharCode(19328))) is String.fromCharCode(19328) +PASS decodeURI(encodeURI(String.fromCharCode(19579))) is String.fromCharCode(19579) +PASS decodeURI(encodeURI(String.fromCharCode(19830))) is String.fromCharCode(19830) +PASS decodeURI(encodeURI(String.fromCharCode(20081))) is String.fromCharCode(20081) +PASS decodeURI(encodeURI(String.fromCharCode(20332))) is String.fromCharCode(20332) +PASS decodeURI(encodeURI(String.fromCharCode(20583))) is String.fromCharCode(20583) +PASS decodeURI(encodeURI(String.fromCharCode(20834))) is String.fromCharCode(20834) +PASS decodeURI(encodeURI(String.fromCharCode(21085))) is String.fromCharCode(21085) +PASS decodeURI(encodeURI(String.fromCharCode(21336))) is String.fromCharCode(21336) +PASS decodeURI(encodeURI(String.fromCharCode(21587))) is String.fromCharCode(21587) +PASS decodeURI(encodeURI(String.fromCharCode(21838))) is String.fromCharCode(21838) +PASS decodeURI(encodeURI(String.fromCharCode(22089))) is String.fromCharCode(22089) +PASS decodeURI(encodeURI(String.fromCharCode(22340))) is String.fromCharCode(22340) +PASS decodeURI(encodeURI(String.fromCharCode(22591))) is String.fromCharCode(22591) +PASS decodeURI(encodeURI(String.fromCharCode(22842))) is String.fromCharCode(22842) +PASS decodeURI(encodeURI(String.fromCharCode(23093))) is String.fromCharCode(23093) +PASS decodeURI(encodeURI(String.fromCharCode(23344))) is String.fromCharCode(23344) +PASS decodeURI(encodeURI(String.fromCharCode(23595))) is String.fromCharCode(23595) +PASS decodeURI(encodeURI(String.fromCharCode(23846))) is String.fromCharCode(23846) +PASS decodeURI(encodeURI(String.fromCharCode(24097))) is String.fromCharCode(24097) +PASS decodeURI(encodeURI(String.fromCharCode(24348))) is String.fromCharCode(24348) +PASS decodeURI(encodeURI(String.fromCharCode(24599))) is String.fromCharCode(24599) +PASS decodeURI(encodeURI(String.fromCharCode(24850))) is String.fromCharCode(24850) +PASS decodeURI(encodeURI(String.fromCharCode(25101))) is String.fromCharCode(25101) +PASS decodeURI(encodeURI(String.fromCharCode(25352))) is String.fromCharCode(25352) +PASS decodeURI(encodeURI(String.fromCharCode(25603))) is String.fromCharCode(25603) +PASS decodeURI(encodeURI(String.fromCharCode(25854))) is String.fromCharCode(25854) +PASS decodeURI(encodeURI(String.fromCharCode(26105))) is String.fromCharCode(26105) +PASS decodeURI(encodeURI(String.fromCharCode(26356))) is String.fromCharCode(26356) +PASS decodeURI(encodeURI(String.fromCharCode(26607))) is String.fromCharCode(26607) +PASS decodeURI(encodeURI(String.fromCharCode(26858))) is String.fromCharCode(26858) +PASS decodeURI(encodeURI(String.fromCharCode(27109))) is String.fromCharCode(27109) +PASS decodeURI(encodeURI(String.fromCharCode(27360))) is String.fromCharCode(27360) +PASS decodeURI(encodeURI(String.fromCharCode(27611))) is String.fromCharCode(27611) +PASS decodeURI(encodeURI(String.fromCharCode(27862))) is String.fromCharCode(27862) +PASS decodeURI(encodeURI(String.fromCharCode(28113))) is String.fromCharCode(28113) +PASS decodeURI(encodeURI(String.fromCharCode(28364))) is String.fromCharCode(28364) +PASS decodeURI(encodeURI(String.fromCharCode(28615))) is String.fromCharCode(28615) +PASS decodeURI(encodeURI(String.fromCharCode(28866))) is String.fromCharCode(28866) +PASS decodeURI(encodeURI(String.fromCharCode(29117))) is String.fromCharCode(29117) +PASS decodeURI(encodeURI(String.fromCharCode(29368))) is String.fromCharCode(29368) +PASS decodeURI(encodeURI(String.fromCharCode(29619))) is String.fromCharCode(29619) +PASS decodeURI(encodeURI(String.fromCharCode(29870))) is String.fromCharCode(29870) +PASS decodeURI(encodeURI(String.fromCharCode(30121))) is String.fromCharCode(30121) +PASS decodeURI(encodeURI(String.fromCharCode(30372))) is String.fromCharCode(30372) +PASS decodeURI(encodeURI(String.fromCharCode(30623))) is String.fromCharCode(30623) +PASS decodeURI(encodeURI(String.fromCharCode(30874))) is String.fromCharCode(30874) +PASS decodeURI(encodeURI(String.fromCharCode(31125))) is String.fromCharCode(31125) +PASS decodeURI(encodeURI(String.fromCharCode(31376))) is String.fromCharCode(31376) +PASS decodeURI(encodeURI(String.fromCharCode(31627))) is String.fromCharCode(31627) +PASS decodeURI(encodeURI(String.fromCharCode(31878))) is String.fromCharCode(31878) +PASS decodeURI(encodeURI(String.fromCharCode(32129))) is String.fromCharCode(32129) +PASS decodeURI(encodeURI(String.fromCharCode(32380))) is String.fromCharCode(32380) +PASS decodeURI(encodeURI(String.fromCharCode(32631))) is String.fromCharCode(32631) +PASS decodeURI(encodeURI(String.fromCharCode(32882))) is String.fromCharCode(32882) +PASS decodeURI(encodeURI(String.fromCharCode(33133))) is String.fromCharCode(33133) +PASS decodeURI(encodeURI(String.fromCharCode(33384))) is String.fromCharCode(33384) +PASS decodeURI(encodeURI(String.fromCharCode(33635))) is String.fromCharCode(33635) +PASS decodeURI(encodeURI(String.fromCharCode(33886))) is String.fromCharCode(33886) +PASS decodeURI(encodeURI(String.fromCharCode(34137))) is String.fromCharCode(34137) +PASS decodeURI(encodeURI(String.fromCharCode(34388))) is String.fromCharCode(34388) +PASS decodeURI(encodeURI(String.fromCharCode(34639))) is String.fromCharCode(34639) +PASS decodeURI(encodeURI(String.fromCharCode(34890))) is String.fromCharCode(34890) +PASS decodeURI(encodeURI(String.fromCharCode(35141))) is String.fromCharCode(35141) +PASS decodeURI(encodeURI(String.fromCharCode(35392))) is String.fromCharCode(35392) +PASS decodeURI(encodeURI(String.fromCharCode(35643))) is String.fromCharCode(35643) +PASS decodeURI(encodeURI(String.fromCharCode(35894))) is String.fromCharCode(35894) +PASS decodeURI(encodeURI(String.fromCharCode(36145))) is String.fromCharCode(36145) +PASS decodeURI(encodeURI(String.fromCharCode(36396))) is String.fromCharCode(36396) +PASS decodeURI(encodeURI(String.fromCharCode(36647))) is String.fromCharCode(36647) +PASS decodeURI(encodeURI(String.fromCharCode(36898))) is String.fromCharCode(36898) +PASS decodeURI(encodeURI(String.fromCharCode(37149))) is String.fromCharCode(37149) +PASS decodeURI(encodeURI(String.fromCharCode(37400))) is String.fromCharCode(37400) +PASS decodeURI(encodeURI(String.fromCharCode(37651))) is String.fromCharCode(37651) +PASS decodeURI(encodeURI(String.fromCharCode(37902))) is String.fromCharCode(37902) +PASS decodeURI(encodeURI(String.fromCharCode(38153))) is String.fromCharCode(38153) +PASS decodeURI(encodeURI(String.fromCharCode(38404))) is String.fromCharCode(38404) +PASS decodeURI(encodeURI(String.fromCharCode(38655))) is String.fromCharCode(38655) +PASS decodeURI(encodeURI(String.fromCharCode(38906))) is String.fromCharCode(38906) +PASS decodeURI(encodeURI(String.fromCharCode(39157))) is String.fromCharCode(39157) +PASS decodeURI(encodeURI(String.fromCharCode(39408))) is String.fromCharCode(39408) +PASS decodeURI(encodeURI(String.fromCharCode(39659))) is String.fromCharCode(39659) +PASS decodeURI(encodeURI(String.fromCharCode(39910))) is String.fromCharCode(39910) +PASS decodeURI(encodeURI(String.fromCharCode(40161))) is String.fromCharCode(40161) +PASS decodeURI(encodeURI(String.fromCharCode(40412))) is String.fromCharCode(40412) +PASS decodeURI(encodeURI(String.fromCharCode(40663))) is String.fromCharCode(40663) +PASS decodeURI(encodeURI(String.fromCharCode(40914))) is String.fromCharCode(40914) +PASS decodeURI(encodeURI(String.fromCharCode(41165))) is String.fromCharCode(41165) +PASS decodeURI(encodeURI(String.fromCharCode(41416))) is String.fromCharCode(41416) +PASS decodeURI(encodeURI(String.fromCharCode(41667))) is String.fromCharCode(41667) +PASS decodeURI(encodeURI(String.fromCharCode(41918))) is String.fromCharCode(41918) +PASS decodeURI(encodeURI(String.fromCharCode(42169))) is String.fromCharCode(42169) +PASS decodeURI(encodeURI(String.fromCharCode(42420))) is String.fromCharCode(42420) +PASS decodeURI(encodeURI(String.fromCharCode(42671))) is String.fromCharCode(42671) +PASS decodeURI(encodeURI(String.fromCharCode(42922))) is String.fromCharCode(42922) +PASS decodeURI(encodeURI(String.fromCharCode(43173))) is String.fromCharCode(43173) +PASS decodeURI(encodeURI(String.fromCharCode(43424))) is String.fromCharCode(43424) +PASS decodeURI(encodeURI(String.fromCharCode(43675))) is String.fromCharCode(43675) +PASS decodeURI(encodeURI(String.fromCharCode(43926))) is String.fromCharCode(43926) +PASS decodeURI(encodeURI(String.fromCharCode(44177))) is String.fromCharCode(44177) +PASS decodeURI(encodeURI(String.fromCharCode(44428))) is String.fromCharCode(44428) +PASS decodeURI(encodeURI(String.fromCharCode(44679))) is String.fromCharCode(44679) +PASS decodeURI(encodeURI(String.fromCharCode(44930))) is String.fromCharCode(44930) +PASS decodeURI(encodeURI(String.fromCharCode(45181))) is String.fromCharCode(45181) +PASS decodeURI(encodeURI(String.fromCharCode(45432))) is String.fromCharCode(45432) +PASS decodeURI(encodeURI(String.fromCharCode(45683))) is String.fromCharCode(45683) +PASS decodeURI(encodeURI(String.fromCharCode(45934))) is String.fromCharCode(45934) +PASS decodeURI(encodeURI(String.fromCharCode(46185))) is String.fromCharCode(46185) +PASS decodeURI(encodeURI(String.fromCharCode(46436))) is String.fromCharCode(46436) +PASS decodeURI(encodeURI(String.fromCharCode(46687))) is String.fromCharCode(46687) +PASS decodeURI(encodeURI(String.fromCharCode(46938))) is String.fromCharCode(46938) +PASS decodeURI(encodeURI(String.fromCharCode(47189))) is String.fromCharCode(47189) +PASS decodeURI(encodeURI(String.fromCharCode(47440))) is String.fromCharCode(47440) +PASS decodeURI(encodeURI(String.fromCharCode(47691))) is String.fromCharCode(47691) +PASS decodeURI(encodeURI(String.fromCharCode(47942))) is String.fromCharCode(47942) +PASS decodeURI(encodeURI(String.fromCharCode(48193))) is String.fromCharCode(48193) +PASS decodeURI(encodeURI(String.fromCharCode(48444))) is String.fromCharCode(48444) +PASS decodeURI(encodeURI(String.fromCharCode(48695))) is String.fromCharCode(48695) +PASS decodeURI(encodeURI(String.fromCharCode(48946))) is String.fromCharCode(48946) +PASS decodeURI(encodeURI(String.fromCharCode(49197))) is String.fromCharCode(49197) +PASS decodeURI(encodeURI(String.fromCharCode(49448))) is String.fromCharCode(49448) +PASS decodeURI(encodeURI(String.fromCharCode(49699))) is String.fromCharCode(49699) +PASS decodeURI(encodeURI(String.fromCharCode(49950))) is String.fromCharCode(49950) +PASS decodeURI(encodeURI(String.fromCharCode(50201))) is String.fromCharCode(50201) +PASS decodeURI(encodeURI(String.fromCharCode(50452))) is String.fromCharCode(50452) +PASS decodeURI(encodeURI(String.fromCharCode(50703))) is String.fromCharCode(50703) +PASS decodeURI(encodeURI(String.fromCharCode(50954))) is String.fromCharCode(50954) +PASS decodeURI(encodeURI(String.fromCharCode(51205))) is String.fromCharCode(51205) +PASS decodeURI(encodeURI(String.fromCharCode(51456))) is String.fromCharCode(51456) +PASS decodeURI(encodeURI(String.fromCharCode(51707))) is String.fromCharCode(51707) +PASS decodeURI(encodeURI(String.fromCharCode(51958))) is String.fromCharCode(51958) +PASS decodeURI(encodeURI(String.fromCharCode(52209))) is String.fromCharCode(52209) +PASS decodeURI(encodeURI(String.fromCharCode(52460))) is String.fromCharCode(52460) +PASS decodeURI(encodeURI(String.fromCharCode(52711))) is String.fromCharCode(52711) +PASS decodeURI(encodeURI(String.fromCharCode(52962))) is String.fromCharCode(52962) +PASS decodeURI(encodeURI(String.fromCharCode(53213))) is String.fromCharCode(53213) +PASS decodeURI(encodeURI(String.fromCharCode(53464))) is String.fromCharCode(53464) +PASS decodeURI(encodeURI(String.fromCharCode(53715))) is String.fromCharCode(53715) +PASS decodeURI(encodeURI(String.fromCharCode(53966))) is String.fromCharCode(53966) +PASS decodeURI(encodeURI(String.fromCharCode(54217))) is String.fromCharCode(54217) +PASS decodeURI(encodeURI(String.fromCharCode(54468))) is String.fromCharCode(54468) +PASS decodeURI(encodeURI(String.fromCharCode(54719))) is String.fromCharCode(54719) +PASS decodeURI(encodeURI(String.fromCharCode(54970))) is String.fromCharCode(54970) +PASS decodeURI(encodeURI(String.fromCharCode(55221))) is String.fromCharCode(55221) +PASS decodeURI(encodeURI(String.fromCharCode(57345))) is String.fromCharCode(57345) +PASS decodeURI(encodeURI(String.fromCharCode(57596))) is String.fromCharCode(57596) +PASS decodeURI(encodeURI(String.fromCharCode(57847))) is String.fromCharCode(57847) +PASS decodeURI(encodeURI(String.fromCharCode(58098))) is String.fromCharCode(58098) +PASS decodeURI(encodeURI(String.fromCharCode(58349))) is String.fromCharCode(58349) +PASS decodeURI(encodeURI(String.fromCharCode(58600))) is String.fromCharCode(58600) +PASS decodeURI(encodeURI(String.fromCharCode(58851))) is String.fromCharCode(58851) +PASS decodeURI(encodeURI(String.fromCharCode(59102))) is String.fromCharCode(59102) +PASS decodeURI(encodeURI(String.fromCharCode(59353))) is String.fromCharCode(59353) +PASS decodeURI(encodeURI(String.fromCharCode(59604))) is String.fromCharCode(59604) +PASS decodeURI(encodeURI(String.fromCharCode(59855))) is String.fromCharCode(59855) +PASS decodeURI(encodeURI(String.fromCharCode(60106))) is String.fromCharCode(60106) +PASS decodeURI(encodeURI(String.fromCharCode(60357))) is String.fromCharCode(60357) +PASS decodeURI(encodeURI(String.fromCharCode(60608))) is String.fromCharCode(60608) +PASS decodeURI(encodeURI(String.fromCharCode(60859))) is String.fromCharCode(60859) +PASS decodeURI(encodeURI(String.fromCharCode(61110))) is String.fromCharCode(61110) +PASS decodeURI(encodeURI(String.fromCharCode(61361))) is String.fromCharCode(61361) +PASS decodeURI(encodeURI(String.fromCharCode(61612))) is String.fromCharCode(61612) +PASS decodeURI(encodeURI(String.fromCharCode(61863))) is String.fromCharCode(61863) +PASS decodeURI(encodeURI(String.fromCharCode(62114))) is String.fromCharCode(62114) +PASS decodeURI(encodeURI(String.fromCharCode(62365))) is String.fromCharCode(62365) +PASS decodeURI(encodeURI(String.fromCharCode(62616))) is String.fromCharCode(62616) +PASS decodeURI(encodeURI(String.fromCharCode(62867))) is String.fromCharCode(62867) +PASS decodeURI(encodeURI(String.fromCharCode(63118))) is String.fromCharCode(63118) +PASS decodeURI(encodeURI(String.fromCharCode(63369))) is String.fromCharCode(63369) +PASS decodeURI(encodeURI(String.fromCharCode(63620))) is String.fromCharCode(63620) +PASS decodeURI(encodeURI(String.fromCharCode(63871))) is String.fromCharCode(63871) +PASS decodeURI(encodeURI(String.fromCharCode(64122))) is String.fromCharCode(64122) +PASS decodeURI(encodeURI(String.fromCharCode(64373))) is String.fromCharCode(64373) +PASS decodeURI(encodeURI(String.fromCharCode(64624))) is String.fromCharCode(64624) +PASS decodeURI(encodeURI(String.fromCharCode(64875))) is String.fromCharCode(64875) +PASS decodeURI(encodeURI(String.fromCharCode(65126))) is String.fromCharCode(65126) +PASS decodeURI(encodeURI(String.fromCharCode(65377))) is String.fromCharCode(65377) +PASS encodeURI(String.fromCharCode(56321)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(56572)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(56823)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(57074)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(57325)) threw exception URIError: URI malformed. +PASS decodeURI(encodeURI(String.fromCharCode(55297) + String.fromCharCode(56320))) is String.fromCharCode(55297) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(55548) + String.fromCharCode(56320))) is String.fromCharCode(55548) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(55799) + String.fromCharCode(56320))) is String.fromCharCode(55799) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(56050) + String.fromCharCode(56320))) is String.fromCharCode(56050) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(56301) + String.fromCharCode(56320))) is String.fromCharCode(56301) + String.fromCharCode(56320) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(56321))) is String.fromCharCode(55296) + String.fromCharCode(56321) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(56572))) is String.fromCharCode(55296) + String.fromCharCode(56572) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(56823))) is String.fromCharCode(55296) + String.fromCharCode(56823) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(57074))) is String.fromCharCode(55296) + String.fromCharCode(57074) +PASS decodeURI(encodeURI(String.fromCharCode(55296) + String.fromCharCode(57325))) is String.fromCharCode(55296) + String.fromCharCode(57325) +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(1)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(252)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(503)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(754)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(1005)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(1256)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(1507)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(1758)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(2009)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(2260)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(2511)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(2762)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(3013)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(3264)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(3515)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(3766)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(4017)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(4268)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(4519)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(4770)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(5021)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(5272)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(5523)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(5774)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(6025)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(6276)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(6527)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(6778)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(7029)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(7280)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(7531)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(7782)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(8033)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(8284)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(8535)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(8786)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(9037)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(9288)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(9539)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(9790)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(10041)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(10292)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(10543)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(10794)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(11045)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(11296)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(11547)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(11798)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(12049)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(12300)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(12551)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(12802)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(13053)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(13304)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(13555)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(13806)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(14057)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(14308)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(14559)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(14810)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(15061)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(15312)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(15563)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(15814)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(16065)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(16316)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(16567)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(16818)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(17069)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(17320)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(17571)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(17822)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(18073)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(18324)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(18575)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(18826)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(19077)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(19328)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(19579)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(19830)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(20081)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(20332)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(20583)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(20834)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(21085)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(21336)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(21587)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(21838)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(22089)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(22340)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(22591)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(22842)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(23093)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(23344)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(23595)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(23846)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(24097)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(24348)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(24599)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(24850)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(25101)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(25352)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(25603)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(25854)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(26105)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(26356)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(26607)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(26858)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(27109)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(27360)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(27611)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(27862)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(28113)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(28364)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(28615)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(28866)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(29117)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(29368)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(29619)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(29870)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(30121)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(30372)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(30623)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(30874)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(31125)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(31376)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(31627)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(31878)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(32129)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(32380)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(32631)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(32882)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(33133)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(33384)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(33635)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(33886)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(34137)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(34388)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(34639)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(34890)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(35141)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(35392)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(35643)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(35894)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(36145)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(36396)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(36647)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(36898)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(37149)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(37400)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(37651)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(37902)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(38153)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(38404)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(38655)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(38906)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(39157)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(39408)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(39659)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(39910)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(40161)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(40412)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(40663)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(40914)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(41165)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(41416)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(41667)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(41918)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(42169)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(42420)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(42671)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(42922)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(43173)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(43424)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(43675)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(43926)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(44177)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(44428)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(44679)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(44930)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(45181)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(45432)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(45683)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(45934)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(46185)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(46436)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(46687)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(46938)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(47189)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(47440)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(47691)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(47942)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(48193)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(48444)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(48695)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(48946)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(49197)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(49448)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(49699)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(49950)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(50201)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(50452)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(50703)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(50954)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(51205)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(51456)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(51707)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(51958)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(52209)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(52460)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(52711)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(52962)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(53213)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(53464)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(53715)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(53966)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(54217)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(54468)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(54719)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(54970)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55221)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55472)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55723)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(55974)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(56225)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(57345)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(57596)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(57847)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(58098)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(58349)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(58600)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(58851)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(59102)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(59353)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(59604)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(59855)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(60106)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(60357)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(60608)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(60859)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(61110)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(61361)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(61612)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(61863)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(62114)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(62365)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(62616)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(62867)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(63118)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(63369)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(63620)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(63871)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(64122)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(64373)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(64624)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(64875)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(65126)) threw exception URIError: URI malformed. +PASS encodeURI(String.fromCharCode(55296) + String.fromCharCode(65377)) threw exception URIError: URI malformed. +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(0))) is String.fromCharCode(0) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55295))) is String.fromCharCode(55295) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(57344))) is String.fromCharCode(57344) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(65533))) is String.fromCharCode(65533) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(65534))) is String.fromCharCode(65534) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(65535))) is String.fromCharCode(65535) +PASS encodeURIComponent(String.fromCharCode(56320)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(57343)) threw exception URIError: URI malformed. +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56320))) is String.fromCharCode(55296) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(56319) + String.fromCharCode(56320))) is String.fromCharCode(56319) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57343))) is String.fromCharCode(55296) + String.fromCharCode(57343) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(56319) + String.fromCharCode(57343))) is String.fromCharCode(56319) + String.fromCharCode(57343) +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(0)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55295)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55296)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56319)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57344)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57344)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(65533)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(65534)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(65535)) threw exception URIError: URI malformed. +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(1))) is String.fromCharCode(1) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(252))) is String.fromCharCode(252) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(503))) is String.fromCharCode(503) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(754))) is String.fromCharCode(754) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(1005))) is String.fromCharCode(1005) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(1256))) is String.fromCharCode(1256) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(1507))) is String.fromCharCode(1507) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(1758))) is String.fromCharCode(1758) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(2009))) is String.fromCharCode(2009) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(2260))) is String.fromCharCode(2260) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(2511))) is String.fromCharCode(2511) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(2762))) is String.fromCharCode(2762) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(3013))) is String.fromCharCode(3013) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(3264))) is String.fromCharCode(3264) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(3515))) is String.fromCharCode(3515) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(3766))) is String.fromCharCode(3766) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(4017))) is String.fromCharCode(4017) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(4268))) is String.fromCharCode(4268) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(4519))) is String.fromCharCode(4519) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(4770))) is String.fromCharCode(4770) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(5021))) is String.fromCharCode(5021) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(5272))) is String.fromCharCode(5272) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(5523))) is String.fromCharCode(5523) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(5774))) is String.fromCharCode(5774) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(6025))) is String.fromCharCode(6025) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(6276))) is String.fromCharCode(6276) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(6527))) is String.fromCharCode(6527) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(6778))) is String.fromCharCode(6778) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(7029))) is String.fromCharCode(7029) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(7280))) is String.fromCharCode(7280) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(7531))) is String.fromCharCode(7531) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(7782))) is String.fromCharCode(7782) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(8033))) is String.fromCharCode(8033) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(8284))) is String.fromCharCode(8284) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(8535))) is String.fromCharCode(8535) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(8786))) is String.fromCharCode(8786) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(9037))) is String.fromCharCode(9037) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(9288))) is String.fromCharCode(9288) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(9539))) is String.fromCharCode(9539) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(9790))) is String.fromCharCode(9790) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(10041))) is String.fromCharCode(10041) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(10292))) is String.fromCharCode(10292) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(10543))) is String.fromCharCode(10543) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(10794))) is String.fromCharCode(10794) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(11045))) is String.fromCharCode(11045) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(11296))) is String.fromCharCode(11296) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(11547))) is String.fromCharCode(11547) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(11798))) is String.fromCharCode(11798) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(12049))) is String.fromCharCode(12049) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(12300))) is String.fromCharCode(12300) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(12551))) is String.fromCharCode(12551) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(12802))) is String.fromCharCode(12802) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(13053))) is String.fromCharCode(13053) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(13304))) is String.fromCharCode(13304) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(13555))) is String.fromCharCode(13555) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(13806))) is String.fromCharCode(13806) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(14057))) is String.fromCharCode(14057) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(14308))) is String.fromCharCode(14308) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(14559))) is String.fromCharCode(14559) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(14810))) is String.fromCharCode(14810) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(15061))) is String.fromCharCode(15061) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(15312))) is String.fromCharCode(15312) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(15563))) is String.fromCharCode(15563) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(15814))) is String.fromCharCode(15814) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(16065))) is String.fromCharCode(16065) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(16316))) is String.fromCharCode(16316) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(16567))) is String.fromCharCode(16567) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(16818))) is String.fromCharCode(16818) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(17069))) is String.fromCharCode(17069) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(17320))) is String.fromCharCode(17320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(17571))) is String.fromCharCode(17571) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(17822))) is String.fromCharCode(17822) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(18073))) is String.fromCharCode(18073) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(18324))) is String.fromCharCode(18324) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(18575))) is String.fromCharCode(18575) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(18826))) is String.fromCharCode(18826) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(19077))) is String.fromCharCode(19077) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(19328))) is String.fromCharCode(19328) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(19579))) is String.fromCharCode(19579) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(19830))) is String.fromCharCode(19830) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(20081))) is String.fromCharCode(20081) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(20332))) is String.fromCharCode(20332) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(20583))) is String.fromCharCode(20583) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(20834))) is String.fromCharCode(20834) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(21085))) is String.fromCharCode(21085) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(21336))) is String.fromCharCode(21336) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(21587))) is String.fromCharCode(21587) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(21838))) is String.fromCharCode(21838) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(22089))) is String.fromCharCode(22089) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(22340))) is String.fromCharCode(22340) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(22591))) is String.fromCharCode(22591) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(22842))) is String.fromCharCode(22842) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(23093))) is String.fromCharCode(23093) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(23344))) is String.fromCharCode(23344) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(23595))) is String.fromCharCode(23595) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(23846))) is String.fromCharCode(23846) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(24097))) is String.fromCharCode(24097) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(24348))) is String.fromCharCode(24348) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(24599))) is String.fromCharCode(24599) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(24850))) is String.fromCharCode(24850) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(25101))) is String.fromCharCode(25101) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(25352))) is String.fromCharCode(25352) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(25603))) is String.fromCharCode(25603) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(25854))) is String.fromCharCode(25854) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(26105))) is String.fromCharCode(26105) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(26356))) is String.fromCharCode(26356) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(26607))) is String.fromCharCode(26607) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(26858))) is String.fromCharCode(26858) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(27109))) is String.fromCharCode(27109) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(27360))) is String.fromCharCode(27360) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(27611))) is String.fromCharCode(27611) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(27862))) is String.fromCharCode(27862) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(28113))) is String.fromCharCode(28113) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(28364))) is String.fromCharCode(28364) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(28615))) is String.fromCharCode(28615) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(28866))) is String.fromCharCode(28866) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(29117))) is String.fromCharCode(29117) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(29368))) is String.fromCharCode(29368) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(29619))) is String.fromCharCode(29619) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(29870))) is String.fromCharCode(29870) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(30121))) is String.fromCharCode(30121) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(30372))) is String.fromCharCode(30372) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(30623))) is String.fromCharCode(30623) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(30874))) is String.fromCharCode(30874) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(31125))) is String.fromCharCode(31125) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(31376))) is String.fromCharCode(31376) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(31627))) is String.fromCharCode(31627) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(31878))) is String.fromCharCode(31878) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(32129))) is String.fromCharCode(32129) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(32380))) is String.fromCharCode(32380) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(32631))) is String.fromCharCode(32631) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(32882))) is String.fromCharCode(32882) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(33133))) is String.fromCharCode(33133) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(33384))) is String.fromCharCode(33384) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(33635))) is String.fromCharCode(33635) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(33886))) is String.fromCharCode(33886) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(34137))) is String.fromCharCode(34137) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(34388))) is String.fromCharCode(34388) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(34639))) is String.fromCharCode(34639) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(34890))) is String.fromCharCode(34890) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(35141))) is String.fromCharCode(35141) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(35392))) is String.fromCharCode(35392) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(35643))) is String.fromCharCode(35643) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(35894))) is String.fromCharCode(35894) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(36145))) is String.fromCharCode(36145) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(36396))) is String.fromCharCode(36396) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(36647))) is String.fromCharCode(36647) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(36898))) is String.fromCharCode(36898) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(37149))) is String.fromCharCode(37149) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(37400))) is String.fromCharCode(37400) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(37651))) is String.fromCharCode(37651) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(37902))) is String.fromCharCode(37902) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(38153))) is String.fromCharCode(38153) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(38404))) is String.fromCharCode(38404) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(38655))) is String.fromCharCode(38655) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(38906))) is String.fromCharCode(38906) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(39157))) is String.fromCharCode(39157) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(39408))) is String.fromCharCode(39408) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(39659))) is String.fromCharCode(39659) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(39910))) is String.fromCharCode(39910) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(40161))) is String.fromCharCode(40161) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(40412))) is String.fromCharCode(40412) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(40663))) is String.fromCharCode(40663) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(40914))) is String.fromCharCode(40914) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(41165))) is String.fromCharCode(41165) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(41416))) is String.fromCharCode(41416) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(41667))) is String.fromCharCode(41667) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(41918))) is String.fromCharCode(41918) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(42169))) is String.fromCharCode(42169) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(42420))) is String.fromCharCode(42420) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(42671))) is String.fromCharCode(42671) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(42922))) is String.fromCharCode(42922) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(43173))) is String.fromCharCode(43173) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(43424))) is String.fromCharCode(43424) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(43675))) is String.fromCharCode(43675) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(43926))) is String.fromCharCode(43926) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(44177))) is String.fromCharCode(44177) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(44428))) is String.fromCharCode(44428) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(44679))) is String.fromCharCode(44679) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(44930))) is String.fromCharCode(44930) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(45181))) is String.fromCharCode(45181) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(45432))) is String.fromCharCode(45432) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(45683))) is String.fromCharCode(45683) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(45934))) is String.fromCharCode(45934) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(46185))) is String.fromCharCode(46185) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(46436))) is String.fromCharCode(46436) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(46687))) is String.fromCharCode(46687) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(46938))) is String.fromCharCode(46938) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(47189))) is String.fromCharCode(47189) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(47440))) is String.fromCharCode(47440) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(47691))) is String.fromCharCode(47691) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(47942))) is String.fromCharCode(47942) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(48193))) is String.fromCharCode(48193) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(48444))) is String.fromCharCode(48444) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(48695))) is String.fromCharCode(48695) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(48946))) is String.fromCharCode(48946) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(49197))) is String.fromCharCode(49197) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(49448))) is String.fromCharCode(49448) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(49699))) is String.fromCharCode(49699) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(49950))) is String.fromCharCode(49950) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(50201))) is String.fromCharCode(50201) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(50452))) is String.fromCharCode(50452) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(50703))) is String.fromCharCode(50703) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(50954))) is String.fromCharCode(50954) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(51205))) is String.fromCharCode(51205) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(51456))) is String.fromCharCode(51456) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(51707))) is String.fromCharCode(51707) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(51958))) is String.fromCharCode(51958) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(52209))) is String.fromCharCode(52209) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(52460))) is String.fromCharCode(52460) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(52711))) is String.fromCharCode(52711) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(52962))) is String.fromCharCode(52962) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(53213))) is String.fromCharCode(53213) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(53464))) is String.fromCharCode(53464) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(53715))) is String.fromCharCode(53715) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(53966))) is String.fromCharCode(53966) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(54217))) is String.fromCharCode(54217) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(54468))) is String.fromCharCode(54468) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(54719))) is String.fromCharCode(54719) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(54970))) is String.fromCharCode(54970) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55221))) is String.fromCharCode(55221) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(57345))) is String.fromCharCode(57345) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(57596))) is String.fromCharCode(57596) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(57847))) is String.fromCharCode(57847) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(58098))) is String.fromCharCode(58098) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(58349))) is String.fromCharCode(58349) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(58600))) is String.fromCharCode(58600) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(58851))) is String.fromCharCode(58851) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(59102))) is String.fromCharCode(59102) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(59353))) is String.fromCharCode(59353) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(59604))) is String.fromCharCode(59604) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(59855))) is String.fromCharCode(59855) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(60106))) is String.fromCharCode(60106) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(60357))) is String.fromCharCode(60357) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(60608))) is String.fromCharCode(60608) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(60859))) is String.fromCharCode(60859) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(61110))) is String.fromCharCode(61110) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(61361))) is String.fromCharCode(61361) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(61612))) is String.fromCharCode(61612) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(61863))) is String.fromCharCode(61863) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(62114))) is String.fromCharCode(62114) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(62365))) is String.fromCharCode(62365) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(62616))) is String.fromCharCode(62616) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(62867))) is String.fromCharCode(62867) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(63118))) is String.fromCharCode(63118) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(63369))) is String.fromCharCode(63369) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(63620))) is String.fromCharCode(63620) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(63871))) is String.fromCharCode(63871) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(64122))) is String.fromCharCode(64122) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(64373))) is String.fromCharCode(64373) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(64624))) is String.fromCharCode(64624) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(64875))) is String.fromCharCode(64875) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(65126))) is String.fromCharCode(65126) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(65377))) is String.fromCharCode(65377) +PASS encodeURIComponent(String.fromCharCode(56321)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(56572)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(56823)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(57074)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(57325)) threw exception URIError: URI malformed. +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55297) + String.fromCharCode(56320))) is String.fromCharCode(55297) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55548) + String.fromCharCode(56320))) is String.fromCharCode(55548) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55799) + String.fromCharCode(56320))) is String.fromCharCode(55799) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(56050) + String.fromCharCode(56320))) is String.fromCharCode(56050) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(56301) + String.fromCharCode(56320))) is String.fromCharCode(56301) + String.fromCharCode(56320) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56321))) is String.fromCharCode(55296) + String.fromCharCode(56321) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56572))) is String.fromCharCode(55296) + String.fromCharCode(56572) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56823))) is String.fromCharCode(55296) + String.fromCharCode(56823) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57074))) is String.fromCharCode(55296) + String.fromCharCode(57074) +PASS decodeURIComponent(encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57325))) is String.fromCharCode(55296) + String.fromCharCode(57325) +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(1)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(252)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(503)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(754)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(1005)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(1256)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(1507)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(1758)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(2009)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(2260)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(2511)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(2762)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(3013)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(3264)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(3515)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(3766)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(4017)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(4268)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(4519)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(4770)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(5021)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(5272)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(5523)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(5774)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(6025)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(6276)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(6527)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(6778)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(7029)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(7280)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(7531)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(7782)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(8033)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(8284)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(8535)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(8786)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(9037)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(9288)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(9539)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(9790)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(10041)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(10292)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(10543)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(10794)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(11045)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(11296)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(11547)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(11798)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(12049)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(12300)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(12551)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(12802)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(13053)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(13304)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(13555)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(13806)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(14057)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(14308)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(14559)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(14810)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(15061)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(15312)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(15563)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(15814)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(16065)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(16316)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(16567)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(16818)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(17069)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(17320)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(17571)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(17822)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(18073)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(18324)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(18575)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(18826)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(19077)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(19328)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(19579)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(19830)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(20081)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(20332)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(20583)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(20834)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(21085)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(21336)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(21587)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(21838)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(22089)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(22340)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(22591)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(22842)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(23093)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(23344)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(23595)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(23846)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(24097)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(24348)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(24599)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(24850)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(25101)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(25352)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(25603)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(25854)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(26105)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(26356)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(26607)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(26858)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(27109)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(27360)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(27611)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(27862)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(28113)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(28364)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(28615)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(28866)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(29117)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(29368)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(29619)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(29870)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(30121)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(30372)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(30623)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(30874)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(31125)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(31376)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(31627)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(31878)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(32129)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(32380)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(32631)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(32882)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(33133)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(33384)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(33635)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(33886)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(34137)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(34388)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(34639)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(34890)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(35141)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(35392)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(35643)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(35894)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(36145)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(36396)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(36647)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(36898)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(37149)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(37400)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(37651)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(37902)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(38153)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(38404)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(38655)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(38906)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(39157)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(39408)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(39659)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(39910)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(40161)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(40412)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(40663)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(40914)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(41165)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(41416)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(41667)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(41918)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(42169)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(42420)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(42671)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(42922)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(43173)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(43424)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(43675)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(43926)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(44177)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(44428)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(44679)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(44930)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(45181)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(45432)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(45683)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(45934)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(46185)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(46436)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(46687)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(46938)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(47189)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(47440)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(47691)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(47942)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(48193)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(48444)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(48695)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(48946)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(49197)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(49448)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(49699)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(49950)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(50201)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(50452)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(50703)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(50954)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(51205)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(51456)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(51707)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(51958)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(52209)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(52460)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(52711)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(52962)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(53213)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(53464)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(53715)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(53966)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(54217)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(54468)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(54719)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(54970)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55221)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55472)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55723)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(55974)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(56225)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57345)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57596)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(57847)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(58098)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(58349)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(58600)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(58851)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(59102)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(59353)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(59604)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(59855)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(60106)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(60357)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(60608)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(60859)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(61110)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(61361)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(61612)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(61863)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(62114)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(62365)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(62616)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(62867)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(63118)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(63369)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(63620)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(63871)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(64122)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(64373)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(64624)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(64875)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(65126)) threw exception URIError: URI malformed. +PASS encodeURIComponent(String.fromCharCode(55296) + String.fromCharCode(65377)) threw exception URIError: URI malformed. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/encode_decode_uri.js b/deps/v8/test/webkit/fast/js/kde/encode_decode_uri.js new file mode 100644 index 0000000000..c58cc12bab --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/encode_decode_uri.js @@ -0,0 +1,102 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// -------------------------------------------------------------------------------- + +var resolution = 251; // set to 1 for 100% coverage + +function checkEncodeException(encodeFunctionName,c1,c2) +{ + if (c2 == undefined) + shouldThrow(encodeFunctionName + + "(String.fromCharCode(" + c1 + "))"); + else + shouldThrow(encodeFunctionName + + "(String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + "))"); +} + +function checkEncodeDecode(encodeFunctionName, decodeFunctionName, c1, c2) +{ + if (c2 == undefined) + shouldBe(decodeFunctionName + "(" + encodeFunctionName + + "(String.fromCharCode(" + c1 + ")))", + "String.fromCharCode(" + c1 + ")"); + else + shouldBe(decodeFunctionName + "(" + encodeFunctionName + + "(String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + ")))", + "String.fromCharCode(" + c1 + ") + String.fromCharCode(" + c2 + ")"); +} + +function checkWithFunctions(encodeFunction, decodeFunction) +{ + checkEncodeDecode(encodeFunction, decodeFunction, 0); + checkEncodeDecode(encodeFunction, decodeFunction, 0xD7FF); + + checkEncodeDecode(encodeFunction, decodeFunction, 0xE000); + checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFD); + checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFE); + checkEncodeDecode(encodeFunction, decodeFunction, 0xFFFF); + + checkEncodeException(encodeFunction, 0xDC00); + checkEncodeException(encodeFunction, 0xDFFF); + + checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, 0xDC00); + checkEncodeDecode(encodeFunction, decodeFunction, 0xDBFF, 0xDC00); + checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, 0xDFFF); + checkEncodeDecode(encodeFunction, decodeFunction, 0xDBFF, 0xDFFF); + + checkEncodeException(encodeFunction, 0xD800, 0); + checkEncodeException(encodeFunction, 0xD800, 0xD7FF); + checkEncodeException(encodeFunction, 0xD800, 0xD800); + checkEncodeException(encodeFunction, 0xD800, 0xDBFF); + checkEncodeException(encodeFunction, 0xD800, 0xE000); + checkEncodeException(encodeFunction, 0xD800, 0xE000); + checkEncodeException(encodeFunction, 0xD800, 0xFFFD); + checkEncodeException(encodeFunction, 0xD800, 0xFFFE); + checkEncodeException(encodeFunction, 0xD800, 0xFFFF); + + for (var charcode = 1; charcode < 0xD7FF; charcode += resolution) + checkEncodeDecode(encodeFunction, decodeFunction, charcode); + + for (var charcode = 0xE001; charcode < 0xFFFD; charcode += resolution) + checkEncodeDecode(encodeFunction, decodeFunction, charcode); + + for (var charcode = 0xDC01; charcode < 0xDFFF; charcode += resolution) + checkEncodeException(encodeFunction, charcode); + + for (var charcode = 0xD801; charcode < 0xDBFF; charcode += resolution) + checkEncodeDecode(encodeFunction, decodeFunction, charcode, 0xDC00); + + for (var charcode = 0xDC01; charcode < 0xDFFF; charcode += resolution) + checkEncodeDecode(encodeFunction, decodeFunction, 0xD800, charcode); + + for (var charcode = 1; charcode < 0xDBFF; charcode += resolution) + checkEncodeException(encodeFunction, 0xD800, charcode); + + for (var charcode = 0xE001; charcode < 0xFFFD; charcode += resolution) + checkEncodeException(encodeFunction, 0xD800, charcode); +} + +checkWithFunctions("encodeURI", "decodeURI"); +checkWithFunctions("encodeURIComponent", "decodeURIComponent");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/eval-expected.txt b/deps/v8/test/webkit/fast/js/kde/eval-expected.txt new file mode 100644 index 0000000000..bcbe28faa0 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/eval-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS eval.length is 1 +PASS eval('this') is this +PASS bx is 99 +PASS cx is 99 +PASS Skipping test for deprecated Object.prototype.eval() +PASS lotto() is 0 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/eval.js b/deps/v8/test/webkit/fast/js/kde/eval.js new file mode 100644 index 0000000000..7c4b5d4b92 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/eval.js @@ -0,0 +1,56 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("eval.length", "1"); +shouldBe("eval('this')", "this"); + +function MyObject() { + this.x = 99; +} + +eval("b = new MyObject();"); +var bx = b.x // rule out side effects of eval() in shouldBe() test function +shouldBe("bx", "99"); + + +eval("var c = new MyObject();"); // the 'var' makes a difference +var cx = c.x; +shouldBe("cx", "99"); + +// KDE bug #45679 +if (true.eval) { + var o = { str:1 }; + shouldBe("o.eval('str')", "1"); + shouldBe("o.eval('this')", "this"); +} else { + testPassed("Skipping test for deprecated Object.prototype.eval()"); +} + +// problem from within khtml +function lotto() { + // j must be accessible to eval() + for (var j = 0; j < 1; j++) + return eval('j'); +} +shouldBe("lotto()", "0");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/evil-n-expected.txt b/deps/v8/test/webkit/fast/js/kde/evil-n-expected.txt new file mode 100644 index 0000000000..1dafefe059 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/evil-n-expected.txt @@ -0,0 +1,34 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS (new Error()).message is '' +PASS ''.split(/.*/).length is 0 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/evil-n.js b/deps/v8/test/webkit/fast/js/kde/evil-n.js new file mode 100644 index 0000000000..b9b5cdb376 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/evil-n.js @@ -0,0 +1,28 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("(new Error()).message", "''"); + +// the empty match isn't taken in account +shouldBe("''.split(/.*/).length", "0");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/exception_propagation-expected.txt b/deps/v8/test/webkit/fast/js/kde/exception_propagation-expected.txt new file mode 100644 index 0000000000..433c66a666 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/exception_propagation-expected.txt @@ -0,0 +1,97 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS func_ret_with_ex_func is 4 +PASS func_ret_from_ex_throw_args is 4 +PASS set_from_throw_func_args is 4 +PASS set_from_func_throw_args is 4 +PASS set_from_before_func_throw_args is 1 +PASS function_param_order is 'abc' +PASS new_param_order is 'abc' +PASS elision_param_order is 'abc' +PASS comma_order is 'abc' +PASS OpEqEq_part1 is 1 +PASS OpEqEq_part2 is 4 +PASS OpNotEq_part1 is 1 +PASS OpNotEq_part2 is 4 +PASS OpStrEq_part1 is 1 +PASS OpStrEq_part2 is 4 +PASS OpStrNEq_part1 is 1 +PASS OpStrNEq_part2 is 4 +PASS OpLess_part1 is 1 +PASS OpLess_part2 is 4 +PASS OpLessEq_part1 is 1 +PASS OpLessEq_part2 is 4 +PASS OpGreater_part1 is 1 +PASS OpGreater_part2 is 4 +PASS OpGreaterEq_part1 is 1 +PASS OpGreaterEq_part2 is 4 +PASS OpAnd_part1 is 1 +PASS OpAnd_part2 is 4 +PASS OpOr_part1 is 1 +PASS OpOr_part2 is 4 +PASS OpBitAnd_part1 is 1 +PASS OpBitAnd_part2 is 4 +PASS OpBitXOr_part1 is 1 +PASS OpBitXOr_part2 is 4 +PASS OpBitOr_part1 is 1 +PASS OpBitOr_part2 is 4 +PASS OpLShift_part1 is 1 +PASS OpLShift_part2 is 4 +PASS OpRShift_part1 is 1 +PASS OpRShift_part2 is 4 +PASS OpURShift_part1 is 1 +PASS OpURShift_part2 is 4 +PASS OpInstanceOf_part1 is 1 +PASS OpInstanceOf_part2 is 4 +PASS set_from_if_stmt is 4 +PASS set_from_if_else_stmt is 4 +PASS set_from_else_in_if_else_stmt is 4 +PASS comma_left is 1 +PASS comma_left is 4 +PASS vardecl_assign_throws is 4 +PASS var_assign_before_throw_run is true +PASS var_assign_after_throw_run is false +PASS do_val is 5 +PASS while_val is 4 +PASS for_val_part1_throw2 is 1 +PASS for_val_part1_throw3 is 1 +PASS for_val_part2_throw1 is 4 +PASS for_val_part2_throw3 is 1 +PASS for_val_part3_throw1 is 4 +PASS for_val_part3_throw2 is 4 +PASS for_val_part1_throwbody is 1 +PASS for_val_part2_throwbody is 1 +PASS for_val_part3_throwbody is 4 +PASS forin_count is 4 +PASS set_inside_with_throw is 4 +PASS set_inside_with_cantconverttoobject is 4 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/exception_propagation.js b/deps/v8/test/webkit/fast/js/kde/exception_propagation.js new file mode 100644 index 0000000000..71be4f784e --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/exception_propagation.js @@ -0,0 +1,446 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var global = this; +function myfunc() { +} +function throwex() { + throw new Error("test exception"); +} + +//--------------------------- +var func_ret_with_ex_func = 4; +try { + func_ret_with_ex_func = throwex()(); +} +catch (e) { +} +shouldBe("func_ret_with_ex_func", "4"); + +// --------------------------------- + +var func_ret_from_ex_throw_args = 4; +try { + func_ret_from_ex_throw_args = Math.abs(throwex()); +} +catch (e) { +} +shouldBe("func_ret_from_ex_throw_args", "4"); + +// --------------------------------- + +var set_from_throw_func_args = 4; +try { + throwex()(set_from_throw_func_args = 1); +} +catch (e) { +} +shouldBe("set_from_throw_func_args","4"); + +// --------------------------------- + +var set_from_func_throw_args = 4; +try { + myfunc(throwex(), set_from_func_throw_args = 1); +} +catch (e) { +} +shouldBe("set_from_func_throw_args","4"); + +// --------------------------------- + +var set_from_before_func_throw_args = 4; +try { + myfunc(set_from_before_func_throw_args = 1, throwex()); +} +catch (e) { +} +shouldBe("set_from_before_func_throw_args","1"); + +// --------------------------------- + +// ### move to function.js +var function_param_order = ""; +function aparam() { + function_param_order += "a"; +} +function bparam() { + function_param_order += "b"; +} +function cparam() { + function_param_order += "c"; +} +myfunc(aparam(),bparam(),cparam()); +shouldBe("function_param_order","'abc'"); + +// --------------------------------- +// ### move to function.js +var new_param_order = ""; +function anewparam() { + new_param_order += "a"; +} +function bnewparam() { + new_param_order += "b"; +} +function cnewparam() { + new_param_order += "c"; +} +new myfunc(anewparam(),bnewparam(),cnewparam()); +shouldBe("new_param_order","'abc'"); + +// --------------------------------- +// ### move to function.js +var elision_param_order = ""; +function aelision() { + elision_param_order += "a"; +} +function belision() { + elision_param_order += "b"; +} +function celision() { + elision_param_order += "c"; +} +[aelision(),belision(),celision()]; +shouldBe("elision_param_order","'abc'"); + +// --------------------------------- +// ### move to function.js +var comma_order = ""; +function acomma() { + comma_order += "a"; +} +function bcomma() { + comma_order += "b"; +} +function ccomma() { + comma_order += "c"; +} +acomma(),bcomma(),ccomma(); +shouldBe("comma_order","'abc'"); + +// --------------------------------- + +function checkOperator(op,name) { + var code =( + "global."+name+"_part1 = 4;\n"+ + "try {\n"+ + " ("+name+"_part1 = 1) "+op+" throwex();\n"+ + "}\n"+ + "catch (e) {\n"+ + "}\n"+ + "shouldBe('"+name+"_part1', '1');\n"+ + "global."+name+"_part2 = 4;\n"+ + "try {\n"+ + " throwex() "+op+" ("+name+"_part2 = 1);\n"+ + "}\n"+ + "catch (e) {\n"+ + "}\n"+ + "shouldBe('"+name+"_part2', '4');\n"); +// print("\n\n\n"); +// print(code); + eval(code); +} + +checkOperator("==","OpEqEq"); +checkOperator("!=","OpNotEq"); +checkOperator("===","OpStrEq"); +checkOperator("!==","OpStrNEq"); +// ### these generate a syntax error in mozilla - kjs should do the same (?) +//checkOperator("+=","OpPlusEq"); +//checkOperator("-=","OpMinusEq"); +//checkOperator("*=","OpMultEq"); +//checkOperator("/=","OpDivEq"); +// OpPlusPlus, +// Â Â Â Â Â Â Â Â Â Â Â Â Â Â OpMinusMinus, +checkOperator("<","OpLess"); +checkOperator("<=","OpLessEq"); +checkOperator(">","OpGreater"); +checkOperator(">=","OpGreaterEq"); +//checkOperator("&=","OpAndEq"); +//checkOperator("^=","OpXOrEq"); +//checkOperator("|=","OpOrEq"); +//checkOperator("%=","OpModEq"); +checkOperator("&&","OpAnd"); +checkOperator("||","OpOr"); +checkOperator("&","OpBitAnd"); +checkOperator("^","OpBitXOr"); +checkOperator("|","OpBitOr"); +checkOperator("<<","OpLShift"); +checkOperator(">>","OpRShift"); +checkOperator(">>>","OpURShift"); +// Â Â Â Â Â Â Â Â Â Â Â Â Â Â OpIn, +checkOperator("instanceof","OpInstanceOf"); + +// --------------------------------- +var set_from_if_stmt = 4; +try { + if (throwex()) { + set_from_if_stmt = 1; + } +} +catch (e) { +} +shouldBe("set_from_if_stmt","4"); + +// --------------------------------- +var set_from_if_else_stmt = 4; +try { + if (throwex()) { + set_from_if_else_stmt = 1; + } + else { + undefined; + } +} +catch (e) { +} +shouldBe("set_from_if_else_stmt","4"); + +// --------------------------------- + +var set_from_else_in_if_else_stmt = 4; +try { + if (throwex()) { + undefined; + } + else { + set_from_else_in_if_else_stmt = 1; + } +} +catch (e) { +} +shouldBe("set_from_else_in_if_else_stmt","4"); + +// --------------------------------- + +var comma_left = 4; +try { + comma_left = 1, throwex(); +} +catch (e) { +} +shouldBe("comma_left","1"); + +// --------------------------------- + +var comma_left = 4; +try { + throwex(), comma_left = 1; +} +catch (e) { +} +shouldBe("comma_left","4"); + +var vardecl_assign_throws = 4; +try { + var vardecl_assign_throws = throwex(); +} +catch (e) { +} +shouldBe("vardecl_assign_throws","4"); + +// --------------------------------- + +var var_assign_before_throw_run = false; +function var_assign_before_throw() { + var_assign_before_throw_run = true; + return 1; +} + +var var_assign_after_throw_run = false; +function var_assign_after_throw() { + var_assign_after_throw_run = true; + return 1; +} + +try { + var var_assign1 = var_assign_before_throw(), + var_assign2 = throwex(), + var_assign1 = var_assign_before_throw(); +} +catch (e) { +} +shouldBe("var_assign_before_throw_run","true"); +shouldBe("var_assign_after_throw_run","false"); + +// --------------------------------- + +var do_val = 4; +try { + do { + do_val++; + } + while (throwex()); +} +catch (e) { +} +shouldBe("do_val","5"); + +// --------------------------------- +var while_val = 4; +try { + while (throwex()) { + while_val++; + } +} +catch (e) { +} +shouldBe("while_val","4"); + +// --------------------------------- +var for_val_part1_throw2 = 4; +try { + for (for_val_part1_throw2 = 1; throwex(); ) { + } +} +catch (e) { +} +shouldBe("for_val_part1_throw2","1"); + +// --------------------------------- +var for_val_part1_throw3 = 4; +try { + for (for_val_part1_throw3 = 1; ; throwex()) { + } +} +catch (e) { +} +shouldBe("for_val_part1_throw3","1"); + +// --------------------------------- +var for_val_part2_throw1 = 4; +try { + for (throwex(); for_val_part2_throw1 = 1; ) { + } +} +catch (e) { +} +shouldBe("for_val_part2_throw1","4"); + +// --------------------------------- +var for_val_part2_throw3 = 4; +try { + for (; for_val_part2_throw3 = 1; throwex()) { + } +} +catch (e) { +} +shouldBe("for_val_part2_throw3","1"); + +// --------------------------------- +var for_val_part3_throw1 = 4; +try { + for (throwex(); ; for_val_part3_throw1 = 1) { + } +} +catch (e) { +} +shouldBe("for_val_part3_throw1","4"); + +// --------------------------------- +var for_val_part3_throw2 = 4; +try { + for (; throwex(); for_val_part3_throw2 = 1) { + } +} +catch (e) { +} +shouldBe("for_val_part3_throw2","4"); + +// --------------------------------- +var for_val_part1_throwbody = 4; +try { + for (for_val_part1_throwbody = 1; ;) { + throwex(); + } +} +catch (e) { +} +shouldBe("for_val_part1_throwbody","1"); + +// --------------------------------- +var for_val_part2_throwbody = 4; +try { + for (; for_val_part2_throwbody = 1; ) { + throwex(); + } +} +catch (e) { +} +shouldBe("for_val_part2_throwbody","1"); + +// --------------------------------- +var for_val_part3_throwbody = 4; +try { + for (; ; for_val_part3_throwbody = 1) { + throwex(); + } +} +catch (e) { +} +shouldBe("for_val_part3_throwbody","4"); + +// --------------------------------- +var forin_test_obj = new Object(); +forin_test_obj.a = 1; +forin_test_obj.b = 2; +forin_test_obj.c = 3; +var forin_count = 4; +function forin_lexpr() { +// if (forincount == 1); +// throwex(); + return new Object(); +} +try { + for (throwex() in forin_test_obj) { + forin_count++; + } +} +catch (e) { +} +shouldBe("forin_count","4"); + +// --------------------------------- +var set_inside_with_throw = 4; +try { + with (throwex()) { + set_inside_with_throw = 1; + } +} +catch (e) { +} +shouldBe("set_inside_with_throw","4"); + +// --------------------------------- +var set_inside_with_cantconverttoobject = 4; +try { + with (undefined) { + print("FAIL. This message should not be displayed"); + set_inside_with_cantconverttoobject = 1; + } +} +catch (e) { +} +shouldBe("set_inside_with_cantconverttoobject","4"); +// ### test case, sw
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/exceptions-expected.txt b/deps/v8/test/webkit/fast/js/kde/exceptions-expected.txt new file mode 100644 index 0000000000..6c11b506f5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/exceptions-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Except a lot of errors. They should all be caught and lead to PASS +testing throw() .......... Passed +testing throw() .......... Passed +ReferenceError .......... Passed +error propagation in functions .......... Passed +catch +finally +Math() error .......... Passed +Abort while() on error .......... Passed +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/exceptions.js b/deps/v8/test/webkit/fast/js/kde/exceptions.js new file mode 100644 index 0000000000..f2c9872830 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/exceptions.js @@ -0,0 +1,127 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +function kdeShouldBe(a, b, c) +{ + if ( a == b ) + debug(c+" .......... Passed"); + else + debug(c+" .......... Failed"); +} + +function testThrow() +{ + var caught = false; + try { + throw 99; + } catch (e) { + caught = true; + } + kdeShouldBe(caught, true, "testing throw()"); +} + +// same as above but lacking a semicolon after throw +function testThrow2() +{ + var caught = false; + try { + throw 99 + } catch (e) { + caught = true; + } + kdeShouldBe(caught, true, "testing throw()"); +} + +function testReferenceError() +{ + var err = "noerror"; + var caught = false; + try { + var dummy = nonexistant; // throws reference error + } catch (e) { + caught = true; + err = e.name; + } + // test err + kdeShouldBe(caught, true, "ReferenceError"); +} + +function testFunctionErrorHelper() +{ + var a = b; // throws reference error +} + +function testFunctionError() +{ + var caught = false; + try { + testFunctionErrorHelper(); + } catch (e) { + caught = true; + } + kdeShouldBe(caught, true, "error propagation in functions"); +} + +function testMathFunctionError() +{ + var caught = false; + try { + Math(); + } catch (e) { + debug("catch"); + caught = true; + } finally { + debug("finally"); + } + kdeShouldBe(caught, true, "Math() error"); +} + +function testWhileAbortion() +{ + var caught = 0; + try { + while (a=b, 1) { Â Â Â Â Â Â Â // "endless error" in condition + ; + } + } catch (e) { + caught++; + } + + try { + while (1) { + var a = b; Â Â Â Â Â Â Â // error in body + } + } catch (e) { + caught++; + } + kdeShouldBe(caught, 2, "Abort while() on error"); +} + +debug("Except a lot of errors. They should all be caught and lead to PASS"); +testThrow(); +testThrow2(); +testReferenceError(); +testFunctionError(); +testMathFunctionError(); +testWhileAbortion();
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/func-decl-expected.txt b/deps/v8/test/webkit/fast/js/kde/func-decl-expected.txt new file mode 100644 index 0000000000..d2db3810d9 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/func-decl-expected.txt @@ -0,0 +1,45 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Function declaration takes effect at entry +PASS Decl not yet overwritten +PASS After assign (0) +PASS function decls have no execution content +PASS After assign #2 (0) +PASS Decl already overwritten +PASS After assign (1) +PASS function decls have no execution content +PASS After assign #2 (1) +PASS Decl already overwritten +PASS After assign (2) +PASS function decls have no execution content +PASS After assign #2 (2) +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/func-decl.js b/deps/v8/test/webkit/fast/js/kde/func-decl.js new file mode 100644 index 0000000000..b046b22bc9 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/func-decl.js @@ -0,0 +1,68 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// We can't use normal shouldBe here, since they'd eval in the wrong context... +function shouldBeOfType(msg, val, type) { + if (typeof(val) != type) + testFailed(msg + ": value has type " + typeof(val) + " , not:" + type); + else + testPassed(msg); +} + +function shouldBeVal(msg, val, expected) { + if (val != expected) + testFailed(msg + ": value is " + val + " , not:" + expected); + else + testPassed(msg); +} + +f = "global"; + +function test() { + try { + shouldBeOfType("Function declaration takes effect at entry", f, "function"); + } + catch (e) { + testFailed("Scoping very broken!"); + } + + for (var i = 0; i < 3; ++i) { + if (i == 0) + shouldBeOfType("Decl not yet overwritten", f, 'function'); + else + shouldBeOfType("Decl already overwritten", f, 'number'); + + f = 3; + shouldBeVal("After assign ("+i+")", f, 3); + + function f() {}; + shouldBeVal("function decls have no execution content", f, 3); + + f = 5; + + shouldBeVal("After assign #2 ("+i+")", f, 5); + } +} + +test();
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto-expected.txt b/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto-expected.txt new file mode 100644 index 0000000000..99818c3cb5 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto-expected.txt @@ -0,0 +1,125 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Object.prototype.toString.__proto__ is Function.prototype +PASS Object.prototype.valueOf.__proto__ is Function.prototype +PASS Array.prototype.toString.__proto__ is Function.prototype +PASS Array.prototype.toLocaleString.__proto__ is Function.prototype +PASS Array.prototype.concat.__proto__ is Function.prototype +PASS Array.prototype.join.__proto__ is Function.prototype +PASS Array.prototype.pop.__proto__ is Function.prototype +PASS Array.prototype.push.__proto__ is Function.prototype +PASS Array.prototype.reverse.__proto__ is Function.prototype +PASS Array.prototype.shift.__proto__ is Function.prototype +PASS Array.prototype.slice.__proto__ is Function.prototype +PASS Array.prototype.sort.__proto__ is Function.prototype +PASS Array.prototype.splice.__proto__ is Function.prototype +PASS Array.prototype.unshift.__proto__ is Function.prototype +PASS String.prototype.toString.__proto__ is Function.prototype +PASS String.prototype.valueOf.__proto__ is Function.prototype +PASS String.prototype.charAt.__proto__ is Function.prototype +PASS String.prototype.charCodeAt.__proto__ is Function.prototype +PASS String.prototype.indexOf.__proto__ is Function.prototype +PASS String.prototype.lastIndexOf.__proto__ is Function.prototype +PASS String.prototype.match.__proto__ is Function.prototype +PASS String.prototype.replace.__proto__ is Function.prototype +PASS String.prototype.search.__proto__ is Function.prototype +PASS String.prototype.slice.__proto__ is Function.prototype +PASS String.prototype.split.__proto__ is Function.prototype +PASS String.prototype.substr.__proto__ is Function.prototype +PASS String.prototype.substring.__proto__ is Function.prototype +PASS String.prototype.toLowerCase.__proto__ is Function.prototype +PASS String.prototype.toUpperCase.__proto__ is Function.prototype +PASS String.prototype.big.__proto__ is Function.prototype +PASS String.prototype.small.__proto__ is Function.prototype +PASS String.prototype.blink.__proto__ is Function.prototype +PASS String.prototype.bold.__proto__ is Function.prototype +PASS String.prototype.fixed.__proto__ is Function.prototype +PASS String.prototype.italics.__proto__ is Function.prototype +PASS String.prototype.strike.__proto__ is Function.prototype +PASS String.prototype.sub.__proto__ is Function.prototype +PASS String.prototype.sup.__proto__ is Function.prototype +PASS String.prototype.fontcolor.__proto__ is Function.prototype +PASS String.prototype.fontsize.__proto__ is Function.prototype +PASS String.prototype.anchor.__proto__ is Function.prototype +PASS String.prototype.link.__proto__ is Function.prototype +PASS Boolean.prototype.toString.__proto__ is Function.prototype +PASS Boolean.prototype.valueOf.__proto__ is Function.prototype +PASS Date.prototype.toString.__proto__ is Function.prototype +PASS Date.prototype.toUTCString.__proto__ is Function.prototype +PASS Date.prototype.toDateString.__proto__ is Function.prototype +PASS Date.prototype.toTimeString.__proto__ is Function.prototype +PASS Date.prototype.toLocaleString.__proto__ is Function.prototype +PASS Date.prototype.toLocaleDateString.__proto__ is Function.prototype +PASS Date.prototype.toLocaleTimeString.__proto__ is Function.prototype +PASS Date.prototype.valueOf.__proto__ is Function.prototype +PASS Date.prototype.getTime.__proto__ is Function.prototype +PASS Date.prototype.getFullYear.__proto__ is Function.prototype +PASS Date.prototype.getUTCFullYear.__proto__ is Function.prototype +PASS Date.prototype.toGMTString.__proto__ is Function.prototype +PASS Date.prototype.getMonth.__proto__ is Function.prototype +PASS Date.prototype.getUTCMonth.__proto__ is Function.prototype +PASS Date.prototype.getDate.__proto__ is Function.prototype +PASS Date.prototype.getUTCDate.__proto__ is Function.prototype +PASS Date.prototype.getDay.__proto__ is Function.prototype +PASS Date.prototype.getUTCDay.__proto__ is Function.prototype +PASS Date.prototype.getHours.__proto__ is Function.prototype +PASS Date.prototype.getUTCHours.__proto__ is Function.prototype +PASS Date.prototype.getMinutes.__proto__ is Function.prototype +PASS Date.prototype.getUTCMinutes.__proto__ is Function.prototype +PASS Date.prototype.getSeconds.__proto__ is Function.prototype +PASS Date.prototype.getUTCSeconds.__proto__ is Function.prototype +PASS Date.prototype.getMilliseconds.__proto__ is Function.prototype +PASS Date.prototype.getUTCMilliseconds.__proto__ is Function.prototype +PASS Date.prototype.getTimezoneOffset.__proto__ is Function.prototype +PASS Date.prototype.setTime.__proto__ is Function.prototype +PASS Date.prototype.setMilliseconds.__proto__ is Function.prototype +PASS Date.prototype.setUTCMilliseconds.__proto__ is Function.prototype +PASS Date.prototype.setSeconds.__proto__ is Function.prototype +PASS Date.prototype.setUTCSeconds.__proto__ is Function.prototype +PASS Date.prototype.setMinutes.__proto__ is Function.prototype +PASS Date.prototype.setUTCMinutes.__proto__ is Function.prototype +PASS Date.prototype.setHours.__proto__ is Function.prototype +PASS Date.prototype.setUTCHours.__proto__ is Function.prototype +PASS Date.prototype.setDate.__proto__ is Function.prototype +PASS Date.prototype.setUTCDate.__proto__ is Function.prototype +PASS Date.prototype.setMonth.__proto__ is Function.prototype +PASS Date.prototype.setUTCMonth.__proto__ is Function.prototype +PASS Date.prototype.setFullYear.__proto__ is Function.prototype +PASS Date.prototype.setUTCFullYear.__proto__ is Function.prototype +PASS Date.prototype.setYear.__proto__ is Function.prototype +PASS Date.prototype.getYear.__proto__ is Function.prototype +PASS Date.prototype.toGMTString.__proto__ is Function.prototype +PASS RegExp.prototype.exec.__proto__ is Function.prototype +PASS RegExp.prototype.test.__proto__ is Function.prototype +PASS RegExp.prototype.toString.__proto__ is Function.prototype +PASS Error.prototype.toString.__proto__ is Function.prototype +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto.js b/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto.js new file mode 100644 index 0000000000..de13b70855 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/inbuilt_function_proto.js @@ -0,0 +1,117 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Object.prototype.toString.__proto__","Function.prototype"); +shouldBe("Object.prototype.valueOf.__proto__","Function.prototype"); +shouldBe("Array.prototype.toString.__proto__","Function.prototype"); +shouldBe("Array.prototype.toLocaleString.__proto__","Function.prototype"); +shouldBe("Array.prototype.concat.__proto__","Function.prototype"); +shouldBe("Array.prototype.join.__proto__","Function.prototype"); +shouldBe("Array.prototype.pop.__proto__","Function.prototype"); +shouldBe("Array.prototype.push.__proto__","Function.prototype"); +shouldBe("Array.prototype.reverse.__proto__","Function.prototype"); +shouldBe("Array.prototype.shift.__proto__","Function.prototype"); +shouldBe("Array.prototype.slice.__proto__","Function.prototype"); +shouldBe("Array.prototype.sort.__proto__","Function.prototype"); +shouldBe("Array.prototype.splice.__proto__","Function.prototype"); +shouldBe("Array.prototype.unshift.__proto__","Function.prototype"); +shouldBe("String.prototype.toString.__proto__","Function.prototype"); +shouldBe("String.prototype.valueOf.__proto__","Function.prototype"); +shouldBe("String.prototype.charAt.__proto__","Function.prototype"); +shouldBe("String.prototype.charCodeAt.__proto__","Function.prototype"); +shouldBe("String.prototype.indexOf.__proto__","Function.prototype"); +shouldBe("String.prototype.lastIndexOf.__proto__","Function.prototype"); +shouldBe("String.prototype.match.__proto__","Function.prototype"); +shouldBe("String.prototype.replace.__proto__","Function.prototype"); +shouldBe("String.prototype.search.__proto__","Function.prototype"); +shouldBe("String.prototype.slice.__proto__","Function.prototype"); +shouldBe("String.prototype.split.__proto__","Function.prototype"); +shouldBe("String.prototype.substr.__proto__","Function.prototype"); +shouldBe("String.prototype.substring.__proto__","Function.prototype"); +shouldBe("String.prototype.toLowerCase.__proto__","Function.prototype"); +shouldBe("String.prototype.toUpperCase.__proto__","Function.prototype"); +shouldBe("String.prototype.big.__proto__","Function.prototype"); +shouldBe("String.prototype.small.__proto__","Function.prototype"); +shouldBe("String.prototype.blink.__proto__","Function.prototype"); +shouldBe("String.prototype.bold.__proto__","Function.prototype"); +shouldBe("String.prototype.fixed.__proto__","Function.prototype"); +shouldBe("String.prototype.italics.__proto__","Function.prototype"); +shouldBe("String.prototype.strike.__proto__","Function.prototype"); +shouldBe("String.prototype.sub.__proto__","Function.prototype"); +shouldBe("String.prototype.sup.__proto__","Function.prototype"); +shouldBe("String.prototype.fontcolor.__proto__","Function.prototype"); +shouldBe("String.prototype.fontsize.__proto__","Function.prototype"); +shouldBe("String.prototype.anchor.__proto__","Function.prototype"); +shouldBe("String.prototype.link.__proto__","Function.prototype"); +shouldBe("Boolean.prototype.toString.__proto__","Function.prototype"); +shouldBe("Boolean.prototype.valueOf.__proto__","Function.prototype"); +shouldBe("Date.prototype.toString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toUTCString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toDateString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toTimeString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toLocaleString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toLocaleDateString.__proto__","Function.prototype"); +shouldBe("Date.prototype.toLocaleTimeString.__proto__","Function.prototype"); +shouldBe("Date.prototype.valueOf.__proto__","Function.prototype"); +shouldBe("Date.prototype.getTime.__proto__","Function.prototype"); +shouldBe("Date.prototype.getFullYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCFullYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.toGMTString.__proto__","Function.prototype"); +shouldBe("Date.prototype.getMonth.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCMonth.__proto__","Function.prototype"); +shouldBe("Date.prototype.getDate.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCDate.__proto__","Function.prototype"); +shouldBe("Date.prototype.getDay.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCDay.__proto__","Function.prototype"); +shouldBe("Date.prototype.getHours.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCHours.__proto__","Function.prototype"); +shouldBe("Date.prototype.getMinutes.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCMinutes.__proto__","Function.prototype"); +shouldBe("Date.prototype.getSeconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCSeconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.getMilliseconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.getUTCMilliseconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.getTimezoneOffset.__proto__","Function.prototype"); +shouldBe("Date.prototype.setTime.__proto__","Function.prototype"); +shouldBe("Date.prototype.setMilliseconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCMilliseconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.setSeconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCSeconds.__proto__","Function.prototype"); +shouldBe("Date.prototype.setMinutes.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCMinutes.__proto__","Function.prototype"); +shouldBe("Date.prototype.setHours.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCHours.__proto__","Function.prototype"); +shouldBe("Date.prototype.setDate.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCDate.__proto__","Function.prototype"); +shouldBe("Date.prototype.setMonth.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCMonth.__proto__","Function.prototype"); +shouldBe("Date.prototype.setFullYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.setUTCFullYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.setYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.getYear.__proto__","Function.prototype"); +shouldBe("Date.prototype.toGMTString.__proto__","Function.prototype"); +shouldBe("RegExp.prototype.exec.__proto__","Function.prototype"); +shouldBe("RegExp.prototype.test.__proto__","Function.prototype"); +shouldBe("RegExp.prototype.toString.__proto__","Function.prototype"); +shouldBe("Error.prototype.toString.__proto__","Function.prototype");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/iteration-expected.txt b/deps/v8/test/webkit/fast/js/kde/iteration-expected.txt new file mode 100644 index 0000000000..8ed88b9a88 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/iteration-expected.txt @@ -0,0 +1,38 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS count is 10 +PASS count is 5 +PASS count is 10 +PASS properties is 'a=11;b=22;' +PASS list is '[0]=100;[1]=101;' +PASS list is '123' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/iteration.js b/deps/v8/test/webkit/fast/js/kde/iteration.js new file mode 100644 index 0000000000..7004be054b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/iteration.js @@ -0,0 +1,79 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// 12.6.1 +var count = 0; +do { + count++; +} while (count < 10); +shouldBe("count", "10"); + +count = 0; +for (var i = 0; i < 10; i++) { + if (i == 5) + break; + count++; +} +shouldBe("count", "5"); + +// 12.6.3 +count = 0; +for (i = 0; i < 10; i++) { + count++; +} +shouldBe("count", "10"); + +// 12.6.4 +obj = new Object(); +obj.a = 11; +obj.b = 22; + +properties = ""; +for ( prop in obj ) + properties += (prop + "=" + obj[prop] + ";"); + +shouldBe("properties", "'a=11;b=22;'"); + +// now a test verifying the order. not standardized but common. +obj.y = 33; +obj.x = 44; +properties = ""; +for ( prop in obj ) + properties += prop; +// shouldBe("properties", "'abyx'"); + +arr = new Array; +arr[0] = 100; +arr[1] = 101; +list = ""; +for ( var j in arr ) { + list += "[" + j + "]=" + arr[j] + ";"; +} +shouldBe("list","'[0]=100;[1]=101;'"); + +list = ""; +for (var a = [1,2,3], length = a.length, i = 0; i < length; i++) { + list += a[i]; +} +shouldBe("list", "'123'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/j-comment-3-expected.txt b/deps/v8/test/webkit/fast/js/kde/j-comment-3-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/j-comment-3-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/j-comment-3.js b/deps/v8/test/webkit/fast/js/kde/j-comment-3.js new file mode 100644 index 0000000000..2cf0a0f5de --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/j-comment-3.js @@ -0,0 +1,25 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +<!-- HTML comment (not ECMA)
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/j-comment-4-expected.txt b/deps/v8/test/webkit/fast/js/kde/j-comment-4-expected.txt new file mode 100644 index 0000000000..6d4b78b843 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/j-comment-4-expected.txt @@ -0,0 +1,32 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/j-comment-4.js b/deps/v8/test/webkit/fast/js/kde/j-comment-4.js new file mode 100644 index 0000000000..4d23f3bc5b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/j-comment-4.js @@ -0,0 +1,25 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +--> end of HTML comment (not ECMA)
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/literals-expected.txt b/deps/v8/test/webkit/fast/js/kde/literals-expected.txt new file mode 100644 index 0000000000..c164284896 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/literals-expected.txt @@ -0,0 +1,40 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS x is 1 +PASS 0x0 is 0 +PASS 0xF is 15 +PASS 0xFF is 255 +PASS 01 is 1 +PASS 010 is 8 +PASS 09 is 9 +PASS 019 is 19 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/literals.js b/deps/v8/test/webkit/fast/js/kde/literals.js new file mode 100644 index 0000000000..57cf8cd919 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/literals.js @@ -0,0 +1,38 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var x = 0; +eval("\u0009 \u000B \u000C \u00A0x = 1;"); +shouldBe("x", "1"); + +// hex (non-normative) +shouldBe("0x0", "0"); +shouldBe("0xF", "15"); +shouldBe("0xFF", "255"); + +// octal (non-normative) +shouldBe("01", "1"); +shouldBe("010", "8"); +shouldBe("09", "9"); +shouldBe("019", "19");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/lval-exceptions-expected.txt b/deps/v8/test/webkit/fast/js/kde/lval-exceptions-expected.txt new file mode 100644 index 0000000000..d8f29875ea --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/lval-exceptions-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS function () { a = x; } threw exception ReferenceError: x is not defined. +PASS function () { x += "foo"; } threw exception ReferenceError: x is not defined. +PASS function () { b = a.x; } did not throw an exception +PASS function () { b = a['x']; } did not throw an exception +PASS function () { a['x'] += 'baz'; } did not throw an exception +PASS a['x'] is "undefinedbaz" +PASS function () { b = a.y; } did not throw an exception +PASS function () { a.y += 'glarch'; } did not throw an exception +PASS a['y'] is "undefinedglarch" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/lval-exceptions.js b/deps/v8/test/webkit/fast/js/kde/lval-exceptions.js new file mode 100644 index 0000000000..32641f8d4d --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/lval-exceptions.js @@ -0,0 +1,74 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// Tests for raising --- and non-raising exceptions on access to reference to undefined things... + +// Locals should throw on access if undefined.. +fnShouldThrow(function() { a = x; }, ReferenceError); + +// Read-modify-write versions of assignment should throw as well +fnShouldThrow(function() { x += "foo"; }, ReferenceError); + +// Other reference types should just return undefined... +a = new Object(); +fnShouldNotThrow(function() { b = a.x; }); +fnShouldNotThrow(function() { b = a['x']; }); +fnShouldNotThrow(function() { a['x'] += 'baz'; }); +shouldBe("a['x']", '"undefinedbaz"'); +fnShouldNotThrow(function() { b = a.y; }); +fnShouldNotThrow(function() { a.y += 'glarch'; }); +shouldBe("a['y']", '"undefinedglarch"'); + + +// Helpers! +function fnShouldThrow(f, exType) +{ + var exception; + var _av; + try { + _av = f(); + } catch (e) { + exception = e; + } + + if (exception) { + if (typeof exType == "undefined" || exception instanceof exType) + testPassed(f + " threw exception " + exception + "."); + else + testFailed(f + " should throw exception " + exType + ". Threw exception " + exception + "."); + } else if (typeof _av == "undefined") + testFailed(f + " should throw exception " + exType + ". Was undefined."); + else + testFailed(f + " should throw exception " + exType + ". Was " + _av + "."); +} + +function fnShouldNotThrow(f) +{ + try { + f(); + testPassed(f + " did not throw an exception"); + } catch (e) { + testFailed(f + " threw an exception " + e + " when no exception expected"); + } +}
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/math-expected.txt b/deps/v8/test/webkit/fast/js/kde/math-expected.txt new file mode 100644 index 0000000000..35b2b7dec6 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/math-expected.txt @@ -0,0 +1,91 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS isNegativeZero(negativeZero) is true +PASS isNegativeZero(0) is false +PASS String()+Math.E is '2.718281828459045' +PASS String()+Math.LN2 is '0.6931471805599453' +PASS String()+Math.LN10 is '2.302585092994046' +PASS String()+Math.LOG2E is '1.4426950408889634' +PASS String()+Math.LOG10E is '0.4342944819032518' +PASS String()+Math.PI is '3.141592653589793' +PASS String()+Math.SQRT1_2 is '0.7071067811865476' +PASS String()+Math.SQRT2 is '1.4142135623730951' +PASS String()+Number.NaN is 'NaN' +PASS String()+Number.NEGATIVE_INFINITY is '-Infinity' +PASS String()+Number.POSITIVE_INFINITY is 'Infinity' +PASS Math.abs(-5) is 5 +PASS Math.acos(0) is Math.PI/2 +PASS Math.acos(1) is 0 +PASS Math.ceil(1.1) is 2 +PASS String()+Math.sqrt(2) is String()+Math.SQRT2 +PASS Math.ceil(1.6) is 2 +PASS Math.round(0) is 0 +PASS isNegativeZero(Math.round(0)) is false +PASS isNegativeZero(Math.round(negativeZero)) is true +PASS Math.round(0.2) is 0 +PASS isNegativeZero(Math.round(-0.2)) is true +PASS isNegativeZero(Math.round(-0.5)) is true +PASS Math.round(1.1) is 1 +PASS Math.round(1.6) is 2 +PASS Math.round(-3.5) is -3 +PASS Math.round(-3.6) is -4 +PASS isNaN(Math.round()) is true +PASS isNaN(Math.round(NaN)) is true +PASS Math.round(-Infinity) is -Infinity +PASS Math.round(Infinity) is Infinity +PASS Math.round(99999999999999999999.99) is 100000000000000000000 +PASS Math.round(-99999999999999999999.99) is -100000000000000000000 +PASS Math.log(Math.E*Math.E) is 2 +PASS isNaN(Math.log(NaN)) is true +PASS isNaN(Math.log(-1)) is true +PASS isFinite(Math.log(0)) is false +PASS Math.log(1) is 0 +PASS isFinite(Math.log(Infinity)) is false +PASS isNegativeZero(Math.min(negativeZero, 0)) is true +PASS isFinite(Math.max()) is false +PASS Math.max(1) is 1 +PASS Math.max(1, 2, 3) is 3 +PASS isNaN(Math.max(1,NaN,3)) is true +PASS !isNegativeZero(Math.max(negativeZero, 0)) is true +PASS list is '' +PASS delete my.v is true +PASS my.v is undefined. +PASS delete Math.PI is false +PASS my = myfunc, myfunc(4) is 5 +PASS Boolean(Math) is true +PASS isNaN(Number(Math)); is true +PASS Math.abs===Math.abs is true +PASS Math.abs===Math.round is false +PASS list is 'a,b,' +PASS list is '' +PASS list is 'myprop,' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/math.js b/deps/v8/test/webkit/fast/js/kde/math.js new file mode 100644 index 0000000000..3cbb1b285a --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/math.js @@ -0,0 +1,131 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var negativeZero = Math.atan2(-1, Infinity); // ### any nicer way? + +function isNegativeZero(n) +{ + return n == 0 && 1 / n < 0; +} + +// self tests +shouldBeTrue("isNegativeZero(negativeZero)"); +shouldBeFalse("isNegativeZero(0)"); + +// Constants +shouldBe("String()+Math.E", "'2.718281828459045'"); +shouldBe("String()+Math.LN2", "'0.6931471805599453'"); +shouldBe("String()+Math.LN10", "'2.302585092994046'"); +shouldBe("String()+Math.LOG2E", "'1.4426950408889634'"); +shouldBe("String()+Math.LOG10E", "'0.4342944819032518'"); +shouldBe("String()+Math.PI", "'3.141592653589793'"); +shouldBe("String()+Math.SQRT1_2", "'0.7071067811865476'"); +shouldBe("String()+Math.SQRT2", "'1.4142135623730951'"); + +shouldBe("String()+Number.NaN", "'NaN'"); +shouldBe("String()+Number.NEGATIVE_INFINITY", "'-Infinity'"); +shouldBe("String()+Number.POSITIVE_INFINITY", "'Infinity'"); + +// Functions +shouldBe("Math.abs(-5)", "5"); +shouldBe("Math.acos(0)", "Math.PI/2"); +shouldBe("Math.acos(1)", "0"); +shouldBe("Math.ceil(1.1)", "2"); +shouldBe("String()+Math.sqrt(2)", "String()+Math.SQRT2"); +shouldBe("Math.ceil(1.6)", "2"); +shouldBe("Math.round(0)", "0"); +shouldBeFalse("isNegativeZero(Math.round(0))"); +shouldBeTrue("isNegativeZero(Math.round(negativeZero))"); +shouldBe("Math.round(0.2)", "0"); +shouldBeTrue("isNegativeZero(Math.round(-0.2))"); +shouldBeTrue("isNegativeZero(Math.round(-0.5))"); +shouldBe("Math.round(1.1)", "1"); +shouldBe("Math.round(1.6)", "2"); +shouldBe("Math.round(-3.5)", "-3"); +shouldBe("Math.round(-3.6)", "-4"); +shouldBeTrue("isNaN(Math.round())"); +shouldBeTrue("isNaN(Math.round(NaN))"); +shouldBe("Math.round(-Infinity)", "-Infinity"); +shouldBe("Math.round(Infinity)", "Infinity"); +shouldBe("Math.round(99999999999999999999.99)", "100000000000000000000"); +shouldBe("Math.round(-99999999999999999999.99)", "-100000000000000000000"); + +// Math.log() +shouldBe("Math.log(Math.E*Math.E)", "2"); +shouldBeTrue("isNaN(Math.log(NaN))"); +shouldBeTrue("isNaN(Math.log(-1))"); +shouldBeFalse("isFinite(Math.log(0))"); +shouldBe("Math.log(1)", "0"); +shouldBeFalse("isFinite(Math.log(Infinity))"); + +// Math.min() +shouldBeTrue("isNegativeZero(Math.min(negativeZero, 0))"); + +// Math.max() +shouldBeFalse("isFinite(Math.max())"); +shouldBe("Math.max(1)", "1"); // NS 4.x and IE 5.x seem to know about 2 arg version only +shouldBe("Math.max(1, 2, 3)", "3"); // NS 4.x and IE 5.x seem to know about 2 arg version only +shouldBeTrue("isNaN(Math.max(1,NaN,3))"); +shouldBeTrue("!isNegativeZero(Math.max(negativeZero, 0))"); + + +list="" +for ( var i in Math ) { list += i + ','; } +shouldBe("list","''"); + +var my = new Object; +my.v = 1; + +// Deleting/assigning +shouldBe("delete my.v", "true") +shouldBeUndefined("my.v"); +shouldBe("delete Math.PI", "false") +function myfunc( num ) { return num+1; } +shouldBe("my = myfunc, myfunc(4)", "5"); + +// Conversions +shouldBe("Boolean(Math)", "true"); +shouldBeTrue("isNaN(Number(Math));"); + +// Unicity +shouldBe("Math.abs===Math.abs", "true") +shouldBe("Math.abs===Math.round", "false") + +// Iteration +obj = new Object; +obj.a = 1; +obj.b = 2; +list="" +for ( var i in obj ) { list += i + ','; } +shouldBe("list","'a,b,'"); + +// (check that Math's properties and functions are not enumerable) +list="" +for ( var i in Math ) { list += i + ','; } +shouldBe("list","''"); + +Math.myprop=true; // adding a custom property to the math object (why not?) +list="" +for ( var i in Math ) { list += i + ','; } +shouldBe("list","'myprop,'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/md5-1-expected.txt b/deps/v8/test/webkit/fast/js/kde/md5-1-expected.txt new file mode 100644 index 0000000000..56a0b36449 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/md5-1-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS MD5('kde') is '186cf28b76f2264e9fea8fcf91cb4f5d' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/md5-1.js b/deps/v8/test/webkit/fast/js/kde/md5-1.js new file mode 100644 index 0000000000..9c20c550cb --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/md5-1.js @@ -0,0 +1,413 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// shouldBe() (base.js) test at very end of this file (Harri) + +/* +* md5.jvs 1.0b 27/06/96 +* +* Javascript implementation of the RSA Data Security, Inc. MD5 +* Message-Digest Algorithm. +* +* Copyright (c) 1996 Henri Torgemane. All Rights Reserved. +* +* Permission to use, copy, modify, and distribute this software +* and its documentation for any purposes and without +* fee is hereby granted provided that this copyright notice +* appears in all copies. +* +* Of course, this soft is provided "as is" without express or implied +* warranty of any kind. + +*/ + +// $Id: md5-1.js 11771 2005-12-26 23:07:31Z mjs $ + +function array(n) { + for(i=0;i<n;i++) this[i]=0; + this.length=n; +} + +/* Some basic logical functions had to be rewritten because of a bug in +* Javascript.. Just try to compute 0xffffffff >> 4 with it.. +* Of course, these functions are slower than the original would be, but +* at least, they work! +*/ + +function integer(n) { return n%(0xffffffff+1); } + +function shr(a,b) { + a=integer(a); + b=integer(b); + if (a-0x80000000>=0) { + Â Â Â Â Â Â Â a=a%0x80000000; + Â Â Â Â Â Â Â a>>=b; + Â Â Â Â Â Â Â a+=0x40000000>>(b-1); + } else + Â Â Â Â Â Â Â a>>=b; + return a; +} + +function shl1(a) { + a=a%0x80000000; + if (a&0x40000000==0x40000000) + Â Â Â Â Â Â Â { + Â Â Â Â Â Â Â a-=0x40000000; + Â Â Â Â Â Â Â a*=2; + Â Â Â Â Â Â Â a+=0x80000000; + Â Â Â Â Â Â Â } else + Â Â Â Â Â Â Â a*=2; + return a; +} + +function shl(a,b) { + a=integer(a); + b=integer(b); + for (var i=0;i<b;i++) a=shl1(a); + return a; +} + +function and(a,b) { + a=integer(a); + b=integer(b); + var t1=(a-0x80000000); + var t2=(b-0x80000000); + if (t1>=0) + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return ((t1&t2)+0x80000000); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return (t1&b); + else + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return (a&t2); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return (a&b); +} + +function or(a,b) { + a=integer(a); + b=integer(b); + var t1=(a-0x80000000); + var t2=(b-0x80000000); + if (t1>=0) + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return ((t1|t2)+0x80000000); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return ((t1|b)+0x80000000); + else + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return ((a|t2)+0x80000000); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return (a|b); +} + +function xor(a,b) { + a=integer(a); + b=integer(b); + var t1=(a-0x80000000); + var t2=(b-0x80000000); + if (t1>=0) + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return (t1^t2); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return ((t1^b)+0x80000000); + else + Â Â Â Â Â Â Â if (t2>=0) + Â Â Â Â Â Â Â return ((a^t2)+0x80000000); + Â Â Â Â Â Â Â else + Â Â Â Â Â Â Â return (a^b); +} + + +function not(a) { + a=integer(a); + return (0xffffffff-a); +} + +/* Here begin the real algorithm */ + +var state = new array(4); +var count = new array(2); +count[0] = 0; +count[1] = 0; + +var buffer = new array(64); +var transformBuffer = new array(16); +var digestBits = new array(16); + +var S11 = 7; +var S12 = 12; +var S13 = 17; +var S14 = 22; +var S21 = 5; +var S22 = 9; +var S23 = 14; +var S24 = 20; +var S31 = 4; +var S32 = 11; +var S33 = 16; +var S34 = 23; +var S41 = 6; +var S42 = 10; +var S43 = 15; +var S44 = 21; + + +function F(x,y,z) { + return or(and(x,y),and(not(x),z)); +} + +function G(x,y,z) { + return or(and(x,z),and(y,not(z))); +} + +function H(x,y,z) { + return xor(xor(x,y),z); +} + +function I(x,y,z) { + return xor(y ,or(x , not(z))); +} + +function rotateLeft(a,n) { + return or(shl(a, n),(shr(a,(32 - n)))); +} + +function FF(a,b,c,d,x,s,ac) { + a = a+F(b, c, d) + x + ac; + a = rotateLeft(a, s); + a = a+b; + return a; +} + +function GG(a,b,c,d,x,s,ac) { + a = a+G(b, c, d) +x + ac; + a = rotateLeft(a, s); + a = a+b; + return a; +} + +function HH(a,b,c,d,x,s,ac) { + a = a+H(b, c, d) + x + ac; + a = rotateLeft(a, s); + a = a+b; + return a; +} + +function II(a,b,c,d,x,s,ac) { + a = a+I(b, c, d) + x + ac; + a = rotateLeft(a, s); + a = a+b; + return a; +} + +function transform(buf,offset) { + var a=0, b=0, c=0, d=0; + var x = transformBuffer; + + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + + for (i = 0; i < 16; i++) { + Â Â Â Â Â Â Â x[i] = and(buf[i*4+offset],0xff); + Â Â Â Â Â Â Â for (j = 1; j < 4; j++) { + Â Â Â Â Â Â Â x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8); + Â Â Â Â Â Â Â } + } + + /* Round 1 */ + a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ + a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + d = GG ( d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ + a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + b = HH ( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ + a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] +=a; + state[1] +=b; + state[2] +=c; + state[3] +=d; +} + +function init() { + count[0]=count[1] = 0; + state[0] = 0x67452301; + state[1] = 0xefcdab89; + state[2] = 0x98badcfe; + state[3] = 0x10325476; + for (i = 0; i < digestBits.length; i++) + Â Â Â Â Â Â Â digestBits[i] = 0; +} + +function update(b) { + var index,i; + + index = and(shr(count[0],3) , 0x3f); + if (count[0]<0xffffffff-7) + Â Â Â Â Â Â Â count[0] += 8; + else { + Â Â Â Â Â Â Â count[1]++; + Â Â Â Â Â Â Â count[0]-=0xffffffff+1; + Â Â Â Â Â Â Â count[0]+=8; + } + + buffer[index] = and(b,0xff); + if (index >= 63) { + Â Â Â Â Â Â Â transform(buffer, 0); + } +} + +function finish() { + var bits = new array(8); + var padding; + var i=0, index=0, padLen=0; + + for (i = 0; i < 4; i++) { + Â Â Â Â Â Â Â bits[i] = and(shr(count[0],(i * 8)), 0xff); + } + + for (i = 0; i < 4; i++) { + Â Â Â Â Â Â Â bits[i+4]=and(shr(count[1],(i * 8)), 0xff); + } + + index = and(shr(count[0], 3) ,0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + padding = new array(64); + padding[0] = 0x80; + for (i=0;i<padLen;i++) + Â Â Â Â Â Â Â update(padding[i]); + + for (i=0;i<8;i++) + Â Â Â Â Â Â Â update(bits[i]); + + for (i = 0; i < 4; i++) { + Â Â Â Â Â Â Â for (j = 0; j < 4; j++) { + Â Â Â Â Â Â Â digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff); + Â Â Â Â Â Â Â } + } +} + +/* End of the MD5 algorithm */ + +function hexa(n) { + var hexa_h = "0123456789abcdef"; + var hexa_c=""; + var hexa_m=n; + for (hexa_i=0;hexa_i<8;hexa_i++) { + Â Â Â Â Â Â Â hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c; + Â Â Â Â Â Â Â hexa_m=Math.floor(hexa_m/16); + } + return hexa_c; +} + +var ascii="01234567890123456789012345678901" + +" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+ +"[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +function MD5(entree) +{ + var l,s,k,ka,kb,kc,kd; + + init(); + for (k=0;k<entree.length;k++) { + Â Â Â Â Â Â Â l=entree.charAt(k); + Â Â Â Â Â Â Â update(ascii.lastIndexOf(l)); + } + finish(); + ka=kb=kc=kd=0; + for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8)); + for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8)); + for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8)); + for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8)); + s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka); + return s; +} + +shouldBe("MD5('kde')", "'186cf28b76f2264e9fea8fcf91cb4f5d'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/md5-2-expected.txt b/deps/v8/test/webkit/fast/js/kde/md5-2-expected.txt new file mode 100644 index 0000000000..2c59605ca2 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/md5-2-expected.txt @@ -0,0 +1,33 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS hexMD5('kde') is '186cf28b76f2264e9fea8fcf91cb4f5d' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/md5-2.js b/deps/v8/test/webkit/fast/js/kde/md5-2.js new file mode 100644 index 0000000000..fa591704c8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/md5-2.js @@ -0,0 +1,243 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("hexMD5('kde')", "'186cf28b76f2264e9fea8fcf91cb4f5d'"); + +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002. + * Code also contributed by Greg Holt + * See http://pajhome.org.uk/site/legal.html for details. + */ + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF) + var msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xFFFF) +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)) +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function cmn(q, a, b, x, s, t) +{ + return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) +} +function ff(a, b, c, d, x, s, t) +{ + return cmn((b & c) | ((~b) & d), a, b, x, s, t) +} +function gg(a, b, c, d, x, s, t) +{ + return cmn((b & d) | (c & (~d)), a, b, x, s, t) +} +function hh(a, b, c, d, x, s, t) +{ + return cmn(b ^ c ^ d, a, b, x, s, t) +} +function ii(a, b, c, d, x, s, t) +{ + return cmn(c ^ (b | (~d)), a, b, x, s, t) +} + +/* + * Calculate the MD5 of an array of little-endian words, producing an array + * of little-endian words. + */ +function coreMD5(x) +{ + var a = 1732584193 + var b = -271733879 + var c = -1732584194 + var d = 271733878 + + for(i = 0; i < x.length; i += 16) + { + var olda = a + var oldb = b + var oldc = c + var oldd = d + + a = ff(a, b, c, d, x[i+ 0], 7 , -680876936) + d = ff(d, a, b, c, x[i+ 1], 12, -389564586) + c = ff(c, d, a, b, x[i+ 2], 17, 606105819) + b = ff(b, c, d, a, x[i+ 3], 22, -1044525330) + a = ff(a, b, c, d, x[i+ 4], 7 , -176418897) + d = ff(d, a, b, c, x[i+ 5], 12, 1200080426) + c = ff(c, d, a, b, x[i+ 6], 17, -1473231341) + b = ff(b, c, d, a, x[i+ 7], 22, -45705983) + a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416) + d = ff(d, a, b, c, x[i+ 9], 12, -1958414417) + c = ff(c, d, a, b, x[i+10], 17, -42063) + b = ff(b, c, d, a, x[i+11], 22, -1990404162) + a = ff(a, b, c, d, x[i+12], 7 , 1804603682) + d = ff(d, a, b, c, x[i+13], 12, -40341101) + c = ff(c, d, a, b, x[i+14], 17, -1502002290) + b = ff(b, c, d, a, x[i+15], 22, 1236535329) + + a = gg(a, b, c, d, x[i+ 1], 5 , -165796510) + d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632) + c = gg(c, d, a, b, x[i+11], 14, 643717713) + b = gg(b, c, d, a, x[i+ 0], 20, -373897302) + a = gg(a, b, c, d, x[i+ 5], 5 , -701558691) + d = gg(d, a, b, c, x[i+10], 9 , 38016083) + c = gg(c, d, a, b, x[i+15], 14, -660478335) + b = gg(b, c, d, a, x[i+ 4], 20, -405537848) + a = gg(a, b, c, d, x[i+ 9], 5 , 568446438) + d = gg(d, a, b, c, x[i+14], 9 , -1019803690) + c = gg(c, d, a, b, x[i+ 3], 14, -187363961) + b = gg(b, c, d, a, x[i+ 8], 20, 1163531501) + a = gg(a, b, c, d, x[i+13], 5 , -1444681467) + d = gg(d, a, b, c, x[i+ 2], 9 , -51403784) + c = gg(c, d, a, b, x[i+ 7], 14, 1735328473) + b = gg(b, c, d, a, x[i+12], 20, -1926607734) + + a = hh(a, b, c, d, x[i+ 5], 4 , -378558) + d = hh(d, a, b, c, x[i+ 8], 11, -2022574463) + c = hh(c, d, a, b, x[i+11], 16, 1839030562) + b = hh(b, c, d, a, x[i+14], 23, -35309556) + a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060) + d = hh(d, a, b, c, x[i+ 4], 11, 1272893353) + c = hh(c, d, a, b, x[i+ 7], 16, -155497632) + b = hh(b, c, d, a, x[i+10], 23, -1094730640) + a = hh(a, b, c, d, x[i+13], 4 , 681279174) + d = hh(d, a, b, c, x[i+ 0], 11, -358537222) + c = hh(c, d, a, b, x[i+ 3], 16, -722521979) + b = hh(b, c, d, a, x[i+ 6], 23, 76029189) + a = hh(a, b, c, d, x[i+ 9], 4 , -640364487) + d = hh(d, a, b, c, x[i+12], 11, -421815835) + c = hh(c, d, a, b, x[i+15], 16, 530742520) + b = hh(b, c, d, a, x[i+ 2], 23, -995338651) + + a = ii(a, b, c, d, x[i+ 0], 6 , -198630844) + d = ii(d, a, b, c, x[i+ 7], 10, 1126891415) + c = ii(c, d, a, b, x[i+14], 15, -1416354905) + b = ii(b, c, d, a, x[i+ 5], 21, -57434055) + a = ii(a, b, c, d, x[i+12], 6 , 1700485571) + d = ii(d, a, b, c, x[i+ 3], 10, -1894986606) + c = ii(c, d, a, b, x[i+10], 15, -1051523) + b = ii(b, c, d, a, x[i+ 1], 21, -2054922799) + a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359) + d = ii(d, a, b, c, x[i+15], 10, -30611744) + c = ii(c, d, a, b, x[i+ 6], 15, -1560198380) + b = ii(b, c, d, a, x[i+13], 21, 1309151649) + a = ii(a, b, c, d, x[i+ 4], 6 , -145523070) + d = ii(d, a, b, c, x[i+11], 10, -1120210379) + c = ii(c, d, a, b, x[i+ 2], 15, 718787259) + b = ii(b, c, d, a, x[i+ 9], 21, -343485551) + + a = safe_add(a, olda) + b = safe_add(b, oldb) + c = safe_add(c, oldc) + d = safe_add(d, oldd) + } + return [a, b, c, d] +} + +/* + * Convert an array of little-endian words to a hex string. + */ +function binl2hex(binarray) +{ + var hex_tab = "0123456789abcdef" + var str = "" + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8)) & 0xF) + } + return str +} + +/* + * Convert an array of little-endian words to a base64 encoded string. + */ +function binl2b64(binarray) +{ + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + var str = "" + for(var i = 0; i < binarray.length * 32; i += 6) + { + str += tab.charAt(((binarray[i>>5] << (i%32)) & 0x3F) | + ((binarray[i>>5+1] >> (32-i%32)) & 0x3F)) + } + return str +} + +/* + * Convert an 8-bit character string to a sequence of 16-word blocks, stored + * as an array, and append appropriate padding for MD4/5 calculation. + * If any of the characters are >255, the high byte is silently ignored. + */ +function str2binl(str) +{ + var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks + var blks = new Array(nblk * 16) + for(var i = 0; i < nblk * 16; i++) blks[i] = 0 + for(var i = 0; i < str.length; i++) + blks[i>>2] |= (str.charCodeAt(i) & 0xFF) << ((i%4) * 8) + blks[i>>2] |= 0x80 << ((i%4) * 8) + blks[nblk*16-2] = str.length * 8 + return blks +} + +/* + * Convert a wide-character string to a sequence of 16-word blocks, stored as + * an array, and append appropriate padding for MD4/5 calculation. + */ +function strw2binl(str) +{ + var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks + var blks = new Array(nblk * 16) + for(var i = 0; i < nblk * 16; i++) blks[i] = 0 + for(var i = 0; i < str.length; i++) + blks[i>>1] |= str.charCodeAt(i) << ((i%2) * 16) + blks[i>>1] |= 0x80 << ((i%2) * 16) + blks[nblk*16-2] = str.length * 16 + return blks +} + +/* + * External interface + */ +function hexMD5 (str) { return binl2hex(coreMD5( str2binl(str))) } +function hexMD5w(str) { return binl2hex(coreMD5(strw2binl(str))) } +function b64MD5 (str) { return binl2b64(coreMD5( str2binl(str))) } +function b64MD5w(str) { return binl2b64(coreMD5(strw2binl(str))) } +/* Backward compatibility */ +function calcMD5(str) { return binl2hex(coreMD5( str2binl(str))) }
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/object_prototype-expected.txt b/deps/v8/test/webkit/fast/js/kde/object_prototype-expected.txt new file mode 100644 index 0000000000..d3798457c8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/object_prototype-expected.txt @@ -0,0 +1,62 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS sub.x is 1 +PASS sub.y is 2 +PASS sub.hasOwnProperty('x') is false +PASS sub.hasOwnProperty('y') is true +PASS sub.x is 6 +PASS sub.hasOwnProperty('x') is true +PASS sub.y is undefined +PASS sub.hasOwnProperty('y') is false +PASS obj.hasClass1 is true +PASS obj.hasClass2 is true +PASS obj.hasClass3 is true +PASS Class1.prototype.isPrototypeOf(obj) is true +PASS Class2.prototype.isPrototypeOf(obj) is true +PASS Class3.prototype.isPrototypeOf(obj) is true +PASS obj.isPrototypeOf(Class1.prototype) is false +PASS obj.isPrototypeOf(Class2.prototype) is false +PASS obj.isPrototypeOf(Class3.prototype) is false +PASS Class1.prototype.isPrototypeOf(Class2.prototype) is true +PASS Class2.prototype.isPrototypeOf(Class1.prototype) is false +PASS Class1.prototype.isPrototypeOf(Class3.prototype) is true +PASS Class3.prototype.isPrototypeOf(Class1.prototype) is false +PASS Class2.prototype.isPrototypeOf(Class3.prototype) is true +PASS Class3.prototype.isPrototypeOf(Class2.prototype) is false +PASS Class1.prototype.prototype is undefined. +PASS myfunc.length is 3 +PASS myfunc.someproperty is 4 +PASS myfunc.propertyIsEnumerable('length') is false +PASS myfunc.propertyIsEnumerable('someproperty') is true +PASS checkEnumerable(myfunc,'length') is false +PASS checkEnumerable(myfunc,'someproperty') is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/object_prototype.js b/deps/v8/test/webkit/fast/js/kde/object_prototype.js new file mode 100644 index 0000000000..3b17cf6edc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/object_prototype.js @@ -0,0 +1,101 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// Object.prototype.hasOwnProperty + +function MyClass() +{ + this.y = 2; +} + +MyClass.prototype = { x : 1 }; + +var sub = new MyClass(); +shouldBe("sub.x","1"); +shouldBe("sub.y","2"); +shouldBe("sub.hasOwnProperty('x')","false"); +shouldBe("sub.hasOwnProperty('y')","true"); +sub.x = 6; +shouldBe("sub.x","6"); +shouldBe("sub.hasOwnProperty('x')","true"); +delete sub.y; +shouldBe("sub.y","undefined"); +shouldBe("sub.hasOwnProperty('y')","false"); + + + +// Object.prototype.isPrototypeOf + +function Class1() {} +function Class2() {} +function Class3() {} + +Class1.prototype = new Object(); +Class1.prototype.hasClass1 = true; +Class2.prototype = new Class1(); +Class2.prototype.hasClass2 = true; +Class3.prototype = new Class2(); +Class3.prototype.hasClass3 = true; + +var obj = new Class3(); +shouldBe("obj.hasClass1","true"); +shouldBe("obj.hasClass2","true"); +shouldBe("obj.hasClass3","true"); + +shouldBe("Class1.prototype.isPrototypeOf(obj)","true"); +shouldBe("Class2.prototype.isPrototypeOf(obj)","true"); +shouldBe("Class3.prototype.isPrototypeOf(obj)","true"); +shouldBe("obj.isPrototypeOf(Class1.prototype)","false"); +shouldBe("obj.isPrototypeOf(Class2.prototype)","false"); +shouldBe("obj.isPrototypeOf(Class3.prototype)","false"); + +shouldBe("Class1.prototype.isPrototypeOf(Class2.prototype)","true"); +shouldBe("Class2.prototype.isPrototypeOf(Class1.prototype)","false"); +shouldBe("Class1.prototype.isPrototypeOf(Class3.prototype)","true"); +shouldBe("Class3.prototype.isPrototypeOf(Class1.prototype)","false"); +shouldBe("Class2.prototype.isPrototypeOf(Class3.prototype)","true"); +shouldBe("Class3.prototype.isPrototypeOf(Class2.prototype)","false"); + +shouldBeUndefined("Class1.prototype.prototype"); + +function checkEnumerable(obj,property) +{ + for (var propname in obj) { + if (propname == property) + return true; + } + return false; +} + +function myfunc(a,b,c) +{ +} +myfunc.someproperty = 4; + +shouldBe("myfunc.length","3"); +shouldBe("myfunc.someproperty","4"); +shouldBe("myfunc.propertyIsEnumerable('length')","false"); +shouldBe("myfunc.propertyIsEnumerable('someproperty')","true"); +shouldBe("checkEnumerable(myfunc,'length')","false"); +shouldBe("checkEnumerable(myfunc,'someproperty')","true");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring-expected.txt b/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring-expected.txt new file mode 100644 index 0000000000..78639e70be --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS _array.toString() is "[object Array]" +PASS _string.toString() is "[object String]" +PASS _boolean.toString() is "[object Boolean]" +PASS _number.toString() is "[object Number]" +PASS _object.toString() is "[object Object]" +PASS _date.toString() is "[object Date]" +PASS _regexp.toString() is "[object RegExp]" +PASS _error.toString() is "[object Error]" +PASS _function.toString() is "[object Function]" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring.js b/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring.js new file mode 100644 index 0000000000..9814d8cea3 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/object_prototype_tostring.js @@ -0,0 +1,51 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var _array = new Array(1,2,3); +_array.toString = Object.prototype.toString; +shouldBe("_array.toString()","\"[object Array]\""); +var _string = new String("test"); +_string.toString = Object.prototype.toString; +shouldBe("_string.toString()","\"[object String]\""); +var _boolean = new Boolean(true); +_boolean.toString = Object.prototype.toString; +shouldBe("_boolean.toString()","\"[object Boolean]\""); +var _number = new Number(4); +_number.toString = Object.prototype.toString; +shouldBe("_number.toString()","\"[object Number]\""); +var _object = new Object(); +_object.toString = Object.prototype.toString; +shouldBe("_object.toString()","\"[object Object]\""); +var _date = new Date(); +_date.toString = Object.prototype.toString; +shouldBe("_date.toString()","\"[object Date]\""); +var _regexp = new RegExp(); +_regexp.toString = Object.prototype.toString; +shouldBe("_regexp.toString()","\"[object RegExp]\""); +var _error = new Error(); +_error.toString = Object.prototype.toString; +shouldBe("_error.toString()","\"[object Error]\""); +var _function = new Function(); +_function.toString = Object.prototype.toString; +shouldBe("_function.toString()","\"[object Function]\"");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/operators-expected.txt b/deps/v8/test/webkit/fast/js/kde/operators-expected.txt new file mode 100644 index 0000000000..def78c0643 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/operators-expected.txt @@ -0,0 +1,346 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS !undefined is true +PASS !null is true +PASS !!true is true +PASS !false is true +PASS !!1 is true +PASS !0 is true +PASS !!'a' is true +PASS !'' is true +PASS nonSpeculativeNot(undefined) is true +PASS nonSpeculativeNot(null) is true +PASS nonSpeculativeNot(!true) is true +PASS nonSpeculativeNot(false) is true +PASS nonSpeculativeNot(!1) is true +PASS nonSpeculativeNot(0) is true +PASS nonSpeculativeNot(!'a') is true +PASS nonSpeculativeNot('') is true +PASS +9 is 9 +PASS var i = 10; +i is 10 +PASS -11 is -11 +PASS var i = 12; -i is -12 +PASS var i = 0; ++i; is 1 +PASS var i = 0; ++i; i is 1 +PASS var i = 0; i++; is 0 +PASS var i = 0; i++; i is 1 +PASS var i = true; i++ is 1 +PASS var i = true; i++; i is 2 +PASS var i = 0; --i; is -1 +PASS var i = 0; --i; i is -1 +PASS var i = 0; i--; is 0 +PASS var i = 0; i--; i is -1 +PASS var i = true; i-- is 1 +PASS var i = true; i--; i is 0 +PASS ~0 is -1 +PASS ~1 is -2 +PASS ~NaN is -1 +PASS ~Infinity is -1 +PASS ~Math.pow(2, 33) is -1 +PASS ~(Math.pow(2, 32) + Math.pow(2, 31) + 2) is 2147483645 +PASS ~null is -1 +PASS 3 & 1 is 1 +PASS 2 | true is 3 +PASS '3' ^ 1 is 2 +PASS 3^4&5 is 7 +PASS 2|4^5 is 3 +PASS 1 << 2 is 4 +PASS 8 >> 1 is 4 +PASS 1 >> 2 is 0 +PASS -8 >> 24 is -1 +PASS 8 >>> 2 is 2 +PASS -8 >>> 24 is 255 +PASS (-2200000000 >> 1) << 1 is 2094967296 +PASS Infinity >> 1 is 0 +PASS Infinity << 1 is 0 +PASS Infinity >>> 1 is 0 +PASS NaN >> 1 is 0 +PASS NaN << 1 is 0 +PASS NaN >>> 1 is 0 +PASS 8.1 >> 1 is 4 +PASS 8.1 << 1 is 16 +PASS 8.1 >>> 1 is 4 +PASS 8.9 >> 1 is 4 +PASS 8.9 << 1 is 16 +PASS 8.9 >>> 1 is 4 +PASS Math.pow(2, 32) >> 1 is 0 +PASS Math.pow(2, 32) << 1 is 0 +PASS Math.pow(2, 32) >>> 1 is 0 +PASS 1 << two is 4 +PASS 8 >> one is 4 +PASS 1 >> two is 0 +PASS -8 >> twentyFour is -1 +PASS 8 >>> two is 2 +PASS -8 >>> twentyFour is 255 +PASS (-2200000000 >> one) << one is 2094967296 +PASS Infinity >> one is 0 +PASS Infinity << one is 0 +PASS Infinity >>> one is 0 +PASS NaN >> one is 0 +PASS NaN << one is 0 +PASS NaN >>> one is 0 +PASS 888.1 >> one is 444 +PASS 888.1 << one is 1776 +PASS 888.1 >>> one is 444 +PASS 888.9 >> one is 444 +PASS 888.9 << one is 1776 +PASS 888.9 >>> one is 444 +PASS Math.pow(2, 32) >> one is 0 +PASS Math.pow(2, 32) << one is 0 +PASS Math.pow(2, 32) >>> one is 0 +PASS 1+2 is 3 +PASS 'a'+'b' is 'ab' +PASS 'a'+2 is 'a2' +PASS '2'+'-1' is '2-1' +PASS true+'a' is 'truea' +PASS 'a' + null is 'anull' +PASS true+1 is 2 +PASS false+null is 0 +PASS 1-3 is -2 +PASS isNaN('a'-3) is true +PASS '3'-'-1' is 4 +PASS '4'-2 is 2 +PASS true-false is 1 +PASS false-1 is -1 +PASS null-true is -1 +PASS 2 * 3 is 6 +PASS true * 3 is 3 +PASS 2 * '3' is 6 +PASS 6 / 4 is 1.5 +PASS '6' / '2' is 3 +PASS isNaN('x' / 1) is true +PASS isNaN(1 / NaN) is true +PASS isNaN(Infinity / Infinity) is true +PASS Infinity / 0 is Infinity +PASS -Infinity / 0 is -Infinity +PASS Infinity / 1 is Infinity +PASS -Infinity / 1 is -Infinity +PASS 1 / Infinity == +0 is true +PASS 1 / -Infinity == -0 is true +PASS isNaN(0/0) is true +PASS 0 / 1 === 0 is true +PASS 0 / -1 === -0 is true +PASS 1 / 0 is Infinity +PASS -1 / 0 is -Infinity +PASS 6 % 4 is 2 +PASS '-6' % 4 is -2 +PASS 2==2 is true +PASS 1==2 is false +PASS nonSpeculativeEqual(2,2) is true +PASS nonSpeculativeEqual(1,2) is false +PASS 1<2 is true +PASS 1<=2 is true +PASS 2<1 is false +PASS 2<=1 is false +PASS nonSpeculativeLess(1,2) is true +PASS nonSpeculativeLessEq(1,2) is true +PASS nonSpeculativeLess(2,1) is false +PASS nonSpeculativeLessEq(2,1) is false +PASS 2>1 is true +PASS 2>=1 is true +PASS 1>=2 is false +PASS 1>2 is false +PASS nonSpeculativeGreater(2,1) is true +PASS nonSpeculativeGreaterEq(2,1) is true +PASS nonSpeculativeGreaterEq(1,2) is false +PASS nonSpeculativeGreater(1,2) is false +PASS 'abc' == 'abc' is true +PASS 'abc' != 'xyz' is true +PASS true == true is true +PASS false == false is true +PASS true != false is true +PASS 'a' != null is true +PASS 'a' != undefined is true +PASS null == null is true +PASS null == undefined is true +PASS undefined == undefined is true +PASS NaN != NaN is true +PASS true != undefined is true +PASS true != null is true +PASS false != undefined is true +PASS false != null is true +PASS '0' == 0 is true +PASS 1 == '1' is true +PASS NaN != NaN is true +PASS NaN != 0 is true +PASS NaN != undefined is true +PASS true == 1 is true +PASS true != 2 is true +PASS 1 == true is true +PASS false == 0 is true +PASS 0 == false is true +PASS nonSpeculativeEqual('abc', 'abc') is true +PASS nonSpeculativeNotEqual('abc', 'xyz') is true +PASS nonSpeculativeEqual(true, true) is true +PASS nonSpeculativeEqual(false, false) is true +PASS nonSpeculativeNotEqual(true, false) is true +PASS nonSpeculativeNotEqual('a', null) is true +PASS nonSpeculativeNotEqual('a', undefined) is true +PASS nonSpeculativeEqual(null, null) is true +PASS nonSpeculativeEqual(null, undefined) is true +PASS nonSpeculativeEqual(undefined, undefined) is true +PASS nonSpeculativeNotEqual(NaN, NaN) is true +PASS nonSpeculativeNotEqual(true, undefined) is true +PASS nonSpeculativeNotEqual(true, null) is true +PASS nonSpeculativeNotEqual(false, undefined) is true +PASS nonSpeculativeNotEqual(false, null) is true +PASS nonSpeculativeEqual('0', 0) is true +PASS nonSpeculativeEqual(1, '1') is true +PASS nonSpeculativeNotEqual(NaN, NaN) is true +PASS nonSpeculativeNotEqual(NaN, 0) is true +PASS nonSpeculativeNotEqual(NaN, undefined) is true +PASS nonSpeculativeEqual(true, 1) is true +PASS nonSpeculativeNotEqual(true, 2) is true +PASS nonSpeculativeEqual(1, true) is true +PASS nonSpeculativeEqual(false, 0) is true +PASS nonSpeculativeEqual(0, false) is true +PASS 'abc' < 'abx' is true +PASS 'abc' < 'abcd' is true +PASS 'abc' < 'abc' is false +PASS 'abcd' < 'abcd' is false +PASS 'abx' < 'abc' is false +PASS nonSpeculativeLess('abc', 'abx') is true +PASS nonSpeculativeLess('abc', 'abcd') is true +PASS nonSpeculativeLess('abc', 'abc') is false +PASS nonSpeculativeLess('abcd', 'abcd') is false +PASS nonSpeculativeLess('abx', 'abc') is false +PASS 'abc' <= 'abc' is true +PASS 'abc' <= 'abx' is true +PASS 'abx' <= 'abc' is false +PASS 'abcd' <= 'abc' is false +PASS 'abc' <= 'abcd' is true +PASS nonSpeculativeLessEq('abc', 'abc') is true +PASS nonSpeculativeLessEq('abc', 'abx') is true +PASS nonSpeculativeLessEq('abx', 'abc') is false +PASS nonSpeculativeLessEq('abcd', 'abc') is false +PASS nonSpeculativeLessEq('abc', 'abcd') is true +PASS 'abc' > 'abx' is false +PASS 'abc' > 'abc' is false +PASS 'abcd' > 'abc' is true +PASS 'abx' > 'abc' is true +PASS 'abc' > 'abcd' is false +PASS nonSpeculativeGreater('abc', 'abx') is false +PASS nonSpeculativeGreater('abc', 'abc') is false +PASS nonSpeculativeGreater('abcd', 'abc') is true +PASS nonSpeculativeGreater('abx', 'abc') is true +PASS nonSpeculativeGreater('abc', 'abcd') is false +PASS 'abc' >= 'abc' is true +PASS 'abcd' >= 'abc' is true +PASS 'abx' >= 'abc' is true +PASS 'abc' >= 'abx' is false +PASS 'abc' >= 'abx' is false +PASS 'abc' >= 'abcd' is false +PASS nonSpeculativeGreaterEq('abc', 'abc') is true +PASS nonSpeculativeGreaterEq('abcd', 'abc') is true +PASS nonSpeculativeGreaterEq('abx', 'abc') is true +PASS nonSpeculativeGreaterEq('abc', 'abx') is false +PASS nonSpeculativeGreaterEq('abc', 'abx') is false +PASS nonSpeculativeGreaterEq('abc', 'abcd') is false +PASS 'abc' <= 0 is false +PASS '' <= 0 is true +PASS ' ' <= 0 is true +PASS null <= 0 is true +PASS 0 <= 'abc' is false +PASS 0 <= '' is true +PASS 0 <= null is true +PASS null <= null is true +PASS 6 < '52' is true +PASS 6 < '72' is true +PASS NaN < 0 is false +PASS NaN <= 0 is false +PASS NaN > 0 is false +PASS NaN >= 0 is false +PASS nonSpeculativeLessEq('abc', 0) is false +PASS nonSpeculativeLessEq('', 0) is true +PASS nonSpeculativeLessEq(' ', 0) is true +PASS nonSpeculativeLessEq(null, 0) is true +PASS nonSpeculativeLessEq(0, 'abc') is false +PASS nonSpeculativeLessEq(0, '') is true +PASS nonSpeculativeLessEq(0, null) is true +PASS nonSpeculativeLessEq(null, null) is true +PASS nonSpeculativeLess(6, '52') is true +PASS nonSpeculativeLess(6, '72') is true +PASS nonSpeculativeLess(NaN, 0) is false +PASS nonSpeculativeLessEq(NaN, 0) is false +PASS nonSpeculativeGreater(NaN, 0) is false +PASS nonSpeculativeGreaterEq(NaN, 0) is false +PASS 0 === false is false +PASS null === null is true +PASS NaN === NaN is false +PASS 0.0 === 0 is true +PASS 'abc' === 'abc' is true +PASS 'a' === 'x' is false +PASS 1 === '1' is false +PASS '1' === 1 is false +PASS true === true is true +PASS false === false is true +PASS true === false is false +PASS Math === Math is true +PASS Math === Boolean is false +PASS Infinity === Infinity is true +PASS nonSpeculativeStrictEqual(0, false) is false +PASS nonSpeculativeStrictEqual(null, null) is true +PASS nonSpeculativeStrictEqual(NaN, NaN) is false +PASS nonSpeculativeStrictEqual(0.0, 0) is true +PASS nonSpeculativeStrictEqual('abc', 'abc') is true +PASS nonSpeculativeStrictEqual('a', 'x') is false +PASS nonSpeculativeStrictEqual(1, '1') is false +PASS nonSpeculativeStrictEqual('1', 1) is false +PASS nonSpeculativeStrictEqual(true, true) is true +PASS nonSpeculativeStrictEqual(false, false) is true +PASS nonSpeculativeStrictEqual(true, false) is false +PASS nonSpeculativeStrictEqual(Math, Math) is true +PASS nonSpeculativeStrictEqual(Math, Boolean) is false +PASS nonSpeculativeStrictEqual(Infinity, Infinity) is true +PASS 0 !== 0 is false +PASS 0 !== 1 is true +PASS nonSpeculativeStrictNotEqual(0, 0) is false +PASS nonSpeculativeStrictNotEqual(0, 1) is true +PASS typeof undefined is 'undefined' +PASS typeof null is 'object' +PASS typeof true is 'boolean' +PASS typeof false is 'boolean' +PASS typeof 1 is 'number' +PASS typeof 'a' is 'string' +PASS typeof shouldBe is 'function' +PASS typeof Number.NaN is 'number' +PASS 11 && 22 is 22 +PASS null && true is null +PASS 11 || 22 is 11 +PASS null || 'a' is 'a' +PASS void 1 is undefined. +PASS 1 in [1, 2] is true +PASS 3 in [1, 2] is false +PASS 'a' in { a:1, b:2 } is true +PASS (new Boolean()) instanceof Boolean is true +PASS (new Boolean()) instanceof Number is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/operators.js b/deps/v8/test/webkit/fast/js/kde/operators.js new file mode 100644 index 0000000000..185ae01eab --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/operators.js @@ -0,0 +1,504 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +function nonSpeculativeNotInner(argument, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return !argument; +} +function nonSpeculativeNot(argument) +{ + return nonSpeculativeNotInner(argument, {}, {}); +} + +function nonSpeculativeLessInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a < b; +} +function nonSpeculativeLess(a, b) +{ + return nonSpeculativeLessInner(a, b, {}, {}); +} + +function nonSpeculativeLessEqInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a <= b; +} +function nonSpeculativeLessEq(a, b) +{ + return nonSpeculativeLessEqInner(a, b, {}, {}); +} + +function nonSpeculativeGreaterInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a > b; +} +function nonSpeculativeGreater(a, b) +{ + return nonSpeculativeGreaterInner(a, b, {}, {}); +} + +function nonSpeculativeGreaterEqInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a >= b; +} +function nonSpeculativeGreaterEq(a, b) +{ + return nonSpeculativeGreaterEqInner(a, b, {}, {}); +} + +function nonSpeculativeEqualInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a == b; +} +function nonSpeculativeEqual(a, b) +{ + return nonSpeculativeEqualInner(a, b, {}, {}); +} + +function nonSpeculativeNotEqualInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a != b; +} +function nonSpeculativeNotEqual(a, b) +{ + return nonSpeculativeNotEqualInner(a, b, {}, {}); +} + +function nonSpeculativeStrictEqualInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a === b; +} +function nonSpeculativeStrictEqual(a, b) +{ + return nonSpeculativeStrictEqualInner(a, b, {}, {}); +} + +function nonSpeculativeStrictNotEqualInner(a, b, o1, o2) +{ + // The + operator on objects is a reliable way to avoid the speculative JIT path for now at least. + o1 + o2; + return a !== b; +} +function nonSpeculativeStrictNotEqual(a, b) +{ + return nonSpeculativeStrictNotEqualInner(a, b, {}, {}); +} + +// operator ! +shouldBeTrue("!undefined"); +shouldBeTrue("!null"); +shouldBeTrue("!!true"); +shouldBeTrue("!false"); +shouldBeTrue("!!1"); +shouldBeTrue("!0"); +shouldBeTrue("!!'a'"); +shouldBeTrue("!''"); + +shouldBeTrue("nonSpeculativeNot(undefined)"); +shouldBeTrue("nonSpeculativeNot(null)"); +shouldBeTrue("nonSpeculativeNot(!true)"); +shouldBeTrue("nonSpeculativeNot(false)"); +shouldBeTrue("nonSpeculativeNot(!1)"); +shouldBeTrue("nonSpeculativeNot(0)"); +shouldBeTrue("nonSpeculativeNot(!'a')"); +shouldBeTrue("nonSpeculativeNot('')"); + +// unary plus +shouldBe("+9", "9"); +shouldBe("var i = 10; +i", "10"); + +// negation +shouldBe("-11", "-11"); +shouldBe("var i = 12; -i", "-12"); + +// increment +shouldBe("var i = 0; ++i;", "1"); +shouldBe("var i = 0; ++i; i", "1"); +shouldBe("var i = 0; i++;", "0"); +shouldBe("var i = 0; i++; i", "1"); +shouldBe("var i = true; i++", "1"); +shouldBe("var i = true; i++; i", "2"); + +// decrement +shouldBe("var i = 0; --i;", "-1"); +shouldBe("var i = 0; --i; i", "-1"); +shouldBe("var i = 0; i--;", "0"); +shouldBe("var i = 0; i--; i", "-1"); +shouldBe("var i = true; i--", "1"); +shouldBe("var i = true; i--; i", "0"); + +// bitwise operators +shouldBe("~0", "-1"); +shouldBe("~1", "-2"); +shouldBe("~NaN", "-1"); +shouldBe("~Infinity", "-1"); +shouldBe("~Math.pow(2, 33)", "-1"); // 32 bit overflow +shouldBe("~(Math.pow(2, 32) + Math.pow(2, 31) + 2)", + "2147483645"); // a signedness issue +shouldBe("~null", "-1"); +shouldBe("3 & 1", "1"); +shouldBe("2 | true", "3"); +shouldBe("'3' ^ 1", "2"); +shouldBe("3^4&5", "7"); +shouldBe("2|4^5", "3"); + +shouldBe("1 << 2", "4"); +shouldBe("8 >> 1", "4"); +shouldBe("1 >> 2", "0"); +shouldBe("-8 >> 24", "-1"); +shouldBe("8 >>> 2", "2"); +shouldBe("-8 >>> 24", "255"); +shouldBe("(-2200000000 >> 1) << 1", "2094967296"); +shouldBe("Infinity >> 1", "0"); +shouldBe("Infinity << 1", "0"); +shouldBe("Infinity >>> 1", "0"); +shouldBe("NaN >> 1", "0"); +shouldBe("NaN << 1", "0"); +shouldBe("NaN >>> 1", "0"); +shouldBe("8.1 >> 1", "4"); +shouldBe("8.1 << 1", "16"); +shouldBe("8.1 >>> 1", "4"); +shouldBe("8.9 >> 1", "4"); +shouldBe("8.9 << 1", "16"); +shouldBe("8.9 >>> 1", "4"); +shouldBe("Math.pow(2, 32) >> 1", "0"); +shouldBe("Math.pow(2, 32) << 1", "0"); +shouldBe("Math.pow(2, 32) >>> 1", "0"); + +// Try shifting by variables, to test non-constant-folded cases. +var one = 1; +var two = 2; +var twentyFour = 24; + +shouldBe("1 << two", "4"); +shouldBe("8 >> one", "4"); +shouldBe("1 >> two", "0"); +shouldBe("-8 >> twentyFour", "-1"); +shouldBe("8 >>> two", "2"); +shouldBe("-8 >>> twentyFour", "255"); +shouldBe("(-2200000000 >> one) << one", "2094967296"); +shouldBe("Infinity >> one", "0"); +shouldBe("Infinity << one", "0"); +shouldBe("Infinity >>> one", "0"); +shouldBe("NaN >> one", "0"); +shouldBe("NaN << one", "0"); +shouldBe("NaN >>> one", "0"); +shouldBe("888.1 >> one", "444"); +shouldBe("888.1 << one", "1776"); +shouldBe("888.1 >>> one", "444"); +shouldBe("888.9 >> one", "444"); +shouldBe("888.9 << one", "1776"); +shouldBe("888.9 >>> one", "444"); +shouldBe("Math.pow(2, 32) >> one", "0"); +shouldBe("Math.pow(2, 32) << one", "0"); +shouldBe("Math.pow(2, 32) >>> one", "0"); + +// addition +shouldBe("1+2", "3"); +shouldBe("'a'+'b'", "'ab'"); +shouldBe("'a'+2", "'a2'"); +shouldBe("'2'+'-1'", "'2-1'"); +shouldBe("true+'a'", "'truea'"); +shouldBe("'a' + null", "'anull'"); +shouldBe("true+1", "2"); +shouldBe("false+null", "0"); + +// substraction +shouldBe("1-3", "-2"); +shouldBe("isNaN('a'-3)", "true"); +shouldBe("'3'-'-1'", "4"); +shouldBe("'4'-2", "2"); +shouldBe("true-false", "1"); +shouldBe("false-1", "-1"); +shouldBe("null-true", "-1"); + +// multiplication +shouldBe("2 * 3", "6"); +shouldBe("true * 3", "3"); +shouldBe("2 * '3'", "6"); + +// division +shouldBe("6 / 4", "1.5"); +//shouldBe("true / false", "Inf"); +shouldBe("'6' / '2'", "3"); +shouldBeTrue("isNaN('x' / 1)"); +shouldBeTrue("isNaN(1 / NaN)"); +shouldBeTrue("isNaN(Infinity / Infinity)"); +shouldBe("Infinity / 0", "Infinity"); +shouldBe("-Infinity / 0", "-Infinity"); +shouldBe("Infinity / 1", "Infinity"); +shouldBe("-Infinity / 1", "-Infinity"); +shouldBeTrue("1 / Infinity == +0"); +shouldBeTrue("1 / -Infinity == -0"); // how to check ? +shouldBeTrue("isNaN(0/0)"); +shouldBeTrue("0 / 1 === 0"); +shouldBeTrue("0 / -1 === -0"); // how to check ? +shouldBe("1 / 0", "Infinity"); +shouldBe("-1 / 0", "-Infinity"); + +// modulo +shouldBe("6 % 4", "2"); +shouldBe("'-6' % 4", "-2"); + +shouldBe("2==2", "true"); +shouldBe("1==2", "false"); + +shouldBe("nonSpeculativeEqual(2,2)", "true"); +shouldBe("nonSpeculativeEqual(1,2)", "false"); + +shouldBe("1<2", "true"); +shouldBe("1<=2", "true"); +shouldBe("2<1", "false"); +shouldBe("2<=1", "false"); + +shouldBe("nonSpeculativeLess(1,2)", "true"); +shouldBe("nonSpeculativeLessEq(1,2)", "true"); +shouldBe("nonSpeculativeLess(2,1)", "false"); +shouldBe("nonSpeculativeLessEq(2,1)", "false"); + +shouldBe("2>1", "true"); +shouldBe("2>=1", "true"); +shouldBe("1>=2", "false"); +shouldBe("1>2", "false"); + +shouldBe("nonSpeculativeGreater(2,1)", "true"); +shouldBe("nonSpeculativeGreaterEq(2,1)", "true"); +shouldBe("nonSpeculativeGreaterEq(1,2)", "false"); +shouldBe("nonSpeculativeGreater(1,2)", "false"); + +shouldBeTrue("'abc' == 'abc'"); +shouldBeTrue("'abc' != 'xyz'"); +shouldBeTrue("true == true"); +shouldBeTrue("false == false"); +shouldBeTrue("true != false"); +shouldBeTrue("'a' != null"); +shouldBeTrue("'a' != undefined"); +shouldBeTrue("null == null"); +shouldBeTrue("null == undefined"); +shouldBeTrue("undefined == undefined"); +shouldBeTrue("NaN != NaN"); +shouldBeTrue("true != undefined"); +shouldBeTrue("true != null"); +shouldBeTrue("false != undefined"); +shouldBeTrue("false != null"); +shouldBeTrue("'0' == 0"); +shouldBeTrue("1 == '1'"); +shouldBeTrue("NaN != NaN"); +shouldBeTrue("NaN != 0"); +shouldBeTrue("NaN != undefined"); +shouldBeTrue("true == 1"); +shouldBeTrue("true != 2"); +shouldBeTrue("1 == true"); +shouldBeTrue("false == 0"); +shouldBeTrue("0 == false"); + +shouldBeTrue("nonSpeculativeEqual('abc', 'abc')"); +shouldBeTrue("nonSpeculativeNotEqual('abc', 'xyz')"); +shouldBeTrue("nonSpeculativeEqual(true, true)"); +shouldBeTrue("nonSpeculativeEqual(false, false)"); +shouldBeTrue("nonSpeculativeNotEqual(true, false)"); +shouldBeTrue("nonSpeculativeNotEqual('a', null)"); +shouldBeTrue("nonSpeculativeNotEqual('a', undefined)"); +shouldBeTrue("nonSpeculativeEqual(null, null)"); +shouldBeTrue("nonSpeculativeEqual(null, undefined)"); +shouldBeTrue("nonSpeculativeEqual(undefined, undefined)"); +shouldBeTrue("nonSpeculativeNotEqual(NaN, NaN)"); +shouldBeTrue("nonSpeculativeNotEqual(true, undefined)"); +shouldBeTrue("nonSpeculativeNotEqual(true, null)"); +shouldBeTrue("nonSpeculativeNotEqual(false, undefined)"); +shouldBeTrue("nonSpeculativeNotEqual(false, null)"); +shouldBeTrue("nonSpeculativeEqual('0', 0)"); +shouldBeTrue("nonSpeculativeEqual(1, '1')"); +shouldBeTrue("nonSpeculativeNotEqual(NaN, NaN)"); +shouldBeTrue("nonSpeculativeNotEqual(NaN, 0)"); +shouldBeTrue("nonSpeculativeNotEqual(NaN, undefined)"); +shouldBeTrue("nonSpeculativeEqual(true, 1)"); +shouldBeTrue("nonSpeculativeNotEqual(true, 2)"); +shouldBeTrue("nonSpeculativeEqual(1, true)"); +shouldBeTrue("nonSpeculativeEqual(false, 0)"); +shouldBeTrue("nonSpeculativeEqual(0, false)"); + +shouldBe("'abc' < 'abx'", "true"); +shouldBe("'abc' < 'abcd'", "true"); +shouldBe("'abc' < 'abc'", "false"); +shouldBe("'abcd' < 'abcd'", "false"); +shouldBe("'abx' < 'abc'", "false"); + +shouldBe("nonSpeculativeLess('abc', 'abx')", "true"); +shouldBe("nonSpeculativeLess('abc', 'abcd')", "true"); +shouldBe("nonSpeculativeLess('abc', 'abc')", "false"); +shouldBe("nonSpeculativeLess('abcd', 'abcd')", "false"); +shouldBe("nonSpeculativeLess('abx', 'abc')", "false"); + +shouldBe("'abc' <= 'abc'", "true"); +shouldBe("'abc' <= 'abx'", "true"); +shouldBe("'abx' <= 'abc'", "false"); +shouldBe("'abcd' <= 'abc'", "false"); +shouldBe("'abc' <= 'abcd'", "true"); + +shouldBe("nonSpeculativeLessEq('abc', 'abc')", "true"); +shouldBe("nonSpeculativeLessEq('abc', 'abx')", "true"); +shouldBe("nonSpeculativeLessEq('abx', 'abc')", "false"); +shouldBe("nonSpeculativeLessEq('abcd', 'abc')", "false"); +shouldBe("nonSpeculativeLessEq('abc', 'abcd')", "true"); + +shouldBe("'abc' > 'abx'", "false"); +shouldBe("'abc' > 'abc'", "false"); +shouldBe("'abcd' > 'abc'", "true"); +shouldBe("'abx' > 'abc'", "true"); +shouldBe("'abc' > 'abcd'", "false"); + +shouldBe("nonSpeculativeGreater('abc', 'abx')", "false"); +shouldBe("nonSpeculativeGreater('abc', 'abc')", "false"); +shouldBe("nonSpeculativeGreater('abcd', 'abc')", "true"); +shouldBe("nonSpeculativeGreater('abx', 'abc')", "true"); +shouldBe("nonSpeculativeGreater('abc', 'abcd')", "false"); + +shouldBe("'abc' >= 'abc'", "true"); +shouldBe("'abcd' >= 'abc'", "true"); +shouldBe("'abx' >= 'abc'", "true"); +shouldBe("'abc' >= 'abx'", "false"); +shouldBe("'abc' >= 'abx'", "false"); +shouldBe("'abc' >= 'abcd'", "false"); + +shouldBe("nonSpeculativeGreaterEq('abc', 'abc')", "true"); +shouldBe("nonSpeculativeGreaterEq('abcd', 'abc')", "true"); +shouldBe("nonSpeculativeGreaterEq('abx', 'abc')", "true"); +shouldBe("nonSpeculativeGreaterEq('abc', 'abx')", "false"); +shouldBe("nonSpeculativeGreaterEq('abc', 'abx')", "false"); +shouldBe("nonSpeculativeGreaterEq('abc', 'abcd')", "false"); + +// mixed strings and numbers - results validated in NS+moz+IE5 +shouldBeFalse("'abc' <= 0"); // #35246 +shouldBeTrue("'' <= 0"); +shouldBeTrue("' ' <= 0"); +shouldBeTrue("null <= 0"); +shouldBeFalse("0 <= 'abc'"); +shouldBeTrue("0 <= ''"); +shouldBeTrue("0 <= null"); +shouldBeTrue("null <= null"); +shouldBeTrue("6 < '52'"); +shouldBeTrue("6 < '72'"); // #36087 +shouldBeFalse("NaN < 0"); +shouldBeFalse("NaN <= 0"); +shouldBeFalse("NaN > 0"); +shouldBeFalse("NaN >= 0"); + +shouldBeFalse("nonSpeculativeLessEq('abc', 0)"); // #35246 +shouldBeTrue("nonSpeculativeLessEq('', 0)"); +shouldBeTrue("nonSpeculativeLessEq(' ', 0)"); +shouldBeTrue("nonSpeculativeLessEq(null, 0)"); +shouldBeFalse("nonSpeculativeLessEq(0, 'abc')"); +shouldBeTrue("nonSpeculativeLessEq(0, '')"); +shouldBeTrue("nonSpeculativeLessEq(0, null)"); +shouldBeTrue("nonSpeculativeLessEq(null, null)"); +shouldBeTrue("nonSpeculativeLess(6, '52')"); +shouldBeTrue("nonSpeculativeLess(6, '72')"); // #36087 +shouldBeFalse("nonSpeculativeLess(NaN, 0)"); +shouldBeFalse("nonSpeculativeLessEq(NaN, 0)"); +shouldBeFalse("nonSpeculativeGreater(NaN, 0)"); +shouldBeFalse("nonSpeculativeGreaterEq(NaN, 0)"); + +// strict comparison === +shouldBeFalse("0 === false"); +//shouldBe("undefined === undefined", "true"); // aborts in IE5 (undefined is not defined ;) +shouldBeTrue("null === null"); +shouldBeFalse("NaN === NaN"); +shouldBeTrue("0.0 === 0"); +shouldBeTrue("'abc' === 'abc'"); +shouldBeFalse("'a' === 'x'"); +shouldBeFalse("1 === '1'"); +shouldBeFalse("'1' === 1"); +shouldBeTrue("true === true"); +shouldBeTrue("false === false"); +shouldBeFalse("true === false"); +shouldBeTrue("Math === Math"); +shouldBeFalse("Math === Boolean"); +shouldBeTrue("Infinity === Infinity"); + +// strict comparison === +shouldBeFalse("nonSpeculativeStrictEqual(0, false)"); +//shouldBe("undefined === undefined", "true"); // aborts in IE5 (undefined is not defined ;) +shouldBeTrue("nonSpeculativeStrictEqual(null, null)"); +shouldBeFalse("nonSpeculativeStrictEqual(NaN, NaN)"); +shouldBeTrue("nonSpeculativeStrictEqual(0.0, 0)"); +shouldBeTrue("nonSpeculativeStrictEqual('abc', 'abc')"); +shouldBeFalse("nonSpeculativeStrictEqual('a', 'x')"); +shouldBeFalse("nonSpeculativeStrictEqual(1, '1')"); +shouldBeFalse("nonSpeculativeStrictEqual('1', 1)"); +shouldBeTrue("nonSpeculativeStrictEqual(true, true)"); +shouldBeTrue("nonSpeculativeStrictEqual(false, false)"); +shouldBeFalse("nonSpeculativeStrictEqual(true, false)"); +shouldBeTrue("nonSpeculativeStrictEqual(Math, Math)"); +shouldBeFalse("nonSpeculativeStrictEqual(Math, Boolean)"); +shouldBeTrue("nonSpeculativeStrictEqual(Infinity, Infinity)"); + +// !== +shouldBe("0 !== 0", "false"); +shouldBe("0 !== 1", "true"); + +// !== +shouldBe("nonSpeculativeStrictNotEqual(0, 0)", "false"); +shouldBe("nonSpeculativeStrictNotEqual(0, 1)", "true"); + +shouldBe("typeof undefined", "'undefined'"); +shouldBe("typeof null", "'object'"); +shouldBe("typeof true", "'boolean'"); +shouldBe("typeof false", "'boolean'"); +shouldBe("typeof 1", "'number'"); +shouldBe("typeof 'a'", "'string'"); +shouldBe("typeof shouldBe", "'function'"); +shouldBe("typeof Number.NaN", "'number'"); + +shouldBe("11 && 22", "22"); +shouldBe("null && true", "null"); +shouldBe("11 || 22", "11"); +shouldBe("null || 'a'", "'a'"); + +shouldBeUndefined("void 1"); + +shouldBeTrue("1 in [1, 2]"); +shouldBeFalse("3 in [1, 2]"); +shouldBeTrue("'a' in { a:1, b:2 }"); + +// instanceof +// Those 2 lines don't parse in Netscape... +shouldBe("(new Boolean()) instanceof Boolean", "true"); +shouldBe("(new Boolean()) instanceof Number", "false");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/parse-expected.txt b/deps/v8/test/webkit/fast/js/kde/parse-expected.txt new file mode 100644 index 0000000000..5caefd1ef0 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/parse-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS function test() { return;}; lab: 1 is 1 +PASS function test() { while(0) break; } lab: 1 is 1 +PASS function test() { while(0) continue; } lab: 1 is 1 +PASS function test() { return lab;} lab: 1 is 1 +PASS function test() { while(0) break lab; } lab: 1 threw exception SyntaxError: Undefined label 'lab'. +PASS function test() { while(0) continue lab; } lab: 1 threw exception SyntaxError: Undefined label 'lab'. +PASS function test() { return } lab: 1 is 1 +PASS function test() { while(0) break } lab: 1 is 1 +PASS function test() { while(0) continue } lab: 1 is 1 +PASS function test() { return 0 } lab: 1 is 1 +PASS function test() { while(0) break lab } lab: 1 threw exception SyntaxError: Undefined label 'lab'. +PASS function test() { while(0) continue lab } lab: 1 threw exception SyntaxError: Undefined label 'lab'. +PASS var éĀʯΈᢨ = 101; éĀʯΈᢨ; is 101 +PASS var f÷; threw exception SyntaxError: Unexpected token ILLEGAL. +PASS var \u0061 = 102; a is 102 +PASS var f\u0030 = 103; f0 is 103 +PASS var \u00E9\u0100\u02AF\u0388\u18A8 = 104; \u00E9\u0100\u02AF\u0388\u18A8; is 104 +PASS var f\u00F7; threw exception SyntaxError: Unexpected token ILLEGAL. +PASS var \u0030; threw exception SyntaxError: Unexpected token ILLEGAL. +PASS var test = { }; test.i= 0; test.i\u002b= 1; test.i; threw exception SyntaxError: Unexpected token ILLEGAL. +PASS var test = { }; test.i= 0; test.i+= 1; test.i; is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/parse.js b/deps/v8/test/webkit/fast/js/kde/parse.js new file mode 100644 index 0000000000..ca85e7637c --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/parse.js @@ -0,0 +1,66 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +// Check parsing of nested scopes; a couple of the break/continue to label cases are invalid. +shouldBe("function test() { return;}; lab: 1", "1"); +shouldBe("function test() { while(0) break; } lab: 1", "1"); +shouldBe("function test() { while(0) continue; } lab: 1", "1"); + +shouldBe("function test() { return lab;} lab: 1", "1"); +shouldThrow("function test() { while(0) break lab; } lab: 1"); +shouldThrow("function test() { while(0) continue lab; } lab: 1"); + +shouldBe("function test() { return } lab: 1", "1"); +shouldBe("function test() { while(0) break } lab: 1", "1"); +shouldBe("function test() { while(0) continue } lab: 1", "1"); + +shouldBe("function test() { return 0 } lab: 1", "1"); +shouldThrow("function test() { while(0) break lab } lab: 1"); +shouldThrow("function test() { while(0) continue lab } lab: 1"); + +a = 1 +b = 123 // comment +c = 2 +c = 3 /* comment */ +d = 4 + +// non-ASCII identifier letters +shouldBe("var \u00E9\u0100\u02AF\u0388\u18A8 = 101; \u00E9\u0100\u02AF\u0388\u18A8;", "101"); + +// invalid identifier letters +shouldThrow("var f\xF7;"); + +// ASCII identifier characters as escape sequences +shouldBe("var \\u0061 = 102; a", "102"); +shouldBe("var f\\u0030 = 103; f0", "103"); + +// non-ASCII identifier letters as escape sequences +shouldBe("var \\u00E9\\u0100\\u02AF\\u0388\\u18A8 = 104; \\u00E9\\u0100\\u02AF\\u0388\\u18A8;", "104"); + +// invalid identifier characters as escape sequences +shouldThrow("var f\\u00F7;"); +shouldThrow("var \\u0030;"); +shouldThrow("var test = { }; test.i= 0; test.i\\u002b= 1; test.i;"); + +shouldBe("var test = { }; test.i= 0; test.i\u002b= 1; test.i;", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/prototype_length-expected.txt b/deps/v8/test/webkit/fast/js/kde/prototype_length-expected.txt new file mode 100644 index 0000000000..7c4c2e25d8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/prototype_length-expected.txt @@ -0,0 +1,50 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Object.prototype.length is undefined +PASS Function.prototype.length is 0 +PASS Array.prototype.length is 0 +PASS String.prototype.length is 0 +PASS Boolean.prototype.length is undefined +PASS Number.prototype.length is undefined +PASS Date.prototype.length is undefined +PASS RegExp.prototype.length is undefined +PASS Error.prototype.length is undefined +PASS Array.prototype.length is 6 +PASS Function.prototype.length is 0 +PASS String.prototype.length is 0 +PASS delete Array.prototype.length is false +PASS delete Function.prototype.length is false +PASS delete String.prototype.length is false +PASS foundArrayPrototypeLength is false +PASS foundFunctionPrototypeLength is false +PASS foundStringPrototypeLength is false +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/prototype_length.js b/deps/v8/test/webkit/fast/js/kde/prototype_length.js new file mode 100644 index 0000000000..2936fa55a9 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/prototype_length.js @@ -0,0 +1,60 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Object.prototype.length","undefined"); +shouldBe("Function.prototype.length","0"); +shouldBe("Array.prototype.length","0"); +shouldBe("String.prototype.length","0"); +shouldBe("Boolean.prototype.length","undefined"); +shouldBe("Number.prototype.length","undefined"); +shouldBe("Date.prototype.length","undefined"); +shouldBe("RegExp.prototype.length","undefined"); +shouldBe("Error.prototype.length","undefined"); + +// check !ReadOnly +Array.prototype.length = 6; +shouldBe("Array.prototype.length","6"); +// check ReadOnly +Function.prototype.length = 7; +shouldBe("Function.prototype.length","0"); +String.prototype.length = 8; +shouldBe("String.prototype.length","0"); + +// check DontDelete +shouldBe("delete Array.prototype.length","false"); +shouldBe("delete Function.prototype.length","false"); +shouldBe("delete String.prototype.length","false"); + +// check DontEnum +var foundArrayPrototypeLength = false; +for (i in Array.prototype) { if (i == "length") foundArrayPrototypeLength = true; } +shouldBe("foundArrayPrototypeLength","false"); + +var foundFunctionPrototypeLength = false; +for (i in Function.prototype) { if (i == "length") foundFunctionPrototypeLength = true; } +shouldBe("foundFunctionPrototypeLength","false"); + +var foundStringPrototypeLength = false; +for (i in String.prototype) { if (i == "length") foundStringPrototypeLength = true; } +shouldBe("foundStringPrototypeLength","false");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/prototype_proto-expected.txt b/deps/v8/test/webkit/fast/js/kde/prototype_proto-expected.txt new file mode 100644 index 0000000000..7a17077ecd --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/prototype_proto-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Object.prototype.__proto__ == Object.prototype is false +PASS Function.prototype.__proto__ is Object.prototype +PASS Array.prototype.__proto__ is Object.prototype +PASS String.prototype.__proto__ is Object.prototype +PASS Boolean.prototype.__proto__ is Object.prototype +PASS Number.prototype.__proto__ is Object.prototype +PASS Date.prototype.__proto__ is Object.prototype +PASS RegExp.prototype.__proto__ is Object.prototype +PASS Error.prototype.__proto__ is Object.prototype +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/prototype_proto.js b/deps/v8/test/webkit/fast/js/kde/prototype_proto.js new file mode 100644 index 0000000000..f956d94cd7 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/prototype_proto.js @@ -0,0 +1,33 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +shouldBe("Object.prototype.__proto__ == Object.prototype","false"); +shouldBe("Function.prototype.__proto__","Object.prototype"); +shouldBe("Array.prototype.__proto__","Object.prototype"); +shouldBe("String.prototype.__proto__","Object.prototype"); +shouldBe("Boolean.prototype.__proto__","Object.prototype"); +shouldBe("Number.prototype.__proto__","Object.prototype"); +shouldBe("Date.prototype.__proto__","Object.prototype"); +shouldBe("RegExp.prototype.__proto__","Object.prototype"); +shouldBe("Error.prototype.__proto__","Object.prototype");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/scope-expected.txt b/deps/v8/test/webkit/fast/js/kde/scope-expected.txt new file mode 100644 index 0000000000..b44878470b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/scope-expected.txt @@ -0,0 +1,36 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS f(2) is 22 +PASS OBJECT.toString() is 'hello' +PASS s is 'hello' +PASS g is 'foo' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/scope.js b/deps/v8/test/webkit/fast/js/kde/scope.js new file mode 100644 index 0000000000..cead049be8 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/scope.js @@ -0,0 +1,58 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var b = new Boolean(); +b.x = 11; + +with (b) { + f = function(a) { return a*x; } // remember scope chain +} + +shouldBe("f(2)", "22"); + +var OBJECT = new MyObject( "hello" ); +function MyObject(value) { + this.value = value; + this.toString = new Function( "return this.value+''" ); + return this; +} +shouldBe("OBJECT.toString()", "'hello'"); +var s; +with (OBJECT) { + s = toString(); +} +shouldBe("s", "'hello'"); + + +// Make sure that for ... in reevaluates the scoping every time! +P = { foo : 1, bar : 2, baz : 3 } + +function testForIn() { + for (g in P) { + eval("var g;") //Change the scope of g half-ways through the loop + } +} + +testForIn(); +shouldBe("g", "'foo'"); //Before the eval, g was in outer scope, but not after!
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/statements-expected.txt b/deps/v8/test/webkit/fast/js/kde/statements-expected.txt new file mode 100644 index 0000000000..838933f291 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/statements-expected.txt @@ -0,0 +1,45 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS testSwitch(0) is 'abcd' +PASS testSwitch(1) is 'bcd' +PASS testSwitch(2) is 'd' +PASS testSwitch(false) is '' +PASS testSwitch2(1) is 'a' +PASS testSwitch2(2) is 'b' +PASS testSwitch2(3) is 'd' +PASS testSwitch2(-1) is 'cd' +PASS testSwitch2('x') is 'cd' +PASS testSwitch3(0) is 'cde' +PASS testSwitch3(3) is 'de' +PASS testSwitch3(4) is 'e' +PASS testSwitch4(0) is 'ab' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/statements.js b/deps/v8/test/webkit/fast/js/kde/statements.js new file mode 100644 index 0000000000..ecc6c321a4 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/statements.js @@ -0,0 +1,99 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +function testSwitch(v) { + var result = ""; + switch (v) { + case 0: + result += 'a'; + case 1: + Â Â Â Â Â Â Â result += 'b'; + case 1: + result += 'c'; + case 2: + result += 'd'; + break; + } + return result; +} + +shouldBe("testSwitch(0)", "'abcd'"); +shouldBe("testSwitch(1)", "'bcd'"); // IE agrees, NS disagrees +shouldBe("testSwitch(2)", "'d'"); +shouldBe("testSwitch(false)", "''"); + +function testSwitch2(v) { + var result = ""; + switch (v) { + case 1: + result += 'a'; + break; + case 2: + Â Â Â Â Â Â Â result += 'b'; + break; + default: + result += 'c'; + case 3: + result += 'd'; + break; + } + return result; +} + +shouldBe("testSwitch2(1)", "'a'"); +shouldBe("testSwitch2(2)", "'b'"); +shouldBe("testSwitch2(3)", "'d'"); +shouldBe("testSwitch2(-1)", "'cd'"); +shouldBe("testSwitch2('x')", "'cd'"); + +function testSwitch3(v) { + var result = ""; + switch (v) { + default: + result += 'c'; + case 3: + result += 'd'; + case 4: + result += 'e'; + break; + } + return result; +}; + +shouldBe("testSwitch3(0)", "'cde'"); +shouldBe("testSwitch3(3)", "'de'"); +shouldBe("testSwitch3(4)", "'e'"); + +function testSwitch4(v) { + var result = ""; + switch (v) { + case 0: + result += 'a'; + result += 'b'; + break; + } + return result; +}; + +shouldBe("testSwitch4(0)", "'ab'");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/kde/var_decl_init-expected.txt b/deps/v8/test/webkit/fast/js/kde/var_decl_init-expected.txt new file mode 100644 index 0000000000..18ed1c47c6 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/var_decl_init-expected.txt @@ -0,0 +1,53 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +KDE JS Test + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS varInFunction() is true +PASS varInVarList() is true +PASS varListOrder() is true +PASS varInBlock() is true +PASS varInIf() is true +PASS varInElse() is true +PASS varInDoWhile() is true +PASS varInWhile() is true +PASS varInFor() is true +PASS varInForIn() is true +PASS varInWith() is true +PASS varInCase() is true +PASS varInLabel() is true +PASS varInCatch() is true +PASS varInFinally() is true +PASS varInTry() is true +PASS varInForInitExpr() is true +PASS varInSubFunction() is true +PASS varGlobal is 1 +PASS overrideVar is 1 +PASS overrideVar2 is 2 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/kde/var_decl_init.js b/deps/v8/test/webkit/fast/js/kde/var_decl_init.js new file mode 100644 index 0000000000..0bf4a9e273 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/kde/var_decl_init.js @@ -0,0 +1,184 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("KDE JS Test"); +var myvar = 1; + +function varInFunction() { + return (myvar == undefined); + var myvar = 2; +} + +function varInVarList() { + return (myvar == undefined); + var a = 1, b = 0, myvar = 2; +} + +function varListOrder() { + var tmp = 0; + var i = ++tmp, j = ++tmp; + return j == 2; +} + +function varInBlock() { + return (myvar == undefined); + { + var myvar = 2; + } +} + +function varInIf() { + return (myvar == undefined); + if (false) + var myvar = 2; +} + +function varInElse() { + return (myvar == undefined); + if (true) { + } + else + var myvar = 2; +} + +function varInDoWhile() { + return (myvar == undefined); + do + var myvar = 2; + while (false); +} + +function varInWhile() { + return (myvar == undefined); + while (false) + var myvar = 2; +} + +function varInFor() { + return (myvar == undefined); + var i; + for (i = 0; i < 0; i++) + var myvar = 2; +} + +function varInForInitExpr() { + return (myvar == undefined); + for (var myvar = 2; i < 2; i++) { + } +} + +function varInForIn() { + return (myvar == undefined); + var o = new Object(); + var i; + for (i in o) + var myvar = 2; +} + +function varInWith() { + return (myvar == undefined); + with (String) + var myvar = 2; +} + +function varInCase() { + return (myvar == undefined); + switch (1) { + case 0: + var myvar = 2; + case 1: + } +} + +function varInLabel() { + return (myvar == undefined); +label1: + var myvar = 2; +} + +function varInCatch() { + return (myvar == undefined); + try { + } + catch (e) { + var myvar = 2; + } +} + +function varInFinally() { + return (myvar == undefined); + try { + } + finally { + var myvar = 2; + } +} + +function varInTry() { + return (myvar == undefined); + try { + var myvar = 2; + } + catch (e) { + } + finally { + } +} + +function varInSubFunction() { + return (myvar == 1); + function subfunction() { + var myvar = 2; + } +} + +if (!varGlobal) + var varGlobal = 1; + +shouldBe("varInFunction()","true"); +shouldBe("varInVarList()","true"); +shouldBe("varListOrder()","true"); +shouldBe("varInBlock()","true"); +shouldBe("varInIf()","true"); +shouldBe("varInElse()","true"); +shouldBe("varInDoWhile()","true"); +shouldBe("varInWhile()","true"); +shouldBe("varInFor()","true"); +shouldBe("varInForIn()","true"); +shouldBe("varInWith()","true"); +shouldBe("varInCase()","true"); +shouldBe("varInLabel()","true"); +shouldBe("varInCatch()","true"); +shouldBe("varInFinally()","true"); +shouldBe("varInTry()","true"); +shouldBe("varInForInitExpr()","true"); +shouldBe("varInSubFunction()","true"); +shouldBe("varGlobal", "1"); + +var overrideVar = 1; +var overrideVar; +shouldBe("overrideVar", "1"); + +var overrideVar2 = 1; +var overrideVar2 = 2; +shouldBe("overrideVar2", "2");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt index 5fae72ecbc..80df97e671 100644 --- a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt +++ b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch-expected.txt @@ -27,8 +27,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS gotRightCatch is true -PASS gotWrongCatch1 is false -FAIL gotWrongCatch2 should be false. Was true. PASS successfullyParsed is true TEST COMPLETE diff --git a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js index 4cbcbbfb6e..f36512adbb 100644 --- a/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js +++ b/deps/v8/test/webkit/fast/js/stack-overflow-arrity-catch.js @@ -42,6 +42,8 @@ function test1() try { var dummy = new RegExp('a|b|c'); } catch(err) { + // (1) It is dendent on the stack size if we arrive here, in (2) or + // both. gotWrongCatch1 = true; } @@ -58,6 +60,8 @@ function test2() try { var dummy = new Date(); } catch(err) { + // (2) It is dendent on the stack size if we arrive here, in (1) or + // both. gotWrongCatch2 = true; } @@ -77,5 +81,3 @@ function test2() test1(); shouldBeTrue("gotRightCatch"); -shouldBeFalse("gotWrongCatch1"); -shouldBeFalse("gotWrongCatch2"); diff --git a/deps/v8/test/webkit/fast/js/string-anchor-expected.txt b/deps/v8/test/webkit/fast/js/string-anchor-expected.txt new file mode 100644 index 0000000000..3a50054f11 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-anchor-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This is a test case for String.prototype.anchor(name). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS '_'.anchor('b') is "<a name=\"b\">_</a>" +PASS '<'.anchor('b') is "<a name=\"b\"><</a>" +PASS '_'.anchor(0x2A) is "<a name=\"42\">_</a>" +PASS '_'.anchor('"') is "<a name=\""\">_</a>" +PASS '_'.anchor('" href="http://www.evil.com') is "<a name=\"" href="http://www.evil.com\">_</a>" +PASS String.prototype.anchor.call(0x2A, 0x2A) is "<a name=\"42\">42</a>" +FAIL String.prototype.anchor.call(undefined) should throw TypeError: Type error. Was <a name="undefined">undefined</a>. +FAIL String.prototype.anchor.call(null) should throw TypeError: Type error. Was <a name="undefined">null</a>. +PASS String.prototype.anchor.length is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-anchor.js b/deps/v8/test/webkit/fast/js/string-anchor.js new file mode 100644 index 0000000000..f213b89156 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-anchor.js @@ -0,0 +1,53 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description( +'This is a test case for String.prototype.anchor(name).' +); + +// This test is based on http://mathias.html5.org/tests/javascript/string/. + +// Simple case. +shouldBe("'_'.anchor('b')", '"<a name=\\"b\\">_</a>"'); + +// Does not escape special characters in `this` value. +shouldBe("'<'.anchor('b')", '"<a name=\\"b\\"><</a>"'); + +// first argument gets ToString()ed. +shouldBe("'_'.anchor(0x2A)", '"<a name=\\"42\\">_</a>"'); + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.anchor('\"')", '"<a name=\\""\\">_</a>"'); +shouldBe("'_'.anchor('\" href=\"http://www.evil.com')", '"<a name=\\"" href="http://www.evil.com\\">_</a>"'); + +// Generic use on Number object. +shouldBe("String.prototype.anchor.call(0x2A, 0x2A)", '"<a name=\\"42\\">42</a>"'); + +// Generic use on non-coercible object `undefined`. +shouldThrow("String.prototype.anchor.call(undefined)", '"TypeError: Type error"'); + +// Generic use on non-coercible object `null`. +shouldThrow("String.prototype.anchor.call(null)", '"TypeError: Type error"'); + +// Check anchor.length. +shouldBe("String.prototype.anchor.length", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/string-fontcolor-expected.txt b/deps/v8/test/webkit/fast/js/string-fontcolor-expected.txt new file mode 100644 index 0000000000..af2c707f37 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-fontcolor-expected.txt @@ -0,0 +1,41 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This is a test case for String.prototype.fontcolor(color). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS '_'.fontcolor('b') is "<font color=\"b\">_</font>" +PASS '<'.fontcolor('b') is "<font color=\"b\"><</font>" +PASS '_'.fontcolor(0x2A) is "<font color=\"42\">_</font>" +PASS '_'.fontcolor('"') is "<font color=\""\">_</font>" +PASS '_'.fontcolor('" size="2px') is "<font color=\"" size="2px\">_</font>" +PASS String.prototype.fontcolor.call(0x2A, 0x2A) is "<font color=\"42\">42</font>" +FAIL String.prototype.fontcolor.call(undefined) should throw TypeError: Type error. Was <font color="undefined">undefined</font>. +FAIL String.prototype.fontcolor.call(null) should throw TypeError: Type error. Was <font color="undefined">null</font>. +PASS String.prototype.fontcolor.length is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-fontcolor.js b/deps/v8/test/webkit/fast/js/string-fontcolor.js new file mode 100644 index 0000000000..67f4ef2e07 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-fontcolor.js @@ -0,0 +1,53 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description( +'This is a test case for String.prototype.fontcolor(color).' +); + +// This test is based on http://mathias.html5.org/tests/javascript/string/. + +// Simple case. +shouldBe("'_'.fontcolor('b')", '"<font color=\\"b\\">_</font>"'); + +// Does not escape special characters in `this` value. +shouldBe("'<'.fontcolor('b')", '"<font color=\\"b\\"><</font>"'); + +// First argument gets ToString()ed. +shouldBe("'_'.fontcolor(0x2A)", '"<font color=\\"42\\">_</font>"'); + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.fontcolor('\"')", '"<font color=\\""\\">_</font>"'); +shouldBe("'_'.fontcolor('\" size=\"2px')", '"<font color=\\"" size="2px\\">_</font>"'); + +// Generic use on Number object. +shouldBe("String.prototype.fontcolor.call(0x2A, 0x2A)", '"<font color=\\"42\\">42</font>"'); + +// Generic use on non-coercible object `undefined`. +shouldThrow("String.prototype.fontcolor.call(undefined)", '"TypeError: Type error"'); + +// Generic use on non-coercible object `null`. +shouldThrow("String.prototype.fontcolor.call(null)", '"TypeError: Type error"'); + +// Check fontcolor.length. +shouldBe("String.prototype.fontcolor.length", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/string-fontsize-expected.txt b/deps/v8/test/webkit/fast/js/string-fontsize-expected.txt new file mode 100644 index 0000000000..c114f74b15 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-fontsize-expected.txt @@ -0,0 +1,42 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This is a test case for String.prototype.fontsize(size). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS '_'.fontsize('"') is "<font size=\""\">_</font>" +PASS '_'.fontsize('b') is "<font size=\"b\">_</font>" +PASS '<'.fontsize('b') is "<font size=\"b\"><</font>" +PASS '_'.fontsize(0x2A) is "<font size=\"42\">_</font>" +PASS '_'.fontsize('"') is "<font size=\""\">_</font>" +PASS '_'.fontsize('" color="b') is "<font size=\"" color="b\">_</font>" +PASS String.prototype.fontsize.call(0x2A, 0x2A) is "<font size=\"42\">42</font>" +FAIL String.prototype.fontsize.call(undefined) should throw TypeError: Type error. Was <font size="undefined">undefined</font>. +FAIL String.prototype.fontsize.call(null) should throw TypeError: Type error. Was <font size="undefined">null</font>. +PASS String.prototype.fontsize.length is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-fontsize.js b/deps/v8/test/webkit/fast/js/string-fontsize.js new file mode 100644 index 0000000000..e103e5e6bc --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-fontsize.js @@ -0,0 +1,56 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description( +'This is a test case for String.prototype.fontsize(size).' +); + +// This test is based on http://mathias.html5.org/tests/javascript/string/. + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.fontsize('\"')", '"<font size=\\""\\">_</font>"'); + +// Simple case. +shouldBe("'_'.fontsize('b')", '"<font size=\\"b\\">_</font>"'); + +// Does not escape special characters in `this` value. +shouldBe("'<'.fontsize('b')", '"<font size=\\"b\\"><</font>"'); + +// First argument gets ToString()ed. +shouldBe("'_'.fontsize(0x2A)", '"<font size=\\"42\\">_</font>"'); + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.fontsize('\"')", '"<font size=\\""\\">_</font>"'); +shouldBe("'_'.fontsize('\" color=\"b')", '"<font size=\\"" color="b\\">_</font>"'); + +// Generic use on Number object. +shouldBe("String.prototype.fontsize.call(0x2A, 0x2A)", '"<font size=\\"42\\">42</font>"'); + +// Generic use on non-coercible object `undefined`. +shouldThrow("String.prototype.fontsize.call(undefined)", '"TypeError: Type error"'); + +// Generic use on non-coercible object `null`. +shouldThrow("String.prototype.fontsize.call(null)", '"TypeError: Type error"'); + +// Check fontsize.length. +shouldBe("String.prototype.fontsize.length", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/string-link-expected.txt b/deps/v8/test/webkit/fast/js/string-link-expected.txt new file mode 100644 index 0000000000..afacbe6bb9 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-link-expected.txt @@ -0,0 +1,42 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +This is a test case for String.prototype.link(href). + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS '_'.link('"') is "<a href=\""\">_</a>" +PASS '_'.link('b') is "<a href=\"b\">_</a>" +PASS '<'.link('b') is "<a href=\"b\"><</a>" +PASS '_'.link(0x2A) is "<a href=\"42\">_</a>" +PASS '_'.link('"') is "<a href=\""\">_</a>" +PASS '_'.link('" target="_blank') is "<a href=\"" target="_blank\">_</a>" +PASS String.prototype.link.call(0x2A, 0x2A) is "<a href=\"42\">42</a>" +FAIL String.prototype.link.call(undefined) should throw TypeError: Type error. Was <a href="undefined">undefined</a>. +FAIL String.prototype.link.call(null) should throw TypeError: Type error. Was <a href="undefined">null</a>. +PASS String.prototype.link.length is 1 +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/string-link.js b/deps/v8/test/webkit/fast/js/string-link.js new file mode 100644 index 0000000000..8b96915be1 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/string-link.js @@ -0,0 +1,56 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description( +'This is a test case for String.prototype.link(href).' +); + +// This test is based on http://mathias.html5.org/tests/javascript/string/. + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.link('\"')", '"<a href=\\""\\">_</a>"'); + +// Simple case. +shouldBe("'_'.link('b')", '"<a href=\\"b\\">_</a>"'); + +// Does not escape special characters in `this` value. +shouldBe("'<'.link('b')", '"<a href=\\"b\\"><</a>"'); + +// First argument gets ToString()ed. +shouldBe("'_'.link(0x2A)", '"<a href=\\"42\\">_</a>"'); + +// Check that the quotation mark is correctly escaped. +shouldBe("'_'.link('\"')", '"<a href=\\""\\">_</a>"'); +shouldBe("'_'.link('\" target=\"_blank')", '"<a href=\\"" target="_blank\\">_</a>"'); + +// Generic use on Number object. +shouldBe("String.prototype.link.call(0x2A, 0x2A)", '"<a href=\\"42\\">42</a>"'); + +// Generic use on non-coercible object `undefined`. +shouldThrow("String.prototype.link.call(undefined)", '"TypeError: Type error"'); + +// Generic use on non-coercible object `null`. +shouldThrow("String.prototype.link.call(null)", '"TypeError: Type error"'); + +// Check link.length. +shouldBe("String.prototype.link.length", "1");
\ No newline at end of file diff --git a/deps/v8/test/webkit/fast/js/toString-number-expected.txt b/deps/v8/test/webkit/fast/js/toString-number-expected.txt new file mode 100644 index 0000000000..197d23ee4b --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-number-expected.txt @@ -0,0 +1,329 @@ +# Copyright 2013 the V8 project authors. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. 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. +# +# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +Test the conversion performed by the function Number.prototype.toString. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS Number(0).toString() is "0" +PASS Number.prototype.toString.call(0) is "0" +PASS Number.prototype.toString.call(new Number(0)) is "0" +PASS Number("0").toString() is "0" +PASS Number(0).toString(10) is "0" +PASS Number(0).toString(2) is "0" +PASS Number.prototype.toString.call(0, 2) is "0" +PASS Number.prototype.toString.call(new Number(0), 2) is "0" +PASS Number(0).toString(36) is "0" +PASS Number.prototype.toString.call(0, 36) is "0" +PASS Number.prototype.toString.call(new Number(0), 36) is "0" +PASS Number(-1).toString() is "-1" +PASS Number.prototype.toString.call(-1) is "-1" +PASS Number.prototype.toString.call(new Number(-1)) is "-1" +PASS Number("-1").toString() is "-1" +PASS Number(-1).toString(10) is "-1" +PASS Number(-1).toString(2) is "-1" +PASS Number.prototype.toString.call(-1, 2) is "-1" +PASS Number.prototype.toString.call(new Number(-1), 2) is "-1" +PASS Number(-1).toString(36) is "-1" +PASS Number.prototype.toString.call(-1, 36) is "-1" +PASS Number.prototype.toString.call(new Number(-1), 36) is "-1" +PASS Number(1).toString() is "1" +PASS Number.prototype.toString.call(1) is "1" +PASS Number.prototype.toString.call(new Number(1)) is "1" +PASS Number("1").toString() is "1" +PASS Number(1).toString(10) is "1" +PASS Number(1).toString(2) is "1" +PASS Number.prototype.toString.call(1, 2) is "1" +PASS Number.prototype.toString.call(new Number(1), 2) is "1" +PASS Number(1).toString(36) is "1" +PASS Number.prototype.toString.call(1, 36) is "1" +PASS Number.prototype.toString.call(new Number(1), 36) is "1" +PASS Number(1984).toString() is "1984" +PASS Number.prototype.toString.call(1984) is "1984" +PASS Number.prototype.toString.call(new Number(1984)) is "1984" +PASS Number("1984").toString() is "1984" +PASS Number(1984).toString(10) is "1984" +PASS Number(1984).toString(2) is "11111000000" +PASS Number.prototype.toString.call(1984, 2) is "11111000000" +PASS Number.prototype.toString.call(new Number(1984), 2) is "11111000000" +PASS Number(1984).toString(36) is "1j4" +PASS Number.prototype.toString.call(1984, 36) is "1j4" +PASS Number.prototype.toString.call(new Number(1984), 36) is "1j4" +PASS Number(-1984).toString() is "-1984" +PASS Number.prototype.toString.call(-1984) is "-1984" +PASS Number.prototype.toString.call(new Number(-1984)) is "-1984" +PASS Number("-1984").toString() is "-1984" +PASS Number(-1984).toString(10) is "-1984" +PASS Number(-1984).toString(2) is "-11111000000" +PASS Number.prototype.toString.call(-1984, 2) is "-11111000000" +PASS Number.prototype.toString.call(new Number(-1984), 2) is "-11111000000" +PASS Number(-1984).toString(36) is "-1j4" +PASS Number.prototype.toString.call(-1984, 36) is "-1j4" +PASS Number.prototype.toString.call(new Number(-1984), 36) is "-1j4" +PASS Number(2147483647).toString() is "2147483647" +PASS Number.prototype.toString.call(2147483647) is "2147483647" +PASS Number.prototype.toString.call(new Number(2147483647)) is "2147483647" +PASS Number("2147483647").toString() is "2147483647" +PASS Number(2147483647).toString(10) is "2147483647" +PASS Number(2147483647).toString(2) is "1111111111111111111111111111111" +PASS Number.prototype.toString.call(2147483647, 2) is "1111111111111111111111111111111" +PASS Number.prototype.toString.call(new Number(2147483647), 2) is "1111111111111111111111111111111" +PASS Number(2147483647).toString(36) is "zik0zj" +PASS Number.prototype.toString.call(2147483647, 36) is "zik0zj" +PASS Number.prototype.toString.call(new Number(2147483647), 36) is "zik0zj" +PASS Number(-2147483648).toString() is "-2147483648" +PASS Number.prototype.toString.call(-2147483648) is "-2147483648" +PASS Number.prototype.toString.call(new Number(-2147483648)) is "-2147483648" +PASS Number("-2147483648").toString() is "-2147483648" +PASS Number(-2147483648).toString(10) is "-2147483648" +PASS Number(-2147483648).toString(2) is "-10000000000000000000000000000000" +PASS Number.prototype.toString.call(-2147483648, 2) is "-10000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(-2147483648), 2) is "-10000000000000000000000000000000" +PASS Number(-2147483648).toString(36) is "-zik0zk" +PASS Number.prototype.toString.call(-2147483648, 36) is "-zik0zk" +PASS Number.prototype.toString.call(new Number(-2147483648), 36) is "-zik0zk" +PASS Number(9007199254740992).toString() is "9007199254740992" +PASS Number.prototype.toString.call(9007199254740992) is "9007199254740992" +PASS Number.prototype.toString.call(new Number(9007199254740992)) is "9007199254740992" +PASS Number("9007199254740992").toString() is "9007199254740992" +PASS Number(9007199254740992).toString(10) is "9007199254740992" +PASS Number(9007199254740992).toString(2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(9007199254740992, 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(9007199254740992), 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number(9007199254740992).toString(36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(9007199254740992, 36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(9007199254740992), 36) is "2gosa7pa2gw" +PASS Number(-9007199254740992).toString() is "-9007199254740992" +PASS Number.prototype.toString.call(-9007199254740992) is "-9007199254740992" +PASS Number.prototype.toString.call(new Number(-9007199254740992)) is "-9007199254740992" +PASS Number("-9007199254740992").toString() is "-9007199254740992" +PASS Number(-9007199254740992).toString(10) is "-9007199254740992" +PASS Number(-9007199254740992).toString(2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(-9007199254740992, 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number(-9007199254740992).toString(36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(-9007199254740992, 36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 36) is "-2gosa7pa2gw" +PASS Number(0).toString() is "0" +PASS Number.prototype.toString.call(0) is "0" +PASS Number.prototype.toString.call(new Number(0)) is "0" +PASS Number("0").toString() is "0" +PASS Number(0).toString(10) is "0" +PASS Number(0).toString(2) is "0" +PASS Number.prototype.toString.call(0, 2) is "0" +PASS Number.prototype.toString.call(new Number(0), 2) is "0" +PASS Number(0).toString(36) is "0" +PASS Number.prototype.toString.call(0, 36) is "0" +PASS Number.prototype.toString.call(new Number(0), 36) is "0" +PASS Number(-1).toString() is "-1" +PASS Number.prototype.toString.call(-1) is "-1" +PASS Number.prototype.toString.call(new Number(-1)) is "-1" +PASS Number("-1").toString() is "-1" +PASS Number(-1).toString(10) is "-1" +PASS Number(-1).toString(2) is "-1" +PASS Number.prototype.toString.call(-1, 2) is "-1" +PASS Number.prototype.toString.call(new Number(-1), 2) is "-1" +PASS Number(-1).toString(36) is "-1" +PASS Number.prototype.toString.call(-1, 36) is "-1" +PASS Number.prototype.toString.call(new Number(-1), 36) is "-1" +PASS Number(1).toString() is "1" +PASS Number.prototype.toString.call(1) is "1" +PASS Number.prototype.toString.call(new Number(1)) is "1" +PASS Number("1").toString() is "1" +PASS Number(1).toString(10) is "1" +PASS Number(1).toString(2) is "1" +PASS Number.prototype.toString.call(1, 2) is "1" +PASS Number.prototype.toString.call(new Number(1), 2) is "1" +PASS Number(1).toString(36) is "1" +PASS Number.prototype.toString.call(1, 36) is "1" +PASS Number.prototype.toString.call(new Number(1), 36) is "1" +PASS Number(1984).toString() is "1984" +PASS Number.prototype.toString.call(1984) is "1984" +PASS Number.prototype.toString.call(new Number(1984)) is "1984" +PASS Number("1984").toString() is "1984" +PASS Number(1984).toString(10) is "1984" +PASS Number(1984).toString(2) is "11111000000" +PASS Number.prototype.toString.call(1984, 2) is "11111000000" +PASS Number.prototype.toString.call(new Number(1984), 2) is "11111000000" +PASS Number(1984).toString(36) is "1j4" +PASS Number.prototype.toString.call(1984, 36) is "1j4" +PASS Number.prototype.toString.call(new Number(1984), 36) is "1j4" +PASS Number(-1984).toString() is "-1984" +PASS Number.prototype.toString.call(-1984) is "-1984" +PASS Number.prototype.toString.call(new Number(-1984)) is "-1984" +PASS Number("-1984").toString() is "-1984" +PASS Number(-1984).toString(10) is "-1984" +PASS Number(-1984).toString(2) is "-11111000000" +PASS Number.prototype.toString.call(-1984, 2) is "-11111000000" +PASS Number.prototype.toString.call(new Number(-1984), 2) is "-11111000000" +PASS Number(-1984).toString(36) is "-1j4" +PASS Number.prototype.toString.call(-1984, 36) is "-1j4" +PASS Number.prototype.toString.call(new Number(-1984), 36) is "-1j4" +PASS Number(2147483647).toString() is "2147483647" +PASS Number.prototype.toString.call(2147483647) is "2147483647" +PASS Number.prototype.toString.call(new Number(2147483647)) is "2147483647" +PASS Number("2147483647").toString() is "2147483647" +PASS Number(2147483647).toString(10) is "2147483647" +PASS Number(2147483647).toString(2) is "1111111111111111111111111111111" +PASS Number.prototype.toString.call(2147483647, 2) is "1111111111111111111111111111111" +PASS Number.prototype.toString.call(new Number(2147483647), 2) is "1111111111111111111111111111111" +PASS Number(2147483647).toString(36) is "zik0zj" +PASS Number.prototype.toString.call(2147483647, 36) is "zik0zj" +PASS Number.prototype.toString.call(new Number(2147483647), 36) is "zik0zj" +PASS Number(-2147483648).toString() is "-2147483648" +PASS Number.prototype.toString.call(-2147483648) is "-2147483648" +PASS Number.prototype.toString.call(new Number(-2147483648)) is "-2147483648" +PASS Number("-2147483648").toString() is "-2147483648" +PASS Number(-2147483648).toString(10) is "-2147483648" +PASS Number(-2147483648).toString(2) is "-10000000000000000000000000000000" +PASS Number.prototype.toString.call(-2147483648, 2) is "-10000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(-2147483648), 2) is "-10000000000000000000000000000000" +PASS Number(-2147483648).toString(36) is "-zik0zk" +PASS Number.prototype.toString.call(-2147483648, 36) is "-zik0zk" +PASS Number.prototype.toString.call(new Number(-2147483648), 36) is "-zik0zk" +PASS Number(9007199254740992).toString() is "9007199254740992" +PASS Number.prototype.toString.call(9007199254740992) is "9007199254740992" +PASS Number.prototype.toString.call(new Number(9007199254740992)) is "9007199254740992" +PASS Number("9007199254740992").toString() is "9007199254740992" +PASS Number(9007199254740992).toString(10) is "9007199254740992" +PASS Number(9007199254740992).toString(2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(9007199254740992, 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(9007199254740992), 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number(9007199254740992).toString(36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(9007199254740992, 36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(9007199254740992), 36) is "2gosa7pa2gw" +PASS Number(-9007199254740992).toString() is "-9007199254740992" +PASS Number.prototype.toString.call(-9007199254740992) is "-9007199254740992" +PASS Number.prototype.toString.call(new Number(-9007199254740992)) is "-9007199254740992" +PASS Number("-9007199254740992").toString() is "-9007199254740992" +PASS Number(-9007199254740992).toString(10) is "-9007199254740992" +PASS Number(-9007199254740992).toString(2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(-9007199254740992, 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number(-9007199254740992).toString(36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(-9007199254740992, 36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 36) is "-2gosa7pa2gw" +PASS Number(0.1).toString() is "0.1" +PASS Number.prototype.toString.call(0.1) is "0.1" +PASS Number.prototype.toString.call(new Number(0.1)) is "0.1" +PASS Number("0.1").toString() is "0.1" +PASS Number(0.1).toString(10) is "0.1" +PASS Number(0.1).toString(2) is "0.0001100110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(0.1, 2) is "0.0001100110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(new Number(0.1), 2) is "0.0001100110011001100110011001100110011001100110011001101" +FAIL Number(0.1).toString(36) should be 0.3lllllllllm. Was 0.3llllllllllqsn8td1p464unmi. +FAIL Number.prototype.toString.call(0.1, 36) should be 0.3lllllllllm. Was 0.3llllllllllqsn8td1p464unmi. +FAIL Number.prototype.toString.call(new Number(0.1), 36) should be 0.3lllllllllm. Was 0.3llllllllllqsn8td1p464unmi. +PASS Number(-1.1).toString() is "-1.1" +PASS Number.prototype.toString.call(-1.1) is "-1.1" +PASS Number.prototype.toString.call(new Number(-1.1)) is "-1.1" +PASS Number("-1.1").toString() is "-1.1" +PASS Number(-1.1).toString(10) is "-1.1" +PASS Number(-1.1).toString(2) is "-1.000110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(-1.1, 2) is "-1.000110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(new Number(-1.1), 2) is "-1.000110011001100110011001100110011001100110011001101" +FAIL Number(-1.1).toString(36) should be -1.3llllllllm. Was -1.3lllllllllxagau2ctidswz5mi. +FAIL Number.prototype.toString.call(-1.1, 36) should be -1.3llllllllm. Was -1.3lllllllllxagau2ctidswz5mi. +FAIL Number.prototype.toString.call(new Number(-1.1), 36) should be -1.3llllllllm. Was -1.3lllllllllxagau2ctidswz5mi. +PASS Number(1.1).toString() is "1.1" +PASS Number.prototype.toString.call(1.1) is "1.1" +PASS Number.prototype.toString.call(new Number(1.1)) is "1.1" +PASS Number("1.1").toString() is "1.1" +PASS Number(1.1).toString(10) is "1.1" +PASS Number(1.1).toString(2) is "1.000110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(1.1, 2) is "1.000110011001100110011001100110011001100110011001101" +PASS Number.prototype.toString.call(new Number(1.1), 2) is "1.000110011001100110011001100110011001100110011001101" +FAIL Number(1.1).toString(36) should be 1.3llllllllm. Was 1.3lllllllllxagau2ctidswz5mi. +FAIL Number.prototype.toString.call(1.1, 36) should be 1.3llllllllm. Was 1.3lllllllllxagau2ctidswz5mi. +FAIL Number.prototype.toString.call(new Number(1.1), 36) should be 1.3llllllllm. Was 1.3lllllllllxagau2ctidswz5mi. +PASS Number(1984.1).toString() is "1984.1" +PASS Number.prototype.toString.call(1984.1) is "1984.1" +PASS Number.prototype.toString.call(new Number(1984.1)) is "1984.1" +PASS Number("1984.1").toString() is "1984.1" +PASS Number(1984.1).toString(10) is "1984.1" +PASS Number(1984.1).toString(2) is "11111000000.00011001100110011001100110011001100110011" +PASS Number.prototype.toString.call(1984.1, 2) is "11111000000.00011001100110011001100110011001100110011" +PASS Number.prototype.toString.call(new Number(1984.1), 2) is "11111000000.00011001100110011001100110011001100110011" +FAIL Number(1984.1).toString(36) should be 1j4.3lllllllc. Was 1j4.3lllllllcd2obsszcl3di. +FAIL Number.prototype.toString.call(1984.1, 36) should be 1j4.3lllllllc. Was 1j4.3lllllllcd2obsszcl3di. +FAIL Number.prototype.toString.call(new Number(1984.1), 36) should be 1j4.3lllllllc. Was 1j4.3lllllllcd2obsszcl3di. +PASS Number(-1984.1).toString() is "-1984.1" +PASS Number.prototype.toString.call(-1984.1) is "-1984.1" +PASS Number.prototype.toString.call(new Number(-1984.1)) is "-1984.1" +PASS Number("-1984.1").toString() is "-1984.1" +PASS Number(-1984.1).toString(10) is "-1984.1" +PASS Number(-1984.1).toString(2) is "-11111000000.00011001100110011001100110011001100110011" +PASS Number.prototype.toString.call(-1984.1, 2) is "-11111000000.00011001100110011001100110011001100110011" +PASS Number.prototype.toString.call(new Number(-1984.1), 2) is "-11111000000.00011001100110011001100110011001100110011" +FAIL Number(-1984.1).toString(36) should be -1j4.3lllllllc. Was -1j4.3lllllllcd2obsszcl3di. +FAIL Number.prototype.toString.call(-1984.1, 36) should be -1j4.3lllllllc. Was -1j4.3lllllllcd2obsszcl3di. +FAIL Number.prototype.toString.call(new Number(-1984.1), 36) should be -1j4.3lllllllc. Was -1j4.3lllllllcd2obsszcl3di. +PASS Number(2147483647.1).toString() is "2147483647.1" +PASS Number.prototype.toString.call(2147483647.1) is "2147483647.1" +PASS Number.prototype.toString.call(new Number(2147483647.1)) is "2147483647.1" +PASS Number("2147483647.1").toString() is "2147483647.1" +PASS Number(2147483647.1).toString(10) is "2147483647.1" +PASS Number(2147483647.1).toString(2) is "1111111111111111111111111111111.000110011001100110011" +PASS Number.prototype.toString.call(2147483647.1, 2) is "1111111111111111111111111111111.000110011001100110011" +PASS Number.prototype.toString.call(new Number(2147483647.1), 2) is "1111111111111111111111111111111.000110011001100110011" +FAIL Number(2147483647.1).toString(36) should be zik0zj.3lllg. Was zik0zj.3lllfu07ldi. +FAIL Number.prototype.toString.call(2147483647.1, 36) should be zik0zj.3lllg. Was zik0zj.3lllfu07ldi. +FAIL Number.prototype.toString.call(new Number(2147483647.1), 36) should be zik0zj.3lllg. Was zik0zj.3lllfu07ldi. +PASS Number(-2147483648.1).toString() is "-2147483648.1" +PASS Number.prototype.toString.call(-2147483648.1) is "-2147483648.1" +PASS Number.prototype.toString.call(new Number(-2147483648.1)) is "-2147483648.1" +PASS Number("-2147483648.1").toString() is "-2147483648.1" +PASS Number(-2147483648.1).toString(10) is "-2147483648.1" +PASS Number(-2147483648.1).toString(2) is "-10000000000000000000000000000000.000110011001100110011" +PASS Number.prototype.toString.call(-2147483648.1, 2) is "-10000000000000000000000000000000.000110011001100110011" +PASS Number.prototype.toString.call(new Number(-2147483648.1), 2) is "-10000000000000000000000000000000.000110011001100110011" +FAIL Number(-2147483648.1).toString(36) should be -zik0zk.3lllg. Was -zik0zk.3lllfu07ldi. +FAIL Number.prototype.toString.call(-2147483648.1, 36) should be -zik0zk.3lllg. Was -zik0zk.3lllfu07ldi. +FAIL Number.prototype.toString.call(new Number(-2147483648.1), 36) should be -zik0zk.3lllg. Was -zik0zk.3lllfu07ldi. +PASS Number(9007199254740992).toString() is "9007199254740992" +PASS Number.prototype.toString.call(9007199254740992) is "9007199254740992" +PASS Number.prototype.toString.call(new Number(9007199254740992)) is "9007199254740992" +PASS Number("9007199254740992").toString() is "9007199254740992" +PASS Number(9007199254740992).toString(10) is "9007199254740992" +PASS Number(9007199254740992).toString(2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(9007199254740992, 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(9007199254740992), 2) is "100000000000000000000000000000000000000000000000000000" +PASS Number(9007199254740992).toString(36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(9007199254740992, 36) is "2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(9007199254740992), 36) is "2gosa7pa2gw" +PASS Number(-9007199254740992).toString() is "-9007199254740992" +PASS Number.prototype.toString.call(-9007199254740992) is "-9007199254740992" +PASS Number.prototype.toString.call(new Number(-9007199254740992)) is "-9007199254740992" +PASS Number("-9007199254740992").toString() is "-9007199254740992" +PASS Number(-9007199254740992).toString(10) is "-9007199254740992" +PASS Number(-9007199254740992).toString(2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(-9007199254740992, 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 2) is "-100000000000000000000000000000000000000000000000000000" +PASS Number(-9007199254740992).toString(36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(-9007199254740992, 36) is "-2gosa7pa2gw" +PASS Number.prototype.toString.call(new Number(-9007199254740992), 36) is "-2gosa7pa2gw" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/deps/v8/test/webkit/fast/js/toString-number.js b/deps/v8/test/webkit/fast/js/toString-number.js new file mode 100644 index 0000000000..2acb3d1d09 --- /dev/null +++ b/deps/v8/test/webkit/fast/js/toString-number.js @@ -0,0 +1,94 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. 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. +// +// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. + +description("Test the conversion performed by the function Number.prototype.toString."); + + var numberIndex = 0; + var base10StringIndex = 1; + var base2StringIndex = 2; + var base36StringIndex = 3; + + var validNumberData = [ + // Regular Integers: + [0, '0', '0', '0'], + [-1, '-1', '-1', '-1'], + [1, '1', '1', '1'], + [1984, '1984', '11111000000', '1j4'], + [-1984, '-1984', '-11111000000', '-1j4'], + // Limits: + [2147483647, '2147483647', '1111111111111111111111111111111', 'zik0zj'], // INT_MAX. + [-2147483648, '-2147483648', '-10000000000000000000000000000000', '-zik0zk'], // INT_MIN + [9007199254740992, '9007199254740992', '100000000000000000000000000000000000000000000000000000', '2gosa7pa2gw'], // Max Integer in a double. + [-9007199254740992, '-9007199254740992', '-100000000000000000000000000000000000000000000000000000', '-2gosa7pa2gw'], // Min Integer in a double. + + // Integers represented as double. + [0.0, '0', '0', '0'], + [-1.0, '-1', '-1', '-1'], + [1.0, '1', '1', '1'], + [1984.0, '1984', '11111000000', '1j4'], + [-1984.0, '-1984', '-11111000000', '-1j4'], + // Limits: + [2147483647.0, '2147483647', '1111111111111111111111111111111', 'zik0zj'], // INT_MAX. + [-2147483648.0, '-2147483648', '-10000000000000000000000000000000', '-zik0zk'], // INT_MIN + [9007199254740992.0, '9007199254740992', '100000000000000000000000000000000000000000000000000000', '2gosa7pa2gw'], // Max Integer in a double. + [-9007199254740992.0, '-9007199254740992', '-100000000000000000000000000000000000000000000000000000', '-2gosa7pa2gw'], // Min Integer in a double. + + // Double. + [0.1, '0.1', '0.0001100110011001100110011001100110011001100110011001101', '0.3lllllllllm'], + [-1.1, '-1.1', '-1.000110011001100110011001100110011001100110011001101', '-1.3llllllllm'], + [1.1, '1.1', '1.000110011001100110011001100110011001100110011001101', '1.3llllllllm'], + [1984.1, '1984.1', '11111000000.00011001100110011001100110011001100110011', '1j4.3lllllllc'], + [-1984.1, '-1984.1', '-11111000000.00011001100110011001100110011001100110011', '-1j4.3lllllllc'], + // Limits: + [2147483647.1, '2147483647.1', '1111111111111111111111111111111.000110011001100110011', 'zik0zj.3lllg'], + [-2147483648.1, '-2147483648.1', '-10000000000000000000000000000000.000110011001100110011', '-zik0zk.3lllg'], + [9007199254740992.1, '9007199254740992', '100000000000000000000000000000000000000000000000000000', '2gosa7pa2gw'], + [-9007199254740992.1, '-9007199254740992', '-100000000000000000000000000000000000000000000000000000', '-2gosa7pa2gw'], + ]; + + for (var i = 0; i < validNumberData.length; ++i) { + number = validNumberData[i][numberIndex]; + + // Base 10: + stringBase10 = validNumberData[i][base10StringIndex]; + shouldBeEqualToString('Number(' + number + ').toString()', stringBase10); + shouldBeEqualToString('Number.prototype.toString.call(' + number + ')', stringBase10); + shouldBeEqualToString('Number.prototype.toString.call(new Number(' + number + '))', stringBase10); + // Passing the string to number should also lead to valid conversion. + shouldBeEqualToString('Number("' + number + '").toString()', stringBase10); + // Passing the base explicitly. + shouldBeEqualToString('Number(' + number + ').toString(10)', stringBase10); + + // Base 2: + stringBase2 = validNumberData[i][base2StringIndex]; + shouldBeEqualToString('Number(' + number + ').toString(2)', stringBase2); + shouldBeEqualToString('Number.prototype.toString.call(' + number + ', 2)', stringBase2); + shouldBeEqualToString('Number.prototype.toString.call(new Number(' + number + '), 2)', stringBase2); + + // Base 36: + stringBase36 = validNumberData[i][base36StringIndex]; + shouldBeEqualToString('Number(' + number + ').toString(36)', stringBase36); + shouldBeEqualToString('Number.prototype.toString.call(' + number + ', 36)', stringBase36); + shouldBeEqualToString('Number.prototype.toString.call(new Number(' + number + '), 36)', stringBase36); + } + successfullyParsed = true;
\ No newline at end of file diff --git a/deps/v8/test/webkit/webkit.status b/deps/v8/test/webkit/webkit.status index d65367b51d..4aaf8a97fb 100644 --- a/deps/v8/test/webkit/webkit.status +++ b/deps/v8/test/webkit/webkit.status @@ -30,3 +30,6 @@ dfg-int-overflow-in-loop: PASS, SKIP if $mode == debug dfg-double-vote-fuzz: PASS, SKIP if $mode == debug reentrant-caching: PASS, SKIP if $mode == debug sort-large-array: PASS, SKIP if $mode == debug + +############################################################################## +[ $deopt_fuzzer == True ] diff --git a/deps/v8/tools/blink_tests/TestExpectations b/deps/v8/tools/blink_tests/TestExpectations index c5596eb7f1..eec1d5a216 100644 --- a/deps/v8/tools/blink_tests/TestExpectations +++ b/deps/v8/tools/blink_tests/TestExpectations @@ -18,13 +18,10 @@ [ Linux Debug ] fast/text/international/thai-baht-space.html [ Pass Failure Slow ] [ Linux Debug ] fast/text/international/thai-line-breaks.html [ Pass Failure Slow ] crbug.com/108833 [ Win Debug ] plugins/geturlnotify-during-document-teardown.html [ Crash Failure Timeout ] -webkit.org/b/48655 [ Win Debug ] plugins/js-from-destroy.html [ Crash Timeout ] +webkit.org/b/48655 [ Win ] plugins/js-from-destroy.html [ Crash Timeout ] crbug.com/178745 [ Win Debug ] plugins/open-and-close-window-with-plugin.html [ Crash Failure Timeout ] # Slow on the trunk builder: [ Linux Debug ] fast/js/regress/function-dot-apply.html [ Slow ] crbug.com/249894 [ Linux Debug ] fast/js/regress/inline-arguments-access.html [ Pass Failure Crash Slow ] [ Linux Debug ] fast/js/regress/inline-arguments-local-escape.html [ Slow ] - -# Slow on windows: -webkit.org/b/48655 [ Win ] plugins/js-from-destroy.html [ Crash Slow ] diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index a80f591984..0c1ad6843f 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -361,6 +361,8 @@ '../../src/hydrogen-infer-representation.h', '../../src/hydrogen-infer-types.cc', '../../src/hydrogen-infer-types.h', + '../../src/hydrogen-mark-deoptimize.cc', + '../../src/hydrogen-mark-deoptimize.h', '../../src/hydrogen-minus-zero.cc', '../../src/hydrogen-minus-zero.h', '../../src/hydrogen-range-analysis.cc', diff --git a/deps/v8/tools/run-deopt-fuzzer.py b/deps/v8/tools/run-deopt-fuzzer.py index e53f269aaa..d554a989f1 100755 --- a/deps/v8/tools/run-deopt-fuzzer.py +++ b/deps/v8/tools/run-deopt-fuzzer.py @@ -49,7 +49,7 @@ from testrunner.objects import context ARCH_GUESS = utils.DefaultArch() -DEFAULT_TESTS = ["mjsunit"] +DEFAULT_TESTS = ["mjsunit", "webkit"] TIMEOUT_DEFAULT = 60 TIMEOUT_SCALEFACTOR = {"debug" : 4, "release" : 1 } |