Skip to content

Commit

Permalink
deps: upgrade to V8 4.9.385.27
Browse files Browse the repository at this point in the history
Pick up the latest known good release from the V8 4.9 branch: 4.9.385.27.
V8 Commits: v8/v8@4.9.385.18...4.9.385.27

PR-URL: #5494
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
Reviewed-By: targos - Michaël Zasso <[email protected]>
  • Loading branch information
ofrobots authored and Ali Sheikh committed Mar 4, 2016
1 parent 206a81f commit f8e8075
Show file tree
Hide file tree
Showing 26 changed files with 226 additions and 84 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 9
#define V8_BUILD_NUMBER 385
#define V8_PATCH_LEVEL 18
#define V8_PATCH_LEVEL 27

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,8 @@ class V8_EXPORT StackFrame {
/**
* Returns the name of the resource that contains the script for the
* function for this StackFrame or sourceURL value if the script name
* is undefined and its source ends with //# sourceURL=... string.
* is undefined and its source ends with //# sourceURL=... string or
* deprecated //@ sourceURL=... string.
*/
Local<String> GetScriptNameOrSourceURL() const;

Expand Down
34 changes: 29 additions & 5 deletions deps/v8/src/builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
96 changes: 55 additions & 41 deletions deps/v8/src/compiler/ppc/code-generator-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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;
Expand Down Expand Up @@ -1440,53 +1454,53 @@ 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.
DCHECK_NE(0u, instr->OutputCount());
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);
}
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/compiler/wasm-linkage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ===========================================================================
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/debug/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/js/harmony-unicode-regexps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/js/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 20 additions & 1 deletion deps/v8/src/js/regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}


Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion deps/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/parsing/parser-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/parsing/scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -574,7 +574,7 @@ void Scanner::Scan() {
Advance();
if (c0_ == '/') {
Advance();
if (c0_ == '#') {
if (c0_ == '#' || c0_ == '@') {
Advance();
token = SkipSourceURLComment();
} else {
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/runtime/runtime-debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 6 additions & 0 deletions deps/v8/test/cctest/test-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17060,6 +17060,8 @@ TEST(SourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=eval_url");
CHECK(CompileRun(code.start())->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=eval_url");
CHECK(CompileRun(code.start())->IsUndefined());
}


Expand Down Expand Up @@ -17140,6 +17142,8 @@ TEST(InlineScriptWithSourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined());
}


Expand Down Expand Up @@ -17184,6 +17188,8 @@ TEST(DynamicWithSourceURLInStackTrace) {
i::ScopedVector<char> code(1024);
i::SNPrintF(code, source, "//# sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
i::SNPrintF(code, source, "//@ sourceURL=source_url");
CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined());
}


Expand Down
Loading

0 comments on commit f8e8075

Please sign in to comment.