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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)

Created:
4 years, 2 months ago by Henrique Ferreiro
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Install the 'name' property in classes at runtime This allows to detect a static property also named 'name', and also makes sure 'name' is added last, to be standards-compliant. BUG=v8:4199 Committed: https://crrev.com/afd5ff553bbc8abdee37661d6a88af253673aa7c Cr-Commit-Position: refs/heads/master@{#41546}

Patch Set 1 #

Total comments: 10

Patch Set 2 : move logic to runtime function #

Patch Set 3 : Avoid a runtime call for anonymous classes #

Total comments: 3

Patch Set 4 : Use an accessor instead of a data property #

Total comments: 3

Patch Set 5 : Check for 'name' properties at parse-time #

Total comments: 8

Patch Set 6 : Move computed property names check to parser and runtime function #

Total comments: 8

Patch Set 7 : Split runtime function in two #

Patch Set 8 : Rebase #

Total comments: 1

Patch Set 9 : Fix runtime function argument count #

Patch Set 10 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -49 lines) Patch
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 4 chunks +23 lines, -5 lines 0 comments Download
M src/ast/ast-value-factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -0 lines 0 comments Download
M src/code-stubs.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download
M src/factory.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +36 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 8 9 2 chunks +13 lines, -0 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -1 line 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 5 6 7 8 9 6 chunks +19 lines, -5 lines 0 comments Download
M src/parsing/preparser.h View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -1 line 0 comments Download
M src/parsing/preparser.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 1 chunk +17 lines, -15 lines 0 comments Download
M src/runtime/runtime-classes.cc View 1 2 3 4 5 6 7 8 9 2 chunks +37 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallRuntime.golden View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden View 1 2 3 4 5 6 7 9 chunks +73 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Modules.golden View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/SuperCallAndSpread.golden View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/test-bytecode-generator.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M test/mjsunit/es6/computed-property-names-classes.js View 1 3 chunks +3 lines, -3 lines 0 comments Download
M test/mjsunit/es6/function-name.js View 1 chunk +13 lines, -0 lines 0 comments Download
M test/test262/test262.status View 1 2 3 4 5 6 7 2 chunks +0 lines, -7 lines 0 comments Download

Messages

Total messages: 59 (20 generated)
Henrique Ferreiro
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode688 src/interpreter/bytecode-generator.cc:688: empty_string_(info->isolate()->factory()->empty_string()) {} Leftover from a preview version https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: ...
4 years, 2 months ago (2016-10-17 11:41:11 UTC) #3
rmcilroy
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1619 src/interpreter/bytecode-generator.cc:1619: void BytecodeGenerator::VisitClassLiteralNameProperty(ClassLiteral* expr, Nit - BuildClassLiteralNameProperty https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if ...
4 years, 1 month ago (2016-10-24 14:22:20 UTC) #4
caitp
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if (expr->constructor()->name()->length() == 0) return; On 2016/10/17 11:41:11, hferreiro ...
4 years, 1 month ago (2016-10-24 15:56:10 UTC) #5
Henrique Ferreiro
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if (expr->constructor()->name()->length() == 0) return; On 2016/10/24 15:56:10, caitp ...
4 years, 1 month ago (2016-11-08 22:28:58 UTC) #6
caitp
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if (expr->constructor()->name()->length() == 0) return; On 2016/11/08 22:28:58, hferreiro ...
4 years, 1 month ago (2016-11-08 22:59:40 UTC) #7
rmcilroy
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if (expr->constructor()->name()->length() == 0) return; On 2016/11/08 22:59:40, caitp ...
4 years, 1 month ago (2016-11-10 12:37:44 UTC) #8
Henrique Ferreiro
On 2016/10/24 at 15:56:10, caitp wrote: > https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc > File src/interpreter/bytecode-generator.cc (right): > > https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 ...
4 years, 1 month ago (2016-11-11 16:24:52 UTC) #9
Henrique Ferreiro
4 years, 1 month ago (2016-11-14 10:08:29 UTC) #10
rmcilroy
interpreter/ changes LGTM with a couple of nits, but didn't look at the rest. https://codereview.chromium.org/2423053002/diff/40001/src/full-codegen/x64/full-codegen-x64.cc ...
4 years, 1 month ago (2016-11-14 13:22:18 UTC) #11
Toon Verwaest
Is there a design doc for this? If not, could you give some insights into ...
4 years, 1 month ago (2016-11-14 14:52:09 UTC) #13
Henrique Ferreiro
On 2016/11/14 14:52:09, Toon Verwaest wrote: > Is there a design doc for this? If ...
4 years, 1 month ago (2016-11-14 23:19:32 UTC) #14
caitp
On 2016/11/14 23:19:32, hferreiro wrote: > On 2016/11/14 14:52:09, Toon Verwaest wrote: > > Is ...
4 years, 1 month ago (2016-11-14 23:25:39 UTC) #15
Toon Verwaest
You can't use that map, it needs to be a custom map with the name ...
4 years, 1 month ago (2016-11-15 08:53:04 UTC) #16
Henrique Ferreiro
On 2016/11/15 at 08:53:04, verwaest wrote: > You can't use that map, it needs to ...
4 years, 1 month ago (2016-11-15 22:38:24 UTC) #17
Toon Verwaest
I see, the other static properties need to be in between. In that case just ...
4 years, 1 month ago (2016-11-16 12:12:47 UTC) #18
Henrique Ferreiro
On 2016/11/16 at 12:12:47, verwaest wrote: > I see, the other static properties need to ...
4 years, 1 month ago (2016-11-17 22:26:39 UTC) #19
Henrique Ferreiro
On 2016/11/17 at 22:26:39, hferreiro wrote: > On 2016/11/16 at 12:12:47, verwaest wrote: > > ...
4 years, 1 month ago (2016-11-17 22:31:03 UTC) #20
Toon Verwaest
Thanks, this already looks much better! Another comment. (Sorry for slow-poke review, I somehow missed ...
4 years ago (2016-11-24 07:13:38 UTC) #21
Toon Verwaest
https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/1/src/interpreter/bytecode-generator.cc#newcode1625 src/interpreter/bytecode-generator.cc:1625: if (expr->constructor()->name()->length() == 0) return; On 2016/11/10 12:37:44, rmcilroy ...
4 years ago (2016-11-24 07:16:23 UTC) #22
rmcilroy
https://codereview.chromium.org/2423053002/diff/60001/src/full-codegen/full-codegen.cc File src/full-codegen/full-codegen.cc (right): https://codereview.chromium.org/2423053002/diff/60001/src/full-codegen/full-codegen.cc#newcode1581 src/full-codegen/full-codegen.cc:1581: EmitClassDefineNameProperty(lit); Just a heads up - FullCodeGenerator::VisitClassLiteral is now ...
4 years ago (2016-11-24 14:31:15 UTC) #23
Henrique Ferreiro
I have added code to check for properties named 'name' at parse-time, and also when ...
4 years ago (2016-11-26 22:42:25 UTC) #24
rmcilroy
https://codereview.chromium.org/2423053002/diff/80001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2423053002/diff/80001/src/interpreter/bytecode-generator.cc#newcode1394 src/interpreter/bytecode-generator.cc:1394: Register needs_name = args[2]; This shouldn't be allocated in ...
4 years ago (2016-11-28 10:28:59 UTC) #25
Toon Verwaest
https://codereview.chromium.org/2423053002/diff/80001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2423053002/diff/80001/src/ast/ast.h#newcode2862 src/ast/ast.h:2862: bool has_name_static_property_; This should be added to the bitfield ...
4 years ago (2016-11-28 10:40:58 UTC) #26
Henrique Ferreiro
> https://codereview.chromium.org/2423053002/diff/80001/src/interpreter/bytecode-generator.cc#newcode1468 > src/interpreter/bytecode-generator.cc:1468: } > I'm not keen on this extra code added to ...
4 years ago (2016-11-28 11:25:04 UTC) #27
rmcilroy
On 2016/11/28 11:25:04, hferreiro wrote: > > > https://codereview.chromium.org/2423053002/diff/80001/src/interpreter/bytecode-generator.cc#newcode1468 > > src/interpreter/bytecode-generator.cc:1468: } > > ...
4 years ago (2016-11-28 13:58:27 UTC) #28
Henrique Ferreiro
I moved the check to the runtime function, but added a boolean to omit it ...
4 years ago (2016-11-29 11:01:26 UTC) #29
Toon Verwaest
Looking good. Some final comments. https://codereview.chromium.org/2423053002/diff/100001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2423053002/diff/100001/src/ast/ast.h#newcode2855 src/ast/ast.h:2855: HasNameStaticProperty::update(bit_field_, has_name_static_property) | HasNameStaticProperty::encode(has_name_static_property) ...
4 years ago (2016-11-29 12:27:47 UTC) #30
rmcilroy
https://codereview.chromium.org/2423053002/diff/100001/src/interpreter/bytecode-array-builder.h File src/interpreter/bytecode-array-builder.h (right): https://codereview.chromium.org/2423053002/diff/100001/src/interpreter/bytecode-array-builder.h#newcode84 src/interpreter/bytecode-array-builder.h:84: BytecodeArrayBuilder& LoadBoolean(bool is_true) { On 2016/11/29 11:01:26, hferreiro wrote: ...
4 years ago (2016-11-29 13:05:23 UTC) #31
Henrique Ferreiro
I have added a new runtime function InstallNameAccessorWithCheck.
4 years ago (2016-12-01 16:06:51 UTC) #32
Toon Verwaest
rmcilroy: nothing against it at all; that's what I meant to suggest in my previous ...
4 years ago (2016-12-01 22:14:22 UTC) #33
caitp
On 2016/12/01 22:14:22, Toon Verwaest wrote: > rmcilroy: nothing against it at all; that's what ...
4 years ago (2016-12-01 22:15:49 UTC) #34
rmcilroy
Interpreter changes LGTM, thanks for the changes. > Before landing this, I think the full-codegen ...
4 years ago (2016-12-01 23:59:46 UTC) #35
Henrique Ferreiro
I have rebased my changes. https://codereview.chromium.org/2423053002/diff/140001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2423053002/diff/140001/src/parsing/parser-base.h#newcode4158 src/parsing/parser-base.h:4158: if (!class_info.has_static_computed_names && is_static ...
4 years ago (2016-12-02 13:02:32 UTC) #36
Toon Verwaest
lgtm
4 years ago (2016-12-05 15:18:19 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2423053002/160001
4 years ago (2016-12-06 20:40:05 UTC) #49
commit-bot: I haz the power
Failed to apply patch for src/contexts.h: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-06 21:10:07 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2423053002/180001
4 years ago (2016-12-07 10:05:38 UTC) #54
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years ago (2016-12-07 10:34:22 UTC) #57
commit-bot: I haz the power
4 years ago (2016-12-07 10:35:10 UTC) #59
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/afd5ff553bbc8abdee37661d6a88af253673aa7c
Cr-Commit-Position: refs/heads/master@{#41546}

Powered by Google App Engine
This is Rietveld 408576698