Skip to content
This repository was archived by the owner on May 31, 2019. It is now read-only.

Commit f8e8075

Browse files
ofrobotsAli Sheikh
authored andcommitted
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: v8/v8@4.9.385.18...4.9.385.27 PR-URL: nodejs/node#5494 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
1 parent 206a81f commit f8e8075

26 files changed

+226
-84
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 9
1313
#define V8_BUILD_NUMBER 385
14-
#define V8_PATCH_LEVEL 18
14+
#define V8_PATCH_LEVEL 27
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/include/v8.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,8 @@ class V8_EXPORT StackFrame {
16091609
/**
16101610
* Returns the name of the resource that contains the script for the
16111611
* function for this StackFrame or sourceURL value if the script name
1612-
* is undefined and its source ends with //# sourceURL=... string.
1612+
* is undefined and its source ends with //# sourceURL=... string or
1613+
* deprecated //@ sourceURL=... string.
16131614
*/
16141615
Local<String> GetScriptNameOrSourceURL() const;
16151616

deps/v8/src/builtins.cc

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,11 +1610,35 @@ BUILTIN(ObjectKeys) {
16101610
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
16111611
Execution::ToObject(isolate, object));
16121612
Handle<FixedArray> keys;
1613-
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1614-
isolate, keys,
1615-
JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS,
1616-
CONVERT_TO_STRING));
1617-
return *isolate->factory()->NewJSArrayWithElements(keys);
1613+
1614+
int enum_length = receiver->map()->EnumLength();
1615+
if (enum_length != kInvalidEnumCacheSentinel &&
1616+
JSObject::cast(*receiver)->elements() ==
1617+
isolate->heap()->empty_fixed_array()) {
1618+
DCHECK(receiver->IsJSObject());
1619+
DCHECK(!JSObject::cast(*receiver)->HasNamedInterceptor());
1620+
DCHECK(!JSObject::cast(*receiver)->IsAccessCheckNeeded());
1621+
DCHECK(!HeapObject::cast(receiver->map()->prototype())
1622+
->map()
1623+
->is_hidden_prototype());
1624+
DCHECK(JSObject::cast(*receiver)->HasFastProperties());
1625+
if (enum_length == 0) {
1626+
keys = isolate->factory()->empty_fixed_array();
1627+
} else {
1628+
Handle<FixedArray> cache(
1629+
receiver->map()->instance_descriptors()->GetEnumCache());
1630+
keys = isolate->factory()->NewFixedArray(enum_length);
1631+
for (int i = 0; i < enum_length; i++) {
1632+
keys->set(i, cache->get(i));
1633+
}
1634+
}
1635+
} else {
1636+
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1637+
isolate, keys,
1638+
JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS,
1639+
CONVERT_TO_STRING));
1640+
}
1641+
return *isolate->factory()->NewJSArrayWithElements(keys, FAST_ELEMENTS);
16181642
}
16191643

16201644

deps/v8/src/compiler/ppc/code-generator-ppc.cc

Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,11 +1221,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
12211221
#if V8_TARGET_ARCH_PPC64
12221222
if (check_conversion) {
12231223
// Set 2nd output to zero if conversion fails.
1224-
CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH);
1225-
__ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7
1226-
__ li(i.OutputRegister(1), Operand(1));
1227-
__ isel(i.OutputRegister(1), r0, i.OutputRegister(1),
1228-
v8::internal::Assembler::encode_crbit(cr7, crbit));
1224+
CRegister cr = cr7;
1225+
int crbit = v8::internal::Assembler::encode_crbit(
1226+
cr, static_cast<CRBit>(VXCVI % CRWIDTH));
1227+
__ mcrfs(cr, VXCVI); // extract FPSCR field containing VXCVI into cr7
1228+
if (CpuFeatures::IsSupported(ISELECT)) {
1229+
__ li(i.OutputRegister(1), Operand(1));
1230+
__ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit);
1231+
} else {
1232+
__ li(i.OutputRegister(1), Operand::Zero());
1233+
__ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit);
1234+
__ li(i.OutputRegister(1), Operand(1));
1235+
}
12291236
}
12301237
#endif
12311238
DCHECK_EQ(LeaveRC, i.OutputRCBit());
@@ -1241,11 +1248,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
12411248
i.OutputRegister(0), kScratchDoubleReg);
12421249
if (check_conversion) {
12431250
// Set 2nd output to zero if conversion fails.
1244-
CRBit crbit = static_cast<CRBit>(VXCVI % CRWIDTH);
1245-
__ mcrfs(cr7, VXCVI); // extract FPSCR field containing VXCVI into cr7
1246-
__ li(i.OutputRegister(1), Operand(1));
1247-
__ isel(i.OutputRegister(1), r0, i.OutputRegister(1),
1248-
v8::internal::Assembler::encode_crbit(cr7, crbit));
1251+
CRegister cr = cr7;
1252+
int crbit = v8::internal::Assembler::encode_crbit(
1253+
cr, static_cast<CRBit>(VXCVI % CRWIDTH));
1254+
__ mcrfs(cr, VXCVI); // extract FPSCR field containing VXCVI into cr7
1255+
if (CpuFeatures::IsSupported(ISELECT)) {
1256+
__ li(i.OutputRegister(1), Operand(1));
1257+
__ isel(i.OutputRegister(1), r0, i.OutputRegister(1), crbit);
1258+
} else {
1259+
__ li(i.OutputRegister(1), Operand::Zero());
1260+
__ bc(v8::internal::Assembler::kInstrSize * 2, BT, crbit);
1261+
__ li(i.OutputRegister(1), Operand(1));
1262+
}
12491263
}
12501264
DCHECK_EQ(LeaveRC, i.OutputRCBit());
12511265
break;
@@ -1440,53 +1454,53 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
14401454
PPCOperandConverter i(this, instr);
14411455
Label done;
14421456
ArchOpcode op = instr->arch_opcode();
1443-
bool check_unordered = (op == kPPC_CmpDouble);
14441457
CRegister cr = cr0;
1458+
int reg_value = -1;
14451459

14461460
// Materialize a full 32-bit 1 or 0 value. The result register is always the
14471461
// last output of the instruction.
14481462
DCHECK_NE(0u, instr->OutputCount());
14491463
Register reg = i.OutputRegister(instr->OutputCount() - 1);
14501464

14511465
Condition cond = FlagsConditionToCondition(condition, op);
1452-
switch (cond) {
1453-
case eq:
1454-
case lt:
1466+
if (op == kPPC_CmpDouble) {
1467+
// check for unordered if necessary
1468+
if (cond == le) {
1469+
reg_value = 0;
14551470
__ li(reg, Operand::Zero());
1456-
__ li(kScratchReg, Operand(1));
1457-
__ isel(cond, reg, kScratchReg, reg, cr);
1458-
break;
1459-
case ne:
1460-
case ge:
1471+
__ bunordered(&done, cr);
1472+
} else if (cond == gt) {
1473+
reg_value = 1;
14611474
__ li(reg, Operand(1));
1462-
__ isel(NegateCondition(cond), reg, r0, reg, cr);
1463-
break;
1464-
case gt:
1465-
if (check_unordered) {
1466-
__ li(reg, Operand(1));
1475+
__ bunordered(&done, cr);
1476+
}
1477+
// Unnecessary for eq/lt & ne/ge since only FU bit will be set.
1478+
}
1479+
1480+
if (CpuFeatures::IsSupported(ISELECT)) {
1481+
switch (cond) {
1482+
case eq:
1483+
case lt:
1484+
case gt:
1485+
if (reg_value != 1) __ li(reg, Operand(1));
14671486
__ li(kScratchReg, Operand::Zero());
1468-
__ bunordered(&done, cr);
14691487
__ isel(cond, reg, reg, kScratchReg, cr);
1470-
} else {
1471-
__ li(reg, Operand::Zero());
1472-
__ li(kScratchReg, Operand(1));
1473-
__ isel(cond, reg, kScratchReg, reg, cr);
1474-
}
1475-
break;
1476-
case le:
1477-
if (check_unordered) {
1478-
__ li(reg, Operand::Zero());
1479-
__ li(kScratchReg, Operand(1));
1480-
__ bunordered(&done, cr);
1481-
__ isel(NegateCondition(cond), reg, r0, kScratchReg, cr);
1482-
} else {
1483-
__ li(reg, Operand(1));
1488+
break;
1489+
case ne:
1490+
case ge:
1491+
case le:
1492+
if (reg_value != 1) __ li(reg, Operand(1));
1493+
// r0 implies logical zero in this form
14841494
__ isel(NegateCondition(cond), reg, r0, reg, cr);
1485-
}
1486-
break;
1495+
break;
14871496
default:
14881497
UNREACHABLE();
14891498
break;
1499+
}
1500+
} else {
1501+
if (reg_value != 0) __ li(reg, Operand::Zero());
1502+
__ b(NegateCondition(cond), &done, cr);
1503+
__ li(reg, Operand(1));
14901504
}
14911505
__ bind(&done);
14921506
}

deps/v8/src/compiler/wasm-linkage.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ LinkageLocation stackloc(int i) {
122122
// ===========================================================================
123123
#define GP_PARAM_REGISTERS r3, r4, r5, r6, r7, r8, r9, r10
124124
#define GP_RETURN_REGISTERS r3, r4
125-
#define FP_PARAM_REGISTERS d0, d1, d2, d3, d4, d5, d6, d7
126-
#define FP_RETURN_REGISTERS d0, d1
125+
#define FP_PARAM_REGISTERS d1, d2, d3, d4, d5, d6, d7, d8
126+
#define FP_RETURN_REGISTERS d1, d2
127127

128128
#else
129129
// ===========================================================================

deps/v8/src/debug/debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ class Debug {
477477
return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_);
478478
}
479479
void set_break_points_active(bool v) { break_points_active_ = v; }
480+
bool break_points_active() const { return break_points_active_; }
480481

481482
StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
482483
int break_id() { return thread_local_.break_id_; }

deps/v8/src/js/harmony-unicode-regexps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ utils.Import(function(from) {
2424
// ES6 21.2.5.15.
2525
function RegExpGetUnicode() {
2626
if (!IS_REGEXP(this)) {
27+
// TODO(littledan): Remove this RegExp compat workaround
2728
if (this === GlobalRegExpPrototype) {
2829
%IncrementUseCounter(kRegExpPrototypeUnicodeGetter);
30+
return UNDEFINED;
2931
}
3032
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.unicode");
3133
}

deps/v8/src/js/messages.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,11 @@ function ScriptLineEnd(n) {
432432
* If sourceURL comment is available returns sourceURL comment contents.
433433
* Otherwise, script name is returned. See
434434
* http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
435-
* and Source Map Revision 3 proposal for details on using //# sourceURL
436-
* comment to identify scripts that don't have name.
435+
* and Source Map Revision 3 proposal for details on using //# sourceURL and
436+
* deprecated //@ sourceURL comment to identify scripts that don't have name.
437437
*
438-
* @return {?string} script name if present, value for //# sourceURL comment.
438+
* @return {?string} script name if present, value for //# sourceURL comment or
439+
* deprecated //@ sourceURL comment otherwise.
439440
*/
440441
function ScriptNameOrSourceURL() {
441442
if (this.source_url) return this.source_url;

deps/v8/src/js/regexp.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ function RegExpCompileJS(pattern, flags) {
114114
pattern = REGEXP_SOURCE(pattern);
115115
}
116116

117-
return RegExpInitialize(this, pattern, flags);
117+
RegExpInitialize(this, pattern, flags);
118+
119+
// Return undefined for compatibility with JSC.
120+
// See http://crbug.com/585775 for web compat details.
118121
}
119122

120123

@@ -456,6 +459,10 @@ function RegExpMakeCaptureGetter(n) {
456459
// ES6 21.2.5.4.
457460
function RegExpGetGlobal() {
458461
if (!IS_REGEXP(this)) {
462+
// TODO(littledan): Remove this RegExp compat workaround
463+
if (this === GlobalRegExpPrototype) {
464+
return UNDEFINED;
465+
}
459466
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.global");
460467
}
461468
return !!REGEXP_GLOBAL(this);
@@ -467,6 +474,10 @@ function RegExpGetGlobal() {
467474
// ES6 21.2.5.5.
468475
function RegExpGetIgnoreCase() {
469476
if (!IS_REGEXP(this)) {
477+
// TODO(littledan): Remove this RegExp compat workaround
478+
if (this === GlobalRegExpPrototype) {
479+
return UNDEFINED;
480+
}
470481
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.ignoreCase");
471482
}
472483
return !!REGEXP_IGNORE_CASE(this);
@@ -478,6 +489,10 @@ function RegExpGetIgnoreCase() {
478489
// ES6 21.2.5.7.
479490
function RegExpGetMultiline() {
480491
if (!IS_REGEXP(this)) {
492+
// TODO(littledan): Remove this RegExp compat workaround
493+
if (this === GlobalRegExpPrototype) {
494+
return UNDEFINED;
495+
}
481496
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.multiline");
482497
}
483498
return !!REGEXP_MULTILINE(this);
@@ -489,6 +504,10 @@ function RegExpGetMultiline() {
489504
// ES6 21.2.5.10.
490505
function RegExpGetSource() {
491506
if (!IS_REGEXP(this)) {
507+
// TODO(littledan): Remove this RegExp compat workaround
508+
if (this === GlobalRegExpPrototype) {
509+
return UNDEFINED;
510+
}
492511
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.source");
493512
}
494513
return REGEXP_SOURCE(this);

deps/v8/src/objects.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8653,10 +8653,17 @@ static Maybe<bool> GetKeysFromJSObject(Isolate* isolate,
86538653
// use the cache says yes, so we should not create a cache.
86548654
Handle<JSFunction> arguments_function(
86558655
JSFunction::cast(isolate->sloppy_arguments_map()->GetConstructor()));
8656+
bool has_hidden_prototype = false;
8657+
Object* prototype = object->map()->prototype();
8658+
if (prototype->IsJSObject()) {
8659+
has_hidden_prototype =
8660+
JSObject::cast(prototype)->map()->is_hidden_prototype();
8661+
}
86568662
bool cache_enum_length =
86578663
((object->map()->GetConstructor() != *arguments_function) &&
86588664
!object->IsJSValue() && !object->IsAccessCheckNeeded() &&
8659-
!object->HasNamedInterceptor() && !object->HasIndexedInterceptor());
8665+
!object->HasNamedInterceptor() && !object->HasIndexedInterceptor() &&
8666+
!has_hidden_prototype);
86608667
// Compute the property keys and cache them if possible.
86618668
Handle<FixedArray> enum_keys =
86628669
JSObject::GetEnumPropertyKeys(object, cache_enum_length);

0 commit comments

Comments
 (0)