Commit 5b44ba0e authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

(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: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46484}
parent 49ad05f6
......@@ -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);
......@@ -27,7 +27,7 @@
*%(basename)s:31: TypeError: Cannot read property 'x' of undefined
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