| Index: src/full-codegen/x64/full-codegen-x64.cc
|
| diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
|
| index 50a5af56d1ad4dfb765ad5b114e11fa4bb95de33..275523df3a5496f303a83257433213a766692259 100644
|
| --- a/src/full-codegen/x64/full-codegen-x64.cc
|
| +++ b/src/full-codegen/x64/full-codegen-x64.cc
|
| @@ -1925,6 +1925,33 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitClassDefineNameProperty(ClassLiteral* lit) {
|
| + DCHECK(!lit->constructor()->name().is_null());
|
| +
|
| + // abort if 'name' is undefined
|
| + if (lit->constructor()->name()->length() == 0) return;
|
| +
|
| + Label exit;
|
| +
|
| + // if "name" is already defined, exit
|
| + PushOperand(Operand(rsp, 0)); // constructor
|
| + PushOperand(isolate()->factory()->name_string());
|
| + CallRuntimeWithOperands(Runtime::kObjectHasOwnProperty);
|
| + __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
|
| + __ j(equal, &exit, Label::kNear);
|
| +
|
| + // define "name" property
|
| + PushOperand(Operand(rsp, 0)); // constructor
|
| + PushOperand(isolate()->factory()->name_string());
|
| + PushOperand(lit->constructor()->name());
|
| + PushOperand(Smi::FromInt(DONT_ENUM | READ_ONLY));
|
| + PushOperand(Smi::FromInt(0)); // NeedsSetFunctionName()
|
| + CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
|
| +
|
| + __ bind(&exit);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
|
| PopOperand(rdx);
|
| Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
|
|
|