Commit 61ea3243 authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

Reland "[parser] moved load property position after dot"

This is a reland of 5b44ba0e
Original change's description:
> (Reland) [parser] moved load property position after dot
> 
> Currently LdaNamedProperty bytecode for expressions like a.b has position before dot. This CL moves this location after dot.
> It's important for later removing of Nop bytecodes in expressions like a.b() where a is local variable, property call and property load should have the same position.
> 
> R=jgruber@chromium.org
> TBR=marja@chromium.org
> 
> Bug: v8:6425
> Change-Id: I05c21ca5e018da9c432c6bc963c7a96799336d1c
> Reviewed-on: https://chromium-review.googlesource.com/562879
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46484}

TBR=marja@chromium.org,jgruber@chromium.org
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng

Bug: v8:6425
Change-Id: I5eba5fe43ad31c5c781ffcc8c604cd9c98baa57e
Reviewed-on: https://chromium-review.googlesource.com/565907Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46542}
parent ec8a5873
......@@ -3639,7 +3639,7 @@ ParserBase<Impl>::ParseMemberExpressionContinuation(ExpressionT expression,
ArrowFormalParametersUnexpectedToken();
Consume(Token::PERIOD);
int pos = position();
int pos = peek_position();
IdentifierT name = ParseIdentifierName(CHECK_OK);
expression = factory()->NewProperty(
expression, factory()->NewStringLiteral(name, pos), pos);
......
......@@ -16,7 +16,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaGlobal), U8(0), U8(6),
B(Star), R(1),
/* 38 E> */ B(LdaNamedProperty), R(1), U8(1), U8(8),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(8),
B(Star), R(0),
B(CreateArrayLiteral), U8(2), U8(10), U8(17),
B(Star), R(2),
......@@ -43,7 +43,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(LdaGlobal), U8(0), U8(6),
B(Star), R(1),
/* 38 E> */ B(LdaNamedProperty), R(1), U8(1), U8(8),
/* 39 E> */ B(LdaNamedProperty), R(1), U8(1), U8(8),
B(Star), R(0),
B(LdaZero),
B(Star), R(2),
......
......@@ -805,13 +805,13 @@ bytecodes: [
/* 45 S> */ B(Return),
/* 27 S> */ B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(4),
/* 30 E> */ B(LdaNamedProperty), R(4), U8(4), U8(6),
/* 31 E> */ B(LdaNamedProperty), R(4), U8(4), U8(6),
B(Star), R(3),
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(5),
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(6),
/* 41 E> */ B(LdaNamedProperty), R(6), U8(5), U8(8),
/* 42 E> */ B(LdaNamedProperty), R(6), U8(5), U8(8),
B(Star), R(6),
/* 31 E> */ B(CallProperty2), R(3), R(4), R(5), R(6), U8(4),
B(StaCurrentContextSlot), U8(6),
......
......@@ -52,7 +52,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateRegExpLiteral), U8(0), U8(6), U8(0),
B(Star), R(1),
/* 47 E> */ B(LdaNamedProperty), R(1), U8(1), U8(7),
/* 48 E> */ B(LdaNamedProperty), R(1), U8(1), U8(7),
B(Star), R(0),
B(LdaConstant), U8(2),
B(Star), R(2),
......
......@@ -54,7 +54,7 @@ assertEquals(42, get);
assertEquals([
"a0",
"b10", "h4b17", "i2b17", // [[Has]]
"c10", "j4c15", "k2c15", // [[Get]]
"c10", "j4c16", "k2c16", // [[Get]]
"d0", "l4d11", "m2d11", // [[Set]]
"g0"
], log);
......@@ -29,5 +29,5 @@
undefined.x
^
TypeError: Cannot read property 'x' of undefined
at *%(basename)s:31:10
at *%(basename)s:31:11
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment