Index: test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden |
diff --git a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden |
index f1a15639a885b2ad78dfb1f24106e15ff9fc632d..236123267498e00f9f058c3a1b637b9121009250 100644 |
--- a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden |
+++ b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden |
@@ -12,9 +12,9 @@ snippet: " |
speak() { console.log(this.name + ' is speaking.'); } |
} |
" |
-frame size: 10 |
+frame size: 11 |
parameter count: 1 |
-bytecode array length: 74 |
+bytecode array length: 86 |
bytecodes: [ |
B(LdaTheHole), |
B(Star), R(2), |
@@ -32,16 +32,21 @@ bytecodes: [ |
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), |
B(Star), R(3), |
B(LdrNamedProperty), R(3), U8(1), U8(2), R(4), |
+ B(LdaTrue), |
+ B(Star), R(5), |
B(LdaConstant), U8(2), |
- B(ToName), R(6), |
+ B(ToName), R(7), |
B(CreateClosure), U8(3), U8(2), |
- B(Star), R(7), |
- B(LdaSmi), U8(2), |
B(Star), R(8), |
- B(LdaZero), |
+ B(LdaSmi), U8(2), |
B(Star), R(9), |
- B(Mov), R(4), R(5), |
- B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5), |
+ B(LdaZero), |
+ B(Star), R(10), |
+ B(Mov), R(4), R(6), |
+ B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5), |
+ B(Ldar), R(5), |
+ B(JumpIfToBooleanFalse), U8(7), |
+ B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U8(1), |
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), |
B(Star), R(0), |
B(Star), R(1), |
@@ -65,9 +70,9 @@ snippet: " |
speak() { console.log(this.name + ' is speaking.'); } |
} |
" |
-frame size: 10 |
+frame size: 11 |
parameter count: 1 |
-bytecode array length: 74 |
+bytecode array length: 86 |
bytecodes: [ |
B(LdaTheHole), |
B(Star), R(2), |
@@ -85,16 +90,21 @@ bytecodes: [ |
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), |
B(Star), R(3), |
B(LdrNamedProperty), R(3), U8(1), U8(2), R(4), |
+ B(LdaTrue), |
+ B(Star), R(5), |
B(LdaConstant), U8(2), |
- B(ToName), R(6), |
+ B(ToName), R(7), |
B(CreateClosure), U8(3), U8(2), |
- B(Star), R(7), |
- B(LdaSmi), U8(2), |
B(Star), R(8), |
- B(LdaZero), |
+ B(LdaSmi), U8(2), |
B(Star), R(9), |
- B(Mov), R(4), R(5), |
- B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5), |
+ B(LdaZero), |
+ B(Star), R(10), |
+ B(Mov), R(4), R(6), |
+ B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5), |
+ B(Ldar), R(5), |
+ B(JumpIfToBooleanFalse), U8(7), |
+ B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U8(1), |
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), |
B(Star), R(0), |
B(Star), R(1), |
@@ -120,9 +130,9 @@ snippet: " |
static [n1]() { return n1; } |
} |
" |
-frame size: 11 |
+frame size: 12 |
parameter count: 1 |
-bytecode array length: 128 |
+bytecode array length: 152 |
bytecodes: [ |
B(CreateFunctionContext), U8(2), |
B(PushContext), R(3), |
@@ -146,28 +156,39 @@ bytecodes: [ |
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), |
B(Star), R(4), |
B(LdrNamedProperty), R(4), U8(3), U8(2), R(5), |
+ B(LdaTrue), |
+ B(Star), R(6), |
/* 75 E> */ B(LdaContextSlot), R(context), U8(4), U8(0), |
- B(ToName), R(7), |
+ B(ToName), R(8), |
B(CreateClosure), U8(4), U8(2), |
- B(Star), R(8), |
- B(LdaSmi), U8(2), |
B(Star), R(9), |
- B(LdaSmi), U8(1), |
+ B(LdaSmi), U8(2), |
B(Star), R(10), |
- B(Mov), R(5), R(6), |
- B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5), |
+ B(LdaSmi), U8(1), |
+ B(Star), R(11), |
+ B(Mov), R(5), R(7), |
+ B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7), U8(5), |
/* 106 E> */ B(LdaContextSlot), R(context), U8(5), U8(0), |
- B(ToName), R(7), |
+ B(ToName), R(8), |
+ B(Mov), R(4), R(7), |
+ B(Ldar), R(6), |
+ B(JumpIfToBooleanFalse), U8(10), |
+ B(LdaConstant), U8(5), |
+ B(TestEqualStrict), R(8), U8(0), |
+ B(LogicalNot), |
+ B(Star), R(6), |
B(LdaConstant), U8(3), |
- B(TestEqualStrict), R(7), U8(0), |
- B(Mov), R(4), R(6), |
- B(JumpIfToBooleanFalse), U8(7), |
+ B(TestEqualStrict), R(8), U8(0), |
+ B(JumpIfFalse), U8(7), |
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), |
- B(CreateClosure), U8(5), U8(2), |
- B(Star), R(8), |
+ B(CreateClosure), U8(6), U8(2), |
+ B(Star), R(9), |
B(LdaSmi), U8(1), |
- B(Star), R(10), |
- B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6), U8(5), |
+ B(Star), R(11), |
+ B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7), U8(5), |
+ B(Ldar), R(6), |
+ B(JumpIfToBooleanFalse), U8(7), |
+ B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(4), U8(1), |
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), |
B(Star), R(0), |
B(Star), R(1), |
@@ -181,6 +202,7 @@ constant pool: [ |
SHARED_FUNCTION_INFO_TYPE, |
ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], |
SHARED_FUNCTION_INFO_TYPE, |
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"], |
SHARED_FUNCTION_INFO_TYPE, |
] |
handlers: [ |
@@ -194,7 +216,7 @@ snippet: " |
" |
frame size: 8 |
parameter count: 1 |
-bytecode array length: 74 |
+bytecode array length: 84 |
bytecodes: [ |
B(CreateFunctionContext), U8(1), |
B(PushContext), R(3), |
@@ -216,6 +238,10 @@ bytecodes: [ |
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), |
B(Star), R(4), |
B(LdrNamedProperty), R(4), U8(1), U8(2), R(5), |
+ B(LdaTrue), |
+ B(Star), R(6), |
+ B(JumpIfToBooleanFalse), U8(7), |
+ B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(4), U8(1), |
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), |
B(Star), R(0), |
B(Star), R(1), |
@@ -236,3 +262,68 @@ constant pool: [ |
handlers: [ |
] |
+--- |
+snippet: " |
+ (class {}) |
+ class E { static name () {}} |
+" |
+frame size: 12 |
+parameter count: 1 |
+bytecode array length: 107 |
+bytecodes: [ |
+ B(LdaTheHole), |
+ B(Star), R(3), |
+ /* 30 E> */ B(StackCheck), |
+ /* 35 S> */ B(LdaTheHole), |
+ B(Star), R(4), |
+ B(CreateClosure), U8(0), U8(2), |
+ B(Star), R(5), |
+ B(LdaSmi), U8(35), |
+ B(Star), R(6), |
+ B(LdaSmi), U8(43), |
+ B(Star), R(7), |
+ B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), |
+ B(Star), R(4), |
+ B(LdrNamedProperty), R(4), U8(1), U8(2), R(5), |
+ B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), |
+ B(Star), R(1), |
+ B(LdaTheHole), |
+ B(Star), R(0), |
+ /* 45 S> */ B(LdaTheHole), |
+ B(Star), R(4), |
+ B(CreateClosure), U8(2), U8(2), |
+ B(Star), R(5), |
+ B(LdaSmi), U8(45), |
+ B(Star), R(6), |
+ B(LdaSmi), U8(73), |
+ B(Star), R(7), |
+ B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), |
+ B(Star), R(4), |
+ B(LdrNamedProperty), R(4), U8(1), U8(4), R(5), |
+ B(LdaConstant), U8(3), |
+ B(ToName), R(8), |
+ B(CreateClosure), U8(4), U8(2), |
+ B(Star), R(9), |
+ B(LdaSmi), U8(2), |
+ B(Star), R(10), |
+ B(LdaZero), |
+ B(Star), R(11), |
+ B(Mov), R(4), R(7), |
+ B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7), U8(5), |
+ B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), |
+ B(Star), R(0), |
+ B(Star), R(2), |
+ B(Star), R(3), |
+ B(LdaUndefined), |
+ /* 74 S> */ B(Return), |
+] |
+constant pool: [ |
+ SHARED_FUNCTION_INFO_TYPE, |
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], |
+ SHARED_FUNCTION_INFO_TYPE, |
+ ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"], |
+ SHARED_FUNCTION_INFO_TYPE, |
+] |
+handlers: [ |
+] |
+ |