Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade to V8 5.0.71.52 #6928

Merged
merged 1 commit into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 5
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 71
#define V8_PATCH_LEVEL 47
#define V8_PATCH_LEVEL 52

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
30 changes: 11 additions & 19 deletions deps/v8/src/compiler/js-create-lowering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,17 @@ Node* JSCreateLowering::AllocateFastLiteral(
site_context->ExitScope(current_site, boilerplate_object);
} else if (property_details.representation().IsDouble()) {
// Allocate a mutable HeapNumber box and store the value into it.
value = effect = AllocateMutableHeapNumber(
Handle<HeapNumber>::cast(boilerplate_value)->value(),
Callable callable = CodeFactory::AllocateMutableHeapNumber(isolate());
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), jsgraph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kNoThrow);
value = effect = graph()->NewNode(
common()->Call(desc), jsgraph()->HeapConstant(callable.code()),
jsgraph()->NoContextConstant(), effect, control);
effect = graph()->NewNode(
simplified()->StoreField(AccessBuilder::ForHeapNumberValue()),
value, jsgraph()->Constant(
Handle<HeapNumber>::cast(boilerplate_value)->value()),
effect, control);
} else if (property_details.representation().IsSmi()) {
// Ensure that value is stored as smi.
Expand Down Expand Up @@ -1028,23 +1037,6 @@ Node* JSCreateLowering::AllocateFastLiteralElements(
return builder.Finish();
}

Node* JSCreateLowering::AllocateMutableHeapNumber(double value, Node* effect,
Node* control) {
// TODO(turbofan): Support inline allocation of MutableHeapNumber
// (requires proper alignment on Allocate, and Begin/FinishRegion).
Callable callable = CodeFactory::AllocateMutableHeapNumber(isolate());
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), jsgraph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kNoThrow);
Node* result = effect = graph()->NewNode(
common()->Call(desc), jsgraph()->HeapConstant(callable.code()),
jsgraph()->NoContextConstant(), effect, control);
effect = graph()->NewNode(
simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), result,
jsgraph()->Constant(value), effect, control);
return result;
}

MaybeHandle<LiteralsArray> JSCreateLowering::GetSpecializationLiterals(
Node* node) {
Node* const closure = NodeProperties::GetValueInput(node, 0);
Expand Down
1 change: 0 additions & 1 deletion deps/v8/src/compiler/js-create-lowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class JSCreateLowering final : public AdvancedReducer {
Handle<JSObject> boilerplate,
PretenureFlag pretenure,
AllocationSiteUsageContext* site_context);
Node* AllocateMutableHeapNumber(double value, Node* effect, Node* control);

// Infers the LiteralsArray to use for a given {node}.
MaybeHandle<LiteralsArray> GetSpecializationLiterals(Node* node);
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/arm/lithium-codegen-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2443,11 +2443,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true,

__ JumpIfSmi(input, is_false);

__ CompareObjectType(input, temp, temp2, JS_FUNCTION_TYPE);
__ CompareObjectType(input, temp, temp2, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ b(eq, is_true);
__ b(hs, is_true);
} else {
__ b(eq, is_false);
__ b(hs, is_false);
}

// Check if the constructor in the map is a function.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/arm64/lithium-codegen-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2225,11 +2225,12 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
__ JumpIfSmi(input, false_label);

Register map = scratch2;
__ CompareObjectType(input, map, scratch1, JS_FUNCTION_TYPE);
__ CompareObjectType(input, map, scratch1, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ B(eq, true_label);
__ B(hs, true_label);
} else {
__ B(eq, false_label);
__ B(hs, false_label);
}

// Check if the constructor in the map is a function.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/ia32/lithium-codegen-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2342,11 +2342,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
DCHECK(!temp.is(temp2));
__ JumpIfSmi(input, is_false);

__ CmpObjectType(input, JS_FUNCTION_TYPE, temp);
__ CmpObjectType(input, FIRST_FUNCTION_TYPE, temp);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ j(equal, is_true);
__ j(above_equal, is_true);
} else {
__ j(equal, is_false);
__ j(above_equal, is_false);
}

// Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/crankshaft/mips/lithium-codegen-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2355,10 +2355,11 @@ void LCodeGen::EmitClassOfTest(Label* is_true,

__ JumpIfSmi(input, is_false);
__ GetObjectType(input, temp, temp2);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ Branch(is_true, eq, temp2, Operand(JS_FUNCTION_TYPE));
__ Branch(is_true, hs, temp2, Operand(FIRST_FUNCTION_TYPE));
} else {
__ Branch(is_false, eq, temp2, Operand(JS_FUNCTION_TYPE));
__ Branch(is_false, hs, temp2, Operand(FIRST_FUNCTION_TYPE));
}

// Check if the constructor in the map is a function.
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/crankshaft/mips64/lithium-codegen-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2473,10 +2473,11 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
__ JumpIfSmi(input, is_false);

__ GetObjectType(input, temp, temp2);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ Branch(is_true, eq, temp2, Operand(JS_FUNCTION_TYPE));
__ Branch(is_true, hs, temp2, Operand(FIRST_FUNCTION_TYPE));
} else {
__ Branch(is_false, eq, temp2, Operand(JS_FUNCTION_TYPE));
__ Branch(is_false, hs, temp2, Operand(FIRST_FUNCTION_TYPE));
}

// Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/ppc/lithium-codegen-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2498,11 +2498,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false,

__ JumpIfSmi(input, is_false);

__ CompareObjectType(input, temp, temp2, JS_FUNCTION_TYPE);
__ CompareObjectType(input, temp, temp2, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ beq(is_true);
__ bge(is_true);
} else {
__ beq(is_false);
__ bge(is_false);
}

// Check if the constructor in the map is a function.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/x64/lithium-codegen-x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2393,11 +2393,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true,

__ JumpIfSmi(input, is_false);

__ CmpObjectType(input, JS_FUNCTION_TYPE, temp);
__ CmpObjectType(input, FIRST_FUNCTION_TYPE, temp);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ j(equal, is_true);
__ j(above_equal, is_true);
} else {
__ j(equal, is_false);
__ j(above_equal, is_false);
}

// Check if the constructor in the map is a function.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/crankshaft/x87/lithium-codegen-x87.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2629,11 +2629,12 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
DCHECK(!temp.is(temp2));
__ JumpIfSmi(input, is_false);

__ CmpObjectType(input, JS_FUNCTION_TYPE, temp);
__ CmpObjectType(input, FIRST_FUNCTION_TYPE, temp);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
__ j(equal, is_true);
__ j(above_equal, is_true);
} else {
__ j(equal, is_false);
__ j(above_equal, is_false);
}

// Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/full-codegen/arm/full-codegen-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3075,9 +3075,10 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
// Map is now in r0.
__ b(lt, &null);

// Return 'Function' for JSFunction objects.
__ cmp(r1, Operand(JS_FUNCTION_TYPE));
__ b(eq, &function);
// Return 'Function' for JSFunction and JSBoundFunction objects.
__ cmp(r1, Operand(FIRST_FUNCTION_TYPE));
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ b(hs, &function);

// Check if the constructor in the map is a JS function.
Register instance_type = r2;
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2863,8 +2863,9 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ B(lt, &null);

// Return 'Function' for JSFunction objects.
__ Cmp(x11, JS_FUNCTION_TYPE);
__ B(eq, &function);
__ Cmp(x11, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ B(hs, &function);

// Check if the constructor in the map is a JS function.
Register instance_type = x14;
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2953,9 +2953,10 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, eax);
__ j(below, &null, Label::kNear);

// Return 'Function' for JSFunction objects.
__ CmpInstanceType(eax, JS_FUNCTION_TYPE);
__ j(equal, &function, Label::kNear);
// Return 'Function' for JSFunction and JSBoundFunction objects.
__ CmpInstanceType(eax, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ j(above_equal, &function, Label::kNear);

// Check if the constructor in the map is a JS function.
__ GetMapConstructor(eax, eax, ebx);
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/full-codegen/mips/full-codegen-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3073,8 +3073,9 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ GetObjectType(v0, v0, a1); // Map is now in v0.
__ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE));

// Return 'Function' for JSFunction objects.
__ Branch(&function, eq, a1, Operand(JS_FUNCTION_TYPE));
// Return 'Function' for JSFunction and JSBoundFunction objects.
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ Branch(&function, hs, a1, Operand(FIRST_FUNCTION_TYPE));

// Check if the constructor in the map is a JS function.
Register instance_type = a2;
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3077,8 +3077,9 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ GetObjectType(v0, v0, a1); // Map is now in v0.
__ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE));

// Return 'Function' for JSFunction objects.
__ Branch(&function, eq, a1, Operand(JS_FUNCTION_TYPE));
// Return 'Function' for JSFunction and JSBoundFunction objects.
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ Branch(&function, hs, a1, Operand(FIRST_FUNCTION_TYPE));

// Check if the constructor in the map is a JS function.
Register instance_type = a2;
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3077,9 +3077,10 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
// Map is now in r3.
__ blt(&null);

// Return 'Function' for JSFunction objects.
__ cmpi(r4, Operand(JS_FUNCTION_TYPE));
__ beq(&function);
// Return 'Function' for JSFunction and JSBoundFunction objects.
__ cmpli(r4, Operand(FIRST_FUNCTION_TYPE));
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ bge(&function);

// Check if the constructor in the map is a JS function.
Register instance_type = r5;
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/full-codegen/x64/full-codegen-x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2944,9 +2944,10 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rax);
__ j(below, &null, Label::kNear);

// Return 'Function' for JSFunction objects.
__ CmpInstanceType(rax, JS_FUNCTION_TYPE);
__ j(equal, &function, Label::kNear);
// Return 'Function' for JSFunction and JSBoundFunction objects.
__ CmpInstanceType(rax, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ j(above_equal, &function, Label::kNear);

// Check if the constructor in the map is a JS function.
__ GetMapConstructor(rax, rax, rbx);
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/full-codegen/x87/full-codegen-x87.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2945,9 +2945,10 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
__ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, eax);
__ j(below, &null, Label::kNear);

// Return 'Function' for JSFunction objects.
__ CmpInstanceType(eax, JS_FUNCTION_TYPE);
__ j(equal, &function, Label::kNear);
// Return 'Function' for JSFunction and JSBoundFunction objects.
__ CmpInstanceType(eax, FIRST_FUNCTION_TYPE);
STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
__ j(above_equal, &function, Label::kNear);

// Check if the constructor in the map is a JS function.
__ GetMapConstructor(eax, eax, ebx);
Expand Down
31 changes: 26 additions & 5 deletions deps/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,14 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
case LookupIterator::NOT_FOUND:
case LookupIterator::TRANSITION:
UNREACHABLE();
case LookupIterator::JSPROXY:
return JSProxy::GetProperty(it->isolate(), it->GetHolder<JSProxy>(),
it->GetName(), it->GetReceiver());
case LookupIterator::JSPROXY: {
bool was_found;
MaybeHandle<Object> result =
JSProxy::GetProperty(it->isolate(), it->GetHolder<JSProxy>(),
it->GetName(), it->GetReceiver(), &was_found);
if (!was_found) it->NotFound();
return result;
}
case LookupIterator::INTERCEPTOR: {
bool done;
Handle<Object> result;
Expand Down Expand Up @@ -756,7 +761,9 @@ MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
Handle<JSProxy> proxy,
Handle<Name> name,
Handle<Object> receiver) {
Handle<Object> receiver,
bool* was_found) {
*was_found = true;
if (receiver->IsJSGlobalObject()) {
THROW_NEW_ERROR(
isolate,
Expand Down Expand Up @@ -789,7 +796,9 @@ MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
// 7.a Return target.[[Get]](P, Receiver).
LookupIterator it =
LookupIterator::PropertyOrElement(isolate, receiver, name, target);
return Object::GetProperty(&it);
MaybeHandle<Object> result = Object::GetProperty(&it);
*was_found = it.IsFound();
return result;
}
// 8. Let trapResult be ? Call(trap, handler, «target, P, Receiver»).
Handle<Object> trap_result;
Expand Down Expand Up @@ -13345,6 +13354,18 @@ Handle<String> JSBoundFunction::ToString(Handle<JSBoundFunction> function) {
return isolate->factory()->NewStringFromAsciiChecked(kNativeCodeSource);
}

// static
MaybeHandle<String> JSBoundFunction::GetName(Isolate* isolate,
Handle<JSBoundFunction> function) {
Handle<String> prefix = isolate->factory()->bound__string();
if (!function->bound_target_function()->IsJSFunction()) return prefix;
Handle<JSFunction> target(JSFunction::cast(function->bound_target_function()),
isolate);
Handle<Object> target_name = JSFunction::GetName(target);
if (!target_name->IsString()) return prefix;
Factory* factory = isolate->factory();
return factory->NewConsString(prefix, Handle<String>::cast(target_name));
}

// static
Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
Expand Down
5 changes: 4 additions & 1 deletion deps/v8/src/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -7394,6 +7394,9 @@ class JSBoundFunction : public JSObject {
// to ES6 section 19.2.3.5 Function.prototype.toString ( ).
static Handle<String> ToString(Handle<JSBoundFunction> function);

static MaybeHandle<String> GetName(Isolate* isolate,
Handle<JSBoundFunction> function);

// Layout description.
static const int kBoundTargetFunctionOffset = JSObject::kHeaderSize;
static const int kBoundThisOffset = kBoundTargetFunctionOffset + kPointerSize;
Expand Down Expand Up @@ -9731,7 +9734,7 @@ class JSProxy: public JSReceiver {
// ES6 9.5.8
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
Isolate* isolate, Handle<JSProxy> proxy, Handle<Name> name,
Handle<Object> receiver);
Handle<Object> receiver, bool* was_found);

// ES6 9.5.9
MUST_USE_RESULT static Maybe<bool> SetProperty(Handle<JSProxy> proxy,
Expand Down
6 changes: 5 additions & 1 deletion deps/v8/src/parsing/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4536,14 +4536,18 @@ class InitializerRewriter : public AstExpressionVisitor {
scope_(scope) {}

private:
void VisitExpression(Expression* expr) {
void VisitExpression(Expression* expr) override {
RewritableExpression* to_rewrite = expr->AsRewritableExpression();
if (to_rewrite == nullptr || to_rewrite->is_rewritten()) return;

Parser::PatternRewriter::RewriteDestructuringAssignment(parser_, to_rewrite,
scope_);
}

// Code in function literals does not need to be eagerly rewritten, it will be
// rewritten when scheduled.
void VisitFunctionLiteral(FunctionLiteral* expr) override {}

private:
Parser* parser_;
Scope* scope_;
Expand Down
Loading