diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2016-02-29 13:21:43 -0800 |
---|---|---|
committer | Ali Sheikh <ofrobots@lemonhope.roam.corp.google.com> | 2016-03-03 20:35:20 -0800 |
commit | f8e8075a62f910b33e6a2a93afdfe7b4df482264 (patch) | |
tree | ee9a0d6fa9f66cf8c49ddaeed034ab9cc9620ebe /deps/v8/src | |
parent | 206a81fb145e5e8bfaa8de256e9bf1a9c8815fae (diff) | |
download | android-node-v8-f8e8075a62f910b33e6a2a93afdfe7b4df482264.tar.gz android-node-v8-f8e8075a62f910b33e6a2a93afdfe7b4df482264.tar.bz2 android-node-v8-f8e8075a62f910b33e6a2a93afdfe7b4df482264.zip |
deps: upgrade to V8 4.9.385.27
Pick up the latest known good release from the V8 4.9 branch: 4.9.385.27.
V8 Commits: https://github.com/v8/v8/compare/4.9.385.18...4.9.385.27
PR-URL: https://github.com/nodejs/node/pull/5494
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com>
Diffstat (limited to 'deps/v8/src')
-rw-r--r-- | deps/v8/src/builtins.cc | 34 | ||||
-rw-r--r-- | deps/v8/src/compiler/ppc/code-generator-ppc.cc | 96 | ||||
-rw-r--r-- | deps/v8/src/compiler/wasm-linkage.cc | 4 | ||||
-rw-r--r-- | deps/v8/src/debug/debug.h | 1 | ||||
-rw-r--r-- | deps/v8/src/js/harmony-unicode-regexps.js | 2 | ||||
-rw-r--r-- | deps/v8/src/js/messages.js | 7 | ||||
-rw-r--r-- | deps/v8/src/js/regexp.js | 21 | ||||
-rw-r--r-- | deps/v8/src/objects.cc | 9 | ||||
-rw-r--r-- | deps/v8/src/parsing/parser-base.h | 5 | ||||
-rw-r--r-- | deps/v8/src/parsing/scanner.cc | 4 | ||||
-rw-r--r-- | deps/v8/src/runtime/runtime-debug.cc | 4 |
11 files changed, 129 insertions, 58 deletions
diff --git a/deps/v8/src/builtins.cc b/deps/v8/src/builtins.cc index 77df498a07..34b370fe66 100644 --- a/deps/v8/src/builtins.cc +++ b/deps/v8/src/builtins.cc @@ -1610,11 +1610,35 @@ BUILTIN(ObjectKeys) { ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, Execution::ToObject(isolate, object)); Handle<FixedArray> keys; - ASSIGN_RETURN_FAILURE_ON_EXCEPTION( - isolate, keys, - JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS, - CONVERT_TO_STRING)); - return *isolate->factory()->NewJSArrayWithElements(keys); + + int enum_length = receiver->map()->EnumLength(); + if (enum_length != kInvalidEnumCacheSentinel && + JSObject::cast(*receiver)->elements() == + isolate->heap()->empty_fixed_array()) { + DCHECK(receiver->IsJSObject()); + DCHECK(!JSObject::cast(*receiver)->HasNamedInterceptor()); + DCHECK(!JSObject::cast(*receiver)->IsAccessCheckNeeded()); + DCHECK(!HeapObject::cast(receiver->map()->prototype()) + ->map() + ->is_hidden_prototype()); + DCHECK(JSObject::cast(*receiver)->HasFastProperties()); + if (enum_length == 0) { + keys = isolate->factory()->empty_fixed_array(); + } else { + Handle<FixedArray> cache( + receiver->map()->instance_descriptors()->GetEnumCache()); + keys = isolate->factory()->NewFixedArray(enum_length); + for (int i = 0; i < enum_length; i++) { + keys->set(i, cache->get(i)); + } + } + } else { + ASSIGN_RETURN_FAILURE_ON_EXCEPTION( + isolate, keys, + JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS, + CONVERT_TO_STRING)); + } + return *isolate->factory()->NewJSArrayWithElements(keys, FAST_ELEMENTS); } diff --git a/deps/v8/src/compiler/ppc/code-generator-ppc.cc b/deps/v8/src/compiler/ppc/code-generator-ppc.cc index 6fe674e4f2..154cd644bd 100644 --- a/deps/v8/src/compiler/ppc/code-generator-ppc.cc +++ b/deps/v8/src/compiler/ppc/code-generator-ppc.cc @@ -1221,11 +1221,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { #if V8_TARGET_ARCH_PPC64 if (check_conversion) { // Set 2nd output to zero if conversion fails. - CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH); - __ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7 - __ li(i.OutputRegister(1), Operand(1)); - __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), - v8::internal::Assembler::encode_crbit(cr7, crbit)); + CRegister cr = cr7; + int crbit = v8::internal::Assembler::encode_crbit( + cr, static_cast<CRBit>(VXCVI % CRWIDTH)); + __ mcrfs(cr, VXCVI); // extract FPSCR field containing VXCVI into cr7 + if (CpuFeatures::IsSupported(ISELECT)) { + __ li(i.OutputRegister(1), Operand(1)); + __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit); + } else { + __ li(i.OutputRegister(1), Operand::Zero()); + __ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit); + __ li(i.OutputRegister(1), Operand(1)); + } } #endif DCHECK_EQ(LeaveRC, i.OutputRCBit()); @@ -1241,11 +1248,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { i.OutputRegister(0), kScratchDoubleReg); if (check_conversion) { // Set 2nd output to zero if conversion fails. - CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH); - __ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7 - __ li(i.OutputRegister(1), Operand(1)); - __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), - v8::internal::Assembler::encode_crbit(cr7, crbit)); + CRegister cr = cr7; + int crbit = v8::internal::Assembler::encode_crbit( + cr, static_cast<CRBit>(VXCVI % CRWIDTH)); + __ mcrfs(cr, VXCVI); // extract FPSCR field containing VXCVI into cr7 + if (CpuFeatures::IsSupported(ISELECT)) { + __ li(i.OutputRegister(1), Operand(1)); + __ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit); + } else { + __ li(i.OutputRegister(1), Operand::Zero()); + __ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit); + __ li(i.OutputRegister(1), Operand(1)); + } } DCHECK_EQ(LeaveRC, i.OutputRCBit()); break; @@ -1440,8 +1454,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, PPCOperandConverter i(this, instr); Label done; ArchOpcode op = instr->arch_opcode(); - bool check_unordered = (op == kPPC_CmpDouble); CRegister cr = cr0; + int reg_value = -1; // Materialize a full 32-bit 1 or 0 value. The result register is always the // last output of the instruction. @@ -1449,44 +1463,44 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, Register reg = i.OutputRegister(instr->OutputCount() - 1); Condition cond = FlagsConditionToCondition(condition, op); - switch (cond) { - case eq: - case lt: + if (op == kPPC_CmpDouble) { + // check for unordered if necessary + if (cond == le) { + reg_value = 0; __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ isel(cond, reg, kScratchReg, reg, cr); - break; - case ne: - case ge: + __ bunordered(&done, cr); + } else if (cond == gt) { + reg_value = 1; __ li(reg, Operand(1)); - __ isel(NegateCondition(cond), reg, r0, reg, cr); - break; - case gt: - if (check_unordered) { - __ li(reg, Operand(1)); + __ bunordered(&done, cr); + } + // Unnecessary for eq/lt & ne/ge since only FU bit will be set. + } + + if (CpuFeatures::IsSupported(ISELECT)) { + switch (cond) { + case eq: + case lt: + case gt: + if (reg_value != 1) __ li(reg, Operand(1)); __ li(kScratchReg, Operand::Zero()); - __ bunordered(&done, cr); __ isel(cond, reg, reg, kScratchReg, cr); - } else { - __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ isel(cond, reg, kScratchReg, reg, cr); - } - break; - case le: - if (check_unordered) { - __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ bunordered(&done, cr); - __ isel(NegateCondition(cond), reg, r0, kScratchReg, cr); - } else { - __ li(reg, Operand(1)); + break; + case ne: + case ge: + case le: + if (reg_value != 1) __ li(reg, Operand(1)); + // r0 implies logical zero in this form __ isel(NegateCondition(cond), reg, r0, reg, cr); - } - break; + break; default: UNREACHABLE(); break; + } + } else { + if (reg_value != 0) __ li(reg, Operand::Zero()); + __ b(NegateCondition(cond), &done, cr); + __ li(reg, Operand(1)); } __ bind(&done); } diff --git a/deps/v8/src/compiler/wasm-linkage.cc b/deps/v8/src/compiler/wasm-linkage.cc index 7419a5c31f..92363dd430 100644 --- a/deps/v8/src/compiler/wasm-linkage.cc +++ b/deps/v8/src/compiler/wasm-linkage.cc @@ -122,8 +122,8 @@ LinkageLocation stackloc(int i) { // =========================================================================== #define GP_PARAM_REGISTERS r3, r4, r5, r6, r7, r8, r9, r10 #define GP_RETURN_REGISTERS r3, r4 -#define FP_PARAM_REGISTERS d0, d1, d2, d3, d4, d5, d6, d7 -#define FP_RETURN_REGISTERS d0, d1 +#define FP_PARAM_REGISTERS d1, d2, d3, d4, d5, d6, d7, d8 +#define FP_RETURN_REGISTERS d1, d2 #else // =========================================================================== diff --git a/deps/v8/src/debug/debug.h b/deps/v8/src/debug/debug.h index 4b098db49a..7dcc2b5e34 100644 --- a/deps/v8/src/debug/debug.h +++ b/deps/v8/src/debug/debug.h @@ -477,6 +477,7 @@ class Debug { return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_); } void set_break_points_active(bool v) { break_points_active_ = v; } + bool break_points_active() const { return break_points_active_; } StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } int break_id() { return thread_local_.break_id_; } diff --git a/deps/v8/src/js/harmony-unicode-regexps.js b/deps/v8/src/js/harmony-unicode-regexps.js index aa8fc76bd5..b24bbdf2c5 100644 --- a/deps/v8/src/js/harmony-unicode-regexps.js +++ b/deps/v8/src/js/harmony-unicode-regexps.js @@ -24,8 +24,10 @@ utils.Import(function(from) { // ES6 21.2.5.15. function RegExpGetUnicode() { if (!IS_REGEXP(this)) { + // TODO(littledan): Remove this RegExp compat workaround if (this === GlobalRegExpPrototype) { %IncrementUseCounter(kRegExpPrototypeUnicodeGetter); + return UNDEFINED; } throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.unicode"); } diff --git a/deps/v8/src/js/messages.js b/deps/v8/src/js/messages.js index 6b7306a7d3..feb14d3788 100644 --- a/deps/v8/src/js/messages.js +++ b/deps/v8/src/js/messages.js @@ -432,10 +432,11 @@ function ScriptLineEnd(n) { * If sourceURL comment is available returns sourceURL comment contents. * Otherwise, script name is returned. See * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt - * and Source Map Revision 3 proposal for details on using //# sourceURL - * comment to identify scripts that don't have name. + * and Source Map Revision 3 proposal for details on using //# sourceURL and + * deprecated //@ sourceURL comment to identify scripts that don't have name. * - * @return {?string} script name if present, value for //# sourceURL comment. + * @return {?string} script name if present, value for //# sourceURL comment or + * deprecated //@ sourceURL comment otherwise. */ function ScriptNameOrSourceURL() { if (this.source_url) return this.source_url; diff --git a/deps/v8/src/js/regexp.js b/deps/v8/src/js/regexp.js index a163952451..eeacd6eb9e 100644 --- a/deps/v8/src/js/regexp.js +++ b/deps/v8/src/js/regexp.js @@ -114,7 +114,10 @@ function RegExpCompileJS(pattern, flags) { pattern = REGEXP_SOURCE(pattern); } - return RegExpInitialize(this, pattern, flags); + RegExpInitialize(this, pattern, flags); + + // Return undefined for compatibility with JSC. + // See http://crbug.com/585775 for web compat details. } @@ -456,6 +459,10 @@ function RegExpMakeCaptureGetter(n) { // ES6 21.2.5.4. function RegExpGetGlobal() { if (!IS_REGEXP(this)) { + // TODO(littledan): Remove this RegExp compat workaround + if (this === GlobalRegExpPrototype) { + return UNDEFINED; + } throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.global"); } return !!REGEXP_GLOBAL(this); @@ -467,6 +474,10 @@ function RegExpGetGlobal() { // ES6 21.2.5.5. function RegExpGetIgnoreCase() { if (!IS_REGEXP(this)) { + // TODO(littledan): Remove this RegExp compat workaround + if (this === GlobalRegExpPrototype) { + return UNDEFINED; + } throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.ignoreCase"); } return !!REGEXP_IGNORE_CASE(this); @@ -478,6 +489,10 @@ function RegExpGetIgnoreCase() { // ES6 21.2.5.7. function RegExpGetMultiline() { if (!IS_REGEXP(this)) { + // TODO(littledan): Remove this RegExp compat workaround + if (this === GlobalRegExpPrototype) { + return UNDEFINED; + } throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.multiline"); } return !!REGEXP_MULTILINE(this); @@ -489,6 +504,10 @@ function RegExpGetMultiline() { // ES6 21.2.5.10. function RegExpGetSource() { if (!IS_REGEXP(this)) { + // TODO(littledan): Remove this RegExp compat workaround + if (this === GlobalRegExpPrototype) { + return UNDEFINED; + } throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.source"); } return REGEXP_SOURCE(this); diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index ef846d6c42..d9d8213e24 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -8653,10 +8653,17 @@ static Maybe<bool> GetKeysFromJSObject(Isolate* isolate, // use the cache says yes, so we should not create a cache. Handle<JSFunction> arguments_function( JSFunction::cast(isolate->sloppy_arguments_map()->GetConstructor())); + bool has_hidden_prototype = false; + Object* prototype = object->map()->prototype(); + if (prototype->IsJSObject()) { + has_hidden_prototype = + JSObject::cast(prototype)->map()->is_hidden_prototype(); + } bool cache_enum_length = ((object->map()->GetConstructor() != *arguments_function) && !object->IsJSValue() && !object->IsAccessCheckNeeded() && - !object->HasNamedInterceptor() && !object->HasIndexedInterceptor()); + !object->HasNamedInterceptor() && !object->HasIndexedInterceptor() && + !has_hidden_prototype); // Compute the property keys and cache them if possible. Handle<FixedArray> enum_keys = JSObject::GetEnumPropertyKeys(object, cache_enum_length); diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index 2955b0b9d9..d9da445977 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -2151,7 +2151,8 @@ ParserBase<Traits>::ParseYieldExpression(ExpressionClassifier* classifier, // YieldExpression :: // 'yield' ([no line terminator] '*'? AssignmentExpression)? int pos = peek_position(); - BindingPatternUnexpectedToken(classifier); + classifier->RecordPatternError(scanner()->peek_location(), + MessageTemplate::kInvalidDestructuringTarget); FormalParameterInitializerUnexpectedToken(classifier); Expect(Token::YIELD, CHECK_OK); ExpressionT generator_object = @@ -3060,7 +3061,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral( // Multiple statement body Consume(Token::LBRACE); bool is_lazily_parsed = - (mode() == PARSE_LAZILY && scope_->AllowsLazyCompilation()); + (mode() == PARSE_LAZILY && scope_->AllowsLazyParsing()); if (is_lazily_parsed) { body = this->NewStatementList(0, zone()); this->SkipLazyFunctionBody(&materialized_literal_count, diff --git a/deps/v8/src/parsing/scanner.cc b/deps/v8/src/parsing/scanner.cc index 19fab9355e..73175934b5 100644 --- a/deps/v8/src/parsing/scanner.cc +++ b/deps/v8/src/parsing/scanner.cc @@ -356,7 +356,7 @@ Token::Value Scanner::SkipSourceURLComment() { void Scanner::TryToParseSourceURLComment() { - // Magic comments are of the form: //[#]\s<name>=\s*<value>\s*.* and this + // Magic comments are of the form: //[#@]\s<name>=\s*<value>\s*.* and this // function will just return if it cannot parse a magic comment. if (c0_ < 0 || !unicode_cache_->IsWhiteSpace(c0_)) return; Advance(); @@ -574,7 +574,7 @@ void Scanner::Scan() { Advance(); if (c0_ == '/') { Advance(); - if (c0_ == '#') { + if (c0_ == '#' || c0_ == '@') { Advance(); token = SkipSourceURLComment(); } else { diff --git a/deps/v8/src/runtime/runtime-debug.cc b/deps/v8/src/runtime/runtime-debug.cc index d94c75fa0e..80791dea76 100644 --- a/deps/v8/src/runtime/runtime-debug.cc +++ b/deps/v8/src/runtime/runtime-debug.cc @@ -30,7 +30,9 @@ RUNTIME_FUNCTION(Runtime_DebugBreak) { RUNTIME_FUNCTION(Runtime_HandleDebuggerStatement) { SealHandleScope shs(isolate); DCHECK(args.length() == 0); - isolate->debug()->HandleDebugBreak(); + if (isolate->debug()->break_points_active()) { + isolate->debug()->HandleDebugBreak(); + } return isolate->heap()->undefined_value(); } |