Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Use an accessor instead of a data property Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 break; 1893 break;
1894 1894
1895 case ClassLiteral::Property::FIELD: 1895 case ClassLiteral::Property::FIELD:
1896 default: 1896 default:
1897 UNREACHABLE(); 1897 UNREACHABLE();
1898 } 1898 }
1899 } 1899 }
1900 } 1900 }
1901 1901
1902 1902
1903 void FullCodeGenerator::EmitClassDefineNameProperty(ClassLiteral* lit) {
1904 DCHECK(lit->constructor()->raw_name() != nullptr);
1905
1906 if (!lit->constructor()->raw_name()->IsEmpty()) {
Toon Verwaest 2016/11/24 07:13:38 Here you can know at compile-time that the name is
1907 PushOperand(Operand(rsp, 0)); // constructor
1908 PushOperand(lit->constructor()->name());
1909 CallRuntimeWithOperands(Runtime::kDefineClassNameProperty);
1910 }
1911 }
1912
1913
1903 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 1914 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
1904 PopOperand(rdx); 1915 PopOperand(rdx);
1905 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 1916 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
1906 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 1917 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
1907 CallIC(code, expr->BinaryOperationFeedbackId()); 1918 CallIC(code, expr->BinaryOperationFeedbackId());
1908 patch_site.EmitPatchInfo(); 1919 patch_site.EmitPatchInfo();
1909 context()->Plug(rax); 1920 context()->Plug(rax);
1910 } 1921 }
1911 1922
1912 1923
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
3548 DCHECK_EQ( 3559 DCHECK_EQ(
3549 isolate->builtins()->OnStackReplacement()->entry(), 3560 isolate->builtins()->OnStackReplacement()->entry(),
3550 Assembler::target_address_at(call_target_address, unoptimized_code)); 3561 Assembler::target_address_at(call_target_address, unoptimized_code));
3551 return ON_STACK_REPLACEMENT; 3562 return ON_STACK_REPLACEMENT;
3552 } 3563 }
3553 3564
3554 } // namespace internal 3565 } // namespace internal
3555 } // namespace v8 3566 } // namespace v8
3556 3567
3557 #endif // V8_TARGET_ARCH_X64 3568 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698