diff options
Diffstat (limited to 'deps/v8/test/cctest/interpreter')
21 files changed, 402 insertions, 365 deletions
diff --git a/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.cc b/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.cc index 0a169b766c..957bcff1db 100644 --- a/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.cc +++ b/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.cc @@ -10,19 +10,19 @@ #include "include/libplatform/libplatform.h" #include "include/v8.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/base/logging.h" +#include "src/codegen/source-position-table.h" #include "src/interpreter/bytecode-array-iterator.h" #include "src/interpreter/bytecode-generator.h" #include "src/interpreter/bytecodes.h" #include "src/interpreter/interpreter-intrinsics.h" #include "src/interpreter/interpreter.h" -#include "src/objects-inl.h" #include "src/objects/heap-number-inl.h" #include "src/objects/module-inl.h" -#include "src/ostreams.h" +#include "src/objects/objects-inl.h" #include "src/runtime/runtime.h" -#include "src/source-position-table.h" +#include "src/utils/ostreams.h" #include "test/cctest/cctest.h" namespace v8 { @@ -98,7 +98,7 @@ BytecodeExpectationsPrinter::GetBytecodeArrayForGlobal( i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*function)); i::Handle<i::BytecodeArray> bytecodes = - i::handle(js_function->shared()->GetBytecodeArray(), i_isolate()); + i::handle(js_function->shared().GetBytecodeArray(), i_isolate()); return bytecodes; } @@ -108,7 +108,7 @@ BytecodeExpectationsPrinter::GetBytecodeArrayForModule( v8::Local<v8::Module> module) const { i::Handle<i::Module> i_module = v8::Utils::OpenHandle(*module); return i::handle( - SharedFunctionInfo::cast(i_module->code())->GetBytecodeArray(), + SharedFunctionInfo::cast(i_module->code()).GetBytecodeArray(), i_isolate()); } @@ -116,7 +116,7 @@ i::Handle<i::BytecodeArray> BytecodeExpectationsPrinter::GetBytecodeArrayForScript( v8::Local<v8::Script> script) const { i::Handle<i::JSFunction> js_function = v8::Utils::OpenHandle(*script); - return i::handle(js_function->shared()->GetBytecodeArray(), i_isolate()); + return i::handle(js_function->shared().GetBytecodeArray(), i_isolate()); } i::Handle<i::BytecodeArray> @@ -126,8 +126,8 @@ BytecodeExpectationsPrinter::GetBytecodeArrayOfCallee( v8::Utils::OpenHandle(*CompileRun(source_code)); i::Handle<i::JSFunction> js_function = i::Handle<i::JSFunction>::cast(i_object); - CHECK(js_function->shared()->HasBytecodeArray()); - return i::handle(js_function->shared()->GetBytecodeArray(), i_isolate()); + CHECK(js_function->shared().HasBytecodeArray()); + return i::handle(js_function->shared().GetBytecodeArray(), i_isolate()); } void BytecodeExpectationsPrinter::PrintEscapedString( @@ -167,7 +167,6 @@ void BytecodeExpectationsPrinter::PrintBytecodeOperand( break; default: UNREACHABLE(); - return; } if (Bytecodes::IsRegisterOperandType(op_type)) { @@ -279,8 +278,8 @@ void BytecodeExpectationsPrinter::PrintSourcePosition( void BytecodeExpectationsPrinter::PrintV8String(std::ostream& stream, i::String string) const { stream << '"'; - for (int i = 0, length = string->length(); i < length; ++i) { - stream << i::AsEscapedUC16ForJSON(string->Get(i)); + for (int i = 0, length = string.length(); i < length; ++i) { + stream << i::AsEscapedUC16ForJSON(string.Get(i)); } stream << '"'; } @@ -289,13 +288,13 @@ void BytecodeExpectationsPrinter::PrintConstant( std::ostream& stream, i::Handle<i::Object> constant) const { if (constant->IsSmi()) { stream << "Smi ["; - i::Smi::cast(*constant)->SmiPrint(stream); + i::Smi::cast(*constant).SmiPrint(stream); stream << "]"; } else { - stream << i::HeapObject::cast(*constant)->map()->instance_type(); + stream << i::HeapObject::cast(*constant).map().instance_type(); if (constant->IsHeapNumber()) { stream << " ["; - i::HeapNumber::cast(*constant)->HeapNumberPrint(stream); + i::HeapNumber::cast(*constant).HeapNumberPrint(stream); stream << "]"; } else if (constant->IsString()) { stream << " ["; @@ -335,7 +334,7 @@ void BytecodeExpectationsPrinter::PrintBytecodeSequence( void BytecodeExpectationsPrinter::PrintConstantPool( std::ostream& stream, i::FixedArray constant_pool) const { stream << "constant pool: [\n"; - int num_constants = constant_pool->length(); + int num_constants = constant_pool.length(); if (num_constants > 0) { for (int i = 0; i < num_constants; ++i) { stream << kIndent; diff --git a/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.h b/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.h index 53793c1751..06329940ff 100644 --- a/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.h +++ b/deps/v8/test/cctest/interpreter/bytecode-expectations-printer.h @@ -10,7 +10,7 @@ #include <vector> #include "src/interpreter/bytecodes.h" -#include "src/objects.h" +#include "src/objects/objects.h" namespace v8 { diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden index 231a9050b8..adbe5c9b92 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden @@ -14,9 +14,9 @@ snippet: " " frame size: 8 parameter count: 1 -bytecode array length: 180 +bytecode array length: 148 bytecodes: [ - B(SwitchOnGeneratorState), R(0), U8(0), U8(2), + B(SwitchOnGeneratorState), R(0), U8(0), U8(1), B(Mov), R(closure), R(1), B(Mov), R(this), R(2), B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2), @@ -29,33 +29,17 @@ bytecodes: [ B(ResumeGenerator), R(0), R(0), U8(5), B(Star), R(5), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0), B(Ldar), R(5), /* 17 E> */ B(Throw), B(LdaSmi), I8(1), B(Star), R(1), B(Mov), R(5), R(2), - B(Jump), U8(85), - B(LdaUndefined), - B(Star), R(6), - B(Mov), R(0), R(5), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2), - B(SuspendGenerator), R(0), R(0), U8(5), U8(1), - B(ResumeGenerator), R(0), R(0), U8(5), - B(Star), R(5), - B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(6), - B(LdaZero), - B(TestReferenceEqual), R(6), - B(JumpIfTrue), U8(5), + B(Jump), U8(53), B(Ldar), R(5), - B(ReThrow), - B(LdaSmi), I8(1), - B(Star), R(1), - B(Mov), R(5), R(2), - B(Jump), U8(41), + B(Jump), U8(36), B(Star), R(5), - B(CreateCatchContext), R(5), U8(4), + B(CreateCatchContext), R(5), U8(3), B(Star), R(4), B(LdaTheHole), B(SetPendingMessage), @@ -69,6 +53,10 @@ bytecodes: [ B(Star), R(2), B(LdaSmi), I8(2), B(Star), R(1), + B(Jump), U8(15), + B(LdaSmi), I8(-1), + B(Star), R(2), + B(Star), R(1), B(Jump), U8(7), B(Star), R(2), B(LdaZero), @@ -80,7 +68,7 @@ bytecodes: [ B(Ldar), R(3), B(SetPendingMessage), B(Ldar), R(1), - B(SwitchOnSmiNoFeedback), U8(5), U8(3), I8(0), + B(SwitchOnSmiNoFeedback), U8(4), U8(3), I8(0), B(Jump), U8(22), B(Ldar), R(2), B(ReThrow), @@ -97,7 +85,6 @@ bytecodes: [ ] constant pool: [ Smi [30], - Smi [71], Smi [16], Smi [7], SCOPE_INFO_TYPE, @@ -106,8 +93,8 @@ constant pool: [ Smi [23], ] handlers: [ - [20, 134, 134], - [23, 100, 100], + [20, 94, 102], + [23, 56, 60], ] --- @@ -117,9 +104,9 @@ snippet: " " frame size: 8 parameter count: 1 -bytecode array length: 225 +bytecode array length: 193 bytecodes: [ - B(SwitchOnGeneratorState), R(0), U8(0), U8(3), + B(SwitchOnGeneratorState), R(0), U8(0), U8(2), B(Mov), R(closure), R(1), B(Mov), R(this), R(2), B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2), @@ -132,13 +119,13 @@ bytecodes: [ B(ResumeGenerator), R(0), R(0), U8(5), B(Star), R(5), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(Ldar), R(5), /* 17 E> */ B(Throw), B(LdaSmi), I8(1), B(Star), R(1), B(Mov), R(5), R(2), - B(Jump), U8(130), + B(Jump), U8(98), /* 22 S> */ B(LdaSmi), I8(42), B(Star), R(6), B(LdaFalse), @@ -149,33 +136,17 @@ bytecodes: [ B(ResumeGenerator), R(0), R(0), U8(5), B(Star), R(5), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0), B(Ldar), R(5), /* 22 E> */ B(Throw), B(LdaSmi), I8(1), B(Star), R(1), B(Mov), R(5), R(2), - B(Jump), U8(85), - B(LdaUndefined), - B(Star), R(6), - B(Mov), R(0), R(5), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2), - B(SuspendGenerator), R(0), R(0), U8(5), U8(2), - B(ResumeGenerator), R(0), R(0), U8(5), - B(Star), R(5), - B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(6), - B(LdaZero), - B(TestReferenceEqual), R(6), - B(JumpIfTrue), U8(5), + B(Jump), U8(53), B(Ldar), R(5), - B(ReThrow), - B(LdaSmi), I8(1), - B(Star), R(1), - B(Mov), R(5), R(2), - B(Jump), U8(41), + B(Jump), U8(36), B(Star), R(5), - B(CreateCatchContext), R(5), U8(7), + B(CreateCatchContext), R(5), U8(6), B(Star), R(4), B(LdaTheHole), B(SetPendingMessage), @@ -189,6 +160,10 @@ bytecodes: [ B(Star), R(2), B(LdaSmi), I8(2), B(Star), R(1), + B(Jump), U8(15), + B(LdaSmi), I8(-1), + B(Star), R(2), + B(Star), R(1), B(Jump), U8(7), B(Star), R(2), B(LdaZero), @@ -200,7 +175,7 @@ bytecodes: [ B(Ldar), R(3), B(SetPendingMessage), B(Ldar), R(1), - B(SwitchOnSmiNoFeedback), U8(8), U8(3), I8(0), + B(SwitchOnSmiNoFeedback), U8(7), U8(3), I8(0), B(Jump), U8(22), B(Ldar), R(2), B(ReThrow), @@ -218,7 +193,6 @@ bytecodes: [ constant pool: [ Smi [30], Smi [75], - Smi [116], Smi [16], Smi [7], Smi [16], @@ -229,8 +203,8 @@ constant pool: [ Smi [23], ] handlers: [ - [20, 179, 179], - [23, 145, 145], + [20, 139, 147], + [23, 101, 105], ] --- @@ -240,9 +214,9 @@ snippet: " " frame size: 20 parameter count: 1 -bytecode array length: 406 +bytecode array length: 372 bytecodes: [ - B(SwitchOnGeneratorState), R(0), U8(0), U8(3), + B(SwitchOnGeneratorState), R(0), U8(0), U8(2), B(Mov), R(closure), R(4), B(Mov), R(this), R(5), B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2), @@ -255,22 +229,22 @@ bytecodes: [ B(ResumeGenerator), R(0), R(0), U8(8), B(Star), R(8), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0), B(Ldar), R(8), /* 17 E> */ B(Throw), B(LdaSmi), I8(1), B(Star), R(4), B(Mov), R(8), R(5), - B(JumpConstant), U8(17), - /* 36 S> */ B(CreateArrayLiteral), U8(5), U8(0), U8(37), + B(JumpConstant), U8(16), + /* 36 S> */ B(CreateArrayLiteral), U8(4), U8(0), U8(37), B(Star), R(10), - B(LdaNamedProperty), R(10), U8(6), U8(1), + B(LdaNamedProperty), R(10), U8(5), U8(1), B(Star), R(11), B(CallProperty0), R(11), R(10), U8(3), B(JumpIfJSReceiver), U8(7), B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0), B(Star), R(9), - B(LdaNamedProperty), R(9), U8(7), U8(5), + B(LdaNamedProperty), R(9), U8(6), U8(5), B(Star), R(8), B(LdaFalse), B(Star), R(12), @@ -281,9 +255,9 @@ bytecodes: [ B(Star), R(16), B(JumpIfJSReceiver), U8(7), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1), - B(LdaNamedProperty), R(16), U8(8), U8(9), + B(LdaNamedProperty), R(16), U8(7), U8(9), B(JumpIfToBooleanTrue), U8(67), - B(LdaNamedProperty), R(16), U8(9), U8(11), + B(LdaNamedProperty), R(16), U8(8), U8(11), B(Star), R(16), B(LdaFalse), B(Star), R(12), @@ -299,7 +273,7 @@ bytecodes: [ B(ResumeGenerator), R(0), R(0), U8(17), B(Star), R(17), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0), B(Ldar), R(17), /* 42 E> */ B(Throw), B(LdaSmi), I8(1), @@ -320,15 +294,15 @@ bytecodes: [ B(Star), R(15), B(Ldar), R(12), B(JumpIfToBooleanTrue), U8(60), - B(LdaNamedProperty), R(9), U8(12), U8(13), + B(LdaNamedProperty), R(9), U8(11), U8(13), B(Star), R(17), B(JumpIfUndefined), U8(52), B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(18), - B(LdaConstant), U8(13), + B(LdaConstant), U8(12), B(Star), R(19), B(CallRuntime), U16(Runtime::kNewTypeError), R(18), U8(2), B(Throw), @@ -347,34 +321,17 @@ bytecodes: [ B(Ldar), R(15), B(SetPendingMessage), B(Ldar), R(13), - B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(0), + B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0), B(Jump), U8(14), B(Ldar), R(14), B(ReThrow), B(LdaSmi), I8(1), B(Star), R(4), B(Mov), R(14), R(5), - B(Jump), U8(85), - B(LdaUndefined), - B(Star), R(9), - B(Mov), R(0), R(8), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(8), U8(2), - B(SuspendGenerator), R(0), R(0), U8(8), U8(2), - B(ResumeGenerator), R(0), R(0), U8(8), + B(Jump), U8(51), + B(Jump), U8(36), B(Star), R(8), - B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(9), - B(LdaZero), - B(TestReferenceEqual), R(9), - B(JumpIfTrue), U8(5), - B(Ldar), R(8), - B(ReThrow), - B(LdaSmi), I8(1), - B(Star), R(4), - B(Mov), R(8), R(5), - B(Jump), U8(41), - B(Star), R(8), - B(CreateCatchContext), R(8), U8(16), + B(CreateCatchContext), R(8), U8(15), B(Star), R(7), B(LdaTheHole), B(SetPendingMessage), @@ -388,6 +345,10 @@ bytecodes: [ B(Star), R(5), B(LdaSmi), I8(2), B(Star), R(4), + B(Jump), U8(15), + B(LdaSmi), I8(-1), + B(Star), R(5), + B(Star), R(4), B(Jump), U8(7), B(Star), R(5), B(LdaZero), @@ -399,7 +360,7 @@ bytecodes: [ B(Ldar), R(6), B(SetPendingMessage), B(Ldar), R(4), - B(SwitchOnSmiNoFeedback), U8(18), U8(3), I8(0), + B(SwitchOnSmiNoFeedback), U8(17), U8(3), I8(0), B(Jump), U8(22), B(Ldar), R(5), B(ReThrow), @@ -417,7 +378,6 @@ bytecodes: [ constant pool: [ Smi [30], Smi [149], - Smi [297], Smi [16], Smi [7], ARRAY_BOILERPLATE_DESCRIPTION_TYPE, @@ -432,14 +392,14 @@ constant pool: [ Smi [6], Smi [9], SCOPE_INFO_TYPE, - Smi [311], + Smi [277], Smi [6], Smi [9], Smi [23], ] handlers: [ - [20, 360, 360], - [23, 326, 326], + [20, 318, 326], + [23, 282, 284], [93, 180, 188], [234, 247, 249], ] @@ -450,9 +410,9 @@ snippet: " async function* f() { yield* g() } f(); " -frame size: 17 +frame size: 19 parameter count: 1 -bytecode array length: 472 +bytecode array length: 475 bytecodes: [ B(SwitchOnGeneratorState), R(0), U8(0), U8(5), B(Mov), R(closure), R(1), @@ -500,78 +460,91 @@ bytecodes: [ B(Ldar), R(6), B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(1), B(CallProperty1), R(9), R(7), R(8), U8(14), - B(Jump), U8(111), + B(Jump), U8(146), B(LdaNamedProperty), R(7), U8(13), U8(16), B(JumpIfUndefined), U8(13), B(JumpIfNull), U8(11), B(Star), R(12), B(CallProperty1), R(12), R(7), R(8), U8(18), - B(Jump), U8(94), + B(Jump), U8(129), + B(Mov), R(0), R(12), + B(Mov), R(8), R(13), + B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(12), U8(2), + /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(1), + B(ResumeGenerator), R(0), R(0), U8(12), + B(Star), R(12), + B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), + B(Star), R(13), + B(LdaZero), + B(TestReferenceEqual), R(13), + B(JumpIfTrue), U8(5), + B(Ldar), R(12), + B(ReThrow), B(LdaSmi), I8(1), B(Star), R(1), - B(Mov), R(8), R(2), - B(JumpConstant), U8(19), + B(Mov), R(12), R(2), + B(Jump), U8(245), B(LdaNamedProperty), R(7), U8(14), U8(20), B(JumpIfUndefined), U8(13), B(JumpIfNull), U8(11), - B(Star), R(12), - B(CallProperty1), R(12), R(7), R(8), U8(22), + B(Star), R(14), + B(CallProperty1), R(14), R(7), R(8), U8(22), B(Jump), U8(68), B(LdaNamedProperty), R(7), U8(13), U8(24), B(JumpIfUndefined), U8(57), B(JumpIfNull), U8(55), - B(Star), R(12), - B(CallProperty0), R(12), R(7), U8(26), + B(Star), R(14), + B(CallProperty0), R(14), R(7), U8(26), B(Jump), U8(2), - B(Star), R(13), - B(Mov), R(0), R(12), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(12), U8(2), - /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(1), - B(ResumeGenerator), R(0), R(0), U8(12), - B(Star), R(12), + B(Star), R(15), + B(Mov), R(0), R(14), + B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(14), U8(2), + /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(14), U8(2), + B(ResumeGenerator), R(0), R(0), U8(14), + B(Star), R(14), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(13), + B(Star), R(15), B(LdaZero), - B(TestReferenceEqual), R(13), + B(TestReferenceEqual), R(15), B(JumpIfTrue), U8(5), - B(Ldar), R(12), + B(Ldar), R(14), B(ReThrow), - B(Ldar), R(12), + B(Ldar), R(14), B(JumpIfJSReceiver), U8(9), - B(Star), R(14), - B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1), + B(Star), R(16), + B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(16), U8(1), B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0), - B(Star), R(13), - B(Mov), R(0), R(12), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(12), U8(2), - /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(2), - B(ResumeGenerator), R(0), R(0), U8(12), - B(Star), R(12), + B(Star), R(15), + B(Mov), R(0), R(14), + B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(14), U8(2), + /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(14), U8(3), + B(ResumeGenerator), R(0), R(0), U8(14), + B(Star), R(14), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(13), + B(Star), R(15), B(LdaZero), - B(TestReferenceEqual), R(13), + B(TestReferenceEqual), R(15), B(JumpIfTrue), U8(5), - B(Ldar), R(12), + B(Ldar), R(14), B(ReThrow), - B(Ldar), R(12), - B(Mov), R(12), R(5), + B(Ldar), R(14), + B(Mov), R(14), R(5), B(JumpIfJSReceiver), U8(7), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1), B(LdaNamedProperty), R(5), U8(15), U8(28), B(JumpIfToBooleanTrue), U8(38), B(LdaNamedProperty), R(5), U8(16), U8(30), - B(Star), R(15), + B(Star), R(17), B(LdaFalse), - B(Star), R(16), - B(Mov), R(0), R(14), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(14), U8(3), - /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(14), U8(3), - B(ResumeGenerator), R(0), R(0), U8(14), + B(Star), R(18), + B(Mov), R(0), R(16), + B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(16), U8(3), + /* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(16), U8(4), + B(ResumeGenerator), R(0), R(0), U8(16), B(Star), R(8), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(Star), R(6), - B(JumpLoop), U8(207), I8(0), + B(JumpLoop), U8(242), I8(0), B(LdaNamedProperty), R(5), U8(16), U8(32), B(Star), R(7), B(LdaSmi), I8(1), @@ -580,25 +553,9 @@ bytecodes: [ B(LdaSmi), I8(1), B(Star), R(1), B(Mov), R(7), R(2), - B(Jump), U8(85), - B(LdaUndefined), - B(Star), R(6), - B(Mov), R(0), R(5), - B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorAwaitUncaught), R(5), U8(2), - B(SuspendGenerator), R(0), R(0), U8(5), U8(4), - B(ResumeGenerator), R(0), R(0), U8(5), - B(Star), R(5), - B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), - B(Star), R(6), - B(LdaZero), - B(TestReferenceEqual), R(6), - B(JumpIfTrue), U8(5), - B(Ldar), R(5), - B(ReThrow), - B(LdaSmi), I8(1), - B(Star), R(1), - B(Mov), R(5), R(2), - B(Jump), U8(41), + B(Jump), U8(53), + B(Ldar), R(7), + B(Jump), U8(36), B(Star), R(5), B(CreateCatchContext), R(5), U8(17), B(Star), R(4), @@ -614,6 +571,10 @@ bytecodes: [ B(Star), R(2), B(LdaSmi), I8(2), B(Star), R(1), + B(Jump), U8(15), + B(LdaSmi), I8(-1), + B(Star), R(2), + B(Star), R(1), B(Jump), U8(7), B(Star), R(2), B(LdaZero), @@ -625,7 +586,7 @@ bytecodes: [ B(Ldar), R(3), B(SetPendingMessage), B(Ldar), R(1), - B(SwitchOnSmiNoFeedback), U8(20), U8(3), I8(0), + B(SwitchOnSmiNoFeedback), U8(19), U8(3), I8(0), B(Jump), U8(22), B(Ldar), R(2), B(ReThrow), @@ -642,10 +603,10 @@ bytecodes: [ ] constant pool: [ Smi [30], - Smi [203], - Smi [253], - Smi [312], - Smi [363], + Smi [162], + Smi [238], + Smi [288], + Smi [347], Smi [16], Smi [7], ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"], @@ -653,20 +614,19 @@ constant pool: [ SYMBOL_TYPE, ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], Smi [11], - Smi [37], + Smi [72], ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["throw"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"], SCOPE_INFO_TYPE, - Smi [377], - Smi [277], + Smi [380], Smi [6], Smi [9], Smi [23], ] handlers: [ - [20, 426, 426], - [23, 392, 392], + [20, 421, 429], + [23, 383, 387], ] diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/DestructuringAssignment.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/DestructuringAssignment.golden index f4a7c340c4..43515711db 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/DestructuringAssignment.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/DestructuringAssignment.golden @@ -66,7 +66,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(13), B(LdaConstant), U8(6), B(Star), R(14), @@ -203,7 +203,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(14), B(LdaConstant), U8(6), B(Star), R(15), @@ -327,7 +327,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(15), B(LdaConstant), U8(7), B(Star), R(16), diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden index 6fe59da400..82d51820bb 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden @@ -94,7 +94,7 @@ bytecodes: [ B(JumpIfNull), U8(86), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(17), B(LdaConstant), U8(9), B(Star), R(18), @@ -263,7 +263,7 @@ bytecodes: [ B(JumpIfNull), U8(86), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(17), B(LdaConstant), U8(9), B(Star), R(18), @@ -448,7 +448,7 @@ bytecodes: [ B(JumpIfNull), U8(86), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(17), B(LdaConstant), U8(9), B(Star), R(18), @@ -600,7 +600,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(14), B(LdaConstant), U8(8), B(Star), R(15), diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOf.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOf.golden index 571002d16e..dffa8f577b 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOf.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOf.golden @@ -62,7 +62,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(12), B(LdaConstant), U8(6), B(Star), R(13), @@ -165,7 +165,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(13), B(LdaConstant), U8(6), B(Star), R(14), @@ -278,7 +278,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(12), B(LdaConstant), U8(6), B(Star), R(13), @@ -384,7 +384,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(12), B(LdaConstant), U8(8), B(Star), R(13), diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden index f85f09c1f7..1752a3124e 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden @@ -66,7 +66,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(14), B(LdaConstant), U8(5), B(Star), R(15), @@ -203,7 +203,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(15), B(LdaConstant), U8(10), B(Star), R(16), @@ -318,7 +318,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(13), B(LdaConstant), U8(7), B(Star), R(14), @@ -430,7 +430,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(16), B(LdaConstant), U8(7), B(Star), R(17), @@ -547,7 +547,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(15), B(LdaConstant), U8(8), B(Star), R(16), @@ -679,7 +679,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(14), B(LdaConstant), U8(11), B(Star), R(15), @@ -795,7 +795,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(16), B(LdaConstant), U8(5), B(Star), R(17), @@ -935,7 +935,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(15), B(LdaConstant), U8(6), B(Star), R(16), diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/Generators.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/Generators.golden index 77b1924c73..996c15d2af 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/Generators.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/Generators.golden @@ -180,7 +180,7 @@ bytecodes: [ B(JumpIfNull), U8(50), B(TestTypeOf), U8(6), B(JumpIfTrue), U8(18), - B(Wide), B(LdaSmi), I16(155), + B(Wide), B(LdaSmi), I16(158), B(Star), R(14), B(LdaConstant), U8(12), B(Star), R(15), diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden index c7f5101dd7..dbe688f814 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden @@ -4,7 +4,6 @@ --- wrap: yes -private fields: yes --- snippet: " diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateMethods.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateMethods.golden new file mode 100644 index 0000000000..e783d81376 --- /dev/null +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateMethods.golden @@ -0,0 +1,139 @@ +# +# Autogenerated by generate-bytecode-expectations. +# + +--- +wrap: yes +private methods: yes + +--- +snippet: " + { + class A { + #a() { return 1; } + } + + new A; + } +" +frame size: 7 +parameter count: 1 +bytecode array length: 62 +bytecodes: [ + /* 30 E> */ B(StackCheck), + B(CreateBlockContext), U8(0), + B(PushContext), R(2), + B(LdaTheHole), + B(Star), R(6), + B(CreateClosure), U8(2), U8(0), U8(2), + B(Star), R(3), + B(LdaConstant), U8(1), + B(Star), R(4), + B(CreateClosure), U8(3), U8(1), U8(2), + B(StaCurrentContextSlot), U8(4), + B(Mov), R(3), R(5), + B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3), + B(Star), R(4), + B(Mov), R(5), R(1), + B(LdaConstant), U8(4), + B(Star), R(5), + B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1), + B(StaCurrentContextSlot), U8(5), + B(PopContext), R(2), + B(Mov), R(1), R(0), + /* 78 S> */ B(Ldar), R(0), + /* 78 E> */ B(Construct), R(0), R(0), U8(0), U8(0), + B(LdaUndefined), + /* 87 S> */ B(Return), +] +constant pool: [ + SCOPE_INFO_TYPE, + FIXED_ARRAY_TYPE, + SHARED_FUNCTION_INFO_TYPE, + SHARED_FUNCTION_INFO_TYPE, + ONE_BYTE_INTERNALIZED_STRING_TYPE ["A"], +] +handlers: [ +] + +--- +snippet: " + { + class D { + #d() {} + } + + class E extends D { + #e() {} + } + + new D; + new E; + } +" +frame size: 9 +parameter count: 1 +bytecode array length: 121 +bytecodes: [ + /* 30 E> */ B(StackCheck), + B(CreateBlockContext), U8(0), + B(PushContext), R(4), + B(LdaTheHole), + B(Star), R(8), + B(CreateClosure), U8(2), U8(0), U8(2), + B(Star), R(5), + B(LdaConstant), U8(1), + B(Star), R(6), + B(CreateClosure), U8(3), U8(1), U8(2), + B(StaCurrentContextSlot), U8(4), + B(Mov), R(5), R(7), + B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(3), + B(Star), R(6), + B(Mov), R(7), R(3), + B(LdaConstant), U8(4), + B(Star), R(7), + B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(7), U8(1), + B(StaCurrentContextSlot), U8(5), + B(PopContext), R(4), + B(Mov), R(3), R(0), + /* 38 E> */ B(CreateBlockContext), U8(5), + B(PushContext), R(4), + /* 83 E> */ B(CreateClosure), U8(7), U8(2), U8(2), + B(Star), R(5), + B(LdaConstant), U8(6), + B(Star), R(6), + B(CreateClosure), U8(8), U8(3), U8(2), + B(StaCurrentContextSlot), U8(4), + B(Mov), R(5), R(7), + B(Mov), R(3), R(8), + B(CallRuntime), U16(Runtime::kDefineClass), R(6), U8(3), + B(Star), R(6), + B(Mov), R(7), R(2), + B(LdaConstant), U8(9), + B(Star), R(7), + B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(7), U8(1), + B(StaCurrentContextSlot), U8(5), + B(PopContext), R(4), + B(Mov), R(2), R(1), + /* 106 S> */ B(Ldar), R(3), + /* 106 E> */ B(Construct), R(3), R(0), U8(0), U8(0), + /* 115 S> */ B(Ldar), R(2), + /* 115 E> */ B(Construct), R(2), R(0), U8(0), U8(2), + B(LdaUndefined), + /* 124 S> */ B(Return), +] +constant pool: [ + SCOPE_INFO_TYPE, + FIXED_ARRAY_TYPE, + SHARED_FUNCTION_INFO_TYPE, + SHARED_FUNCTION_INFO_TYPE, + ONE_BYTE_INTERNALIZED_STRING_TYPE ["D"], + SCOPE_INFO_TYPE, + FIXED_ARRAY_TYPE, + SHARED_FUNCTION_INFO_TYPE, + SHARED_FUNCTION_INFO_TYPE, + ONE_BYTE_INTERNALIZED_STRING_TYPE ["E"], +] +handlers: [ +] + diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden index 6671c1fb06..c91e7b06aa 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden @@ -4,7 +4,6 @@ --- wrap: yes -public fields: yes --- snippet: " diff --git a/deps/v8/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden b/deps/v8/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden index 752e4cdc6f..f03337e4aa 100644 --- a/deps/v8/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden +++ b/deps/v8/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden @@ -4,8 +4,6 @@ --- wrap: yes -public fields: yes -static fields: yes --- snippet: " diff --git a/deps/v8/test/cctest/interpreter/generate-bytecode-expectations.cc b/deps/v8/test/cctest/interpreter/generate-bytecode-expectations.cc index 245d9d9afd..af18097284 100644 --- a/deps/v8/test/cctest/interpreter/generate-bytecode-expectations.cc +++ b/deps/v8/test/cctest/interpreter/generate-bytecode-expectations.cc @@ -43,10 +43,7 @@ class ProgramOptions final { print_callee_(false), oneshot_opt_(false), async_iteration_(false), - public_fields_(false), - private_fields_(false), private_methods_(false), - static_fields_(false), verbose_(false) {} bool Validate() const; @@ -67,10 +64,7 @@ class ProgramOptions final { bool print_callee() const { return print_callee_; } bool oneshot_opt() const { return oneshot_opt_; } bool async_iteration() const { return async_iteration_; } - bool public_fields() const { return public_fields_; } - bool private_fields() const { return private_fields_; } bool private_methods() const { return private_methods_; } - bool static_fields() const { return static_fields_; } bool verbose() const { return verbose_; } bool suppress_runtime_errors() const { return rebaseline_ && !verbose_; } std::vector<std::string> input_filenames() const { return input_filenames_; } @@ -89,10 +83,7 @@ class ProgramOptions final { bool print_callee_; bool oneshot_opt_; bool async_iteration_; - bool public_fields_; - bool private_fields_; bool private_methods_; - bool static_fields_; bool verbose_; std::vector<std::string> input_filenames_; std::string output_filename_; @@ -134,8 +125,8 @@ bool CollectGoldenFiles(std::vector<std::string>* golden_file_list, if (!directory) return false; auto str_ends_with = [](const char* string, const char* suffix) { - int string_size = i::StrLength(string); - int suffix_size = i::StrLength(suffix); + size_t string_size = strlen(string); + size_t suffix_size = strlen(suffix); if (string_size < suffix_size) return false; return strcmp(string + (string_size - suffix_size), suffix) == 0; @@ -195,14 +186,8 @@ ProgramOptions ProgramOptions::FromCommandLine(int argc, char** argv) { options.oneshot_opt_ = false; } else if (strcmp(argv[i], "--async-iteration") == 0) { options.async_iteration_ = true; - } else if (strcmp(argv[i], "--public-fields") == 0) { - options.public_fields_ = true; - } else if (strcmp(argv[i], "--private-fields") == 0) { - options.private_fields_ = true; } else if (strcmp(argv[i], "--private-methods") == 0) { options.private_methods_ = true; - } else if (strcmp(argv[i], "--static-fields") == 0) { - options.static_fields_ = true; } else if (strcmp(argv[i], "--verbose") == 0) { options.verbose_ = true; } else if (strncmp(argv[i], "--output=", 9) == 0) { @@ -312,21 +297,14 @@ void ProgramOptions::UpdateFromHeader(std::istream& stream) { oneshot_opt_ = ParseBoolean(line.c_str() + strlen(kOneshotOpt)); } else if (line.compare(0, 17, "async iteration: ") == 0) { async_iteration_ = ParseBoolean(line.c_str() + 17); - } else if (line.compare(0, 15, "public fields: ") == 0) { - public_fields_ = ParseBoolean(line.c_str() + 15); - } else if (line.compare(0, 16, "private fields: ") == 0) { - private_fields_ = ParseBoolean(line.c_str() + 16); } else if (line.compare(0, 16, "private methods: ") == 0) { private_methods_ = ParseBoolean(line.c_str() + 16); - } else if (line.compare(0, 15, "static fields: ") == 0) { - static_fields_ = ParseBoolean(line.c_str() + 15); } else if (line == "---") { break; } else if (line.empty()) { continue; } else { UNREACHABLE(); - return; } } } @@ -344,10 +322,7 @@ void ProgramOptions::PrintHeader(std::ostream& stream) const { // NOLINT if (print_callee_) stream << "\nprint callee: yes"; if (oneshot_opt_) stream << "\noneshot opt: yes"; if (async_iteration_) stream << "\nasync iteration: yes"; - if (public_fields_) stream << "\npublic fields: yes"; - if (private_fields_) stream << "\nprivate fields: yes"; if (private_methods_) stream << "\nprivate methods: yes"; - if (static_fields_) stream << "\nstatic fields: yes"; stream << "\n\n"; } @@ -456,10 +431,7 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT printer.set_test_function_name(options.test_function_name()); } - if (options.public_fields()) i::FLAG_harmony_public_fields = true; - if (options.private_fields()) i::FLAG_harmony_private_fields = true; if (options.private_methods()) i::FLAG_harmony_private_methods = true; - if (options.static_fields()) i::FLAG_harmony_static_fields = true; stream << "#\n# Autogenerated by generate-bytecode-expectations.\n#\n\n"; options.PrintHeader(stream); @@ -467,10 +439,7 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT printer.PrintExpectation(stream, snippet); } - i::FLAG_harmony_public_fields = false; - i::FLAG_harmony_private_fields = false; i::FLAG_harmony_private_methods = false; - i::FLAG_harmony_static_fields = false; } bool WriteExpectationsFile(const std::vector<std::string>& snippet_list, @@ -519,10 +488,7 @@ void PrintUsage(const char* exec_path) { " --test-function-name=foo " "Specify the name of the test function.\n" " --top-level Process top level code, not the top-level function.\n" - " --public-fields Enable harmony_public_fields flag.\n" - " --private-fields Enable harmony_private_fields flag.\n" " --private-methods Enable harmony_private_methods flag.\n" - " --static-fields Enable harmony_static_fields flag.\n" " --output=file.name\n" " Specify the output file. If not specified, output goes to " "stdout.\n" diff --git a/deps/v8/test/cctest/interpreter/interpreter-tester.cc b/deps/v8/test/cctest/interpreter/interpreter-tester.cc index c66c1a279b..6246dde025 100644 --- a/deps/v8/test/cctest/interpreter/interpreter-tester.cc +++ b/deps/v8/test/cctest/interpreter/interpreter-tester.cc @@ -4,9 +4,9 @@ #include "test/cctest/interpreter/interpreter-tester.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/heap/heap-inl.h" -#include "src/objects-inl.h" +#include "src/objects/objects-inl.h" namespace v8 { namespace internal { @@ -31,10 +31,8 @@ InterpreterTester::InterpreterTester( InterpreterTester::InterpreterTester( Isolate* isolate, Handle<BytecodeArray> bytecode, MaybeHandle<FeedbackMetadata> feedback_metadata, const char* filter) - : InterpreterTester( - isolate, nullptr, bytecode, - FLAG_lite_mode ? MaybeHandle<FeedbackMetadata>() : feedback_metadata, - filter) {} + : InterpreterTester(isolate, nullptr, bytecode, feedback_metadata, filter) { +} InterpreterTester::InterpreterTester(Isolate* isolate, const char* source, const char* filter) diff --git a/deps/v8/test/cctest/interpreter/interpreter-tester.h b/deps/v8/test/cctest/interpreter/interpreter-tester.h index a768908998..fbc2666c10 100644 --- a/deps/v8/test/cctest/interpreter/interpreter-tester.h +++ b/deps/v8/test/cctest/interpreter/interpreter-tester.h @@ -5,11 +5,11 @@ #ifndef V8_TEST_CCTEST_INTERPRETER_INTERPRETER_TESTER_H_ #define V8_TEST_CCTEST_INTERPRETER_INTERPRETER_TESTER_H_ -#include "src/v8.h" +#include "src/init/v8.h" -#include "src/api.h" -#include "src/execution.h" -#include "src/handles.h" +#include "src/api/api.h" +#include "src/execution/execution.h" +#include "src/handles/handles.h" #include "src/interpreter/bytecode-array-builder.h" #include "src/interpreter/interpreter.h" #include "src/objects/feedback-cell.h" @@ -122,13 +122,13 @@ class InterpreterTester { } if (!bytecode_.is_null()) { - function->shared()->set_function_data(*bytecode_.ToHandleChecked()); + function->shared().set_function_data(*bytecode_.ToHandleChecked()); } if (HasFeedbackMetadata()) { function->set_raw_feedback_cell(isolate_->heap()->many_closures_cell()); // Set the raw feedback metadata to circumvent checks that we are not // overwriting existing metadata. - function->shared()->set_raw_outer_scope_info_or_feedback_metadata( + function->shared().set_raw_outer_scope_info_or_feedback_metadata( *feedback_metadata_.ToHandleChecked()); JSFunction::EnsureFeedbackVector(function); } diff --git a/deps/v8/test/cctest/interpreter/source-position-matcher.cc b/deps/v8/test/cctest/interpreter/source-position-matcher.cc index 2fcc292b1c..07fde890e8 100644 --- a/deps/v8/test/cctest/interpreter/source-position-matcher.cc +++ b/deps/v8/test/cctest/interpreter/source-position-matcher.cc @@ -4,8 +4,8 @@ #include "test/cctest/interpreter/source-position-matcher.h" -#include "src/objects-inl.h" -#include "src/objects.h" +#include "src/objects/objects-inl.h" +#include "src/objects/objects.h" namespace v8 { namespace internal { diff --git a/deps/v8/test/cctest/interpreter/source-position-matcher.h b/deps/v8/test/cctest/interpreter/source-position-matcher.h index 7cc49cc20c..dc7a4ca450 100644 --- a/deps/v8/test/cctest/interpreter/source-position-matcher.h +++ b/deps/v8/test/cctest/interpreter/source-position-matcher.h @@ -5,10 +5,10 @@ #ifndef TEST_CCTEST_INTERPRETER_SOURCE_POSITION_COMPARER_H_ #define TEST_CCTEST_INTERPRETER_SOURCE_POSITION_COMPARER_H_ +#include "src/codegen/source-position-table.h" +#include "src/init/v8.h" #include "src/interpreter/bytecode-array-iterator.h" -#include "src/objects.h" -#include "src/source-position-table.h" -#include "src/v8.h" +#include "src/objects/objects.h" namespace v8 { namespace internal { diff --git a/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc b/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc index 168dabd8dc..3a4d089786 100644 --- a/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc +++ b/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc @@ -4,12 +4,12 @@ #include <fstream> -#include "src/v8.h" +#include "src/init/v8.h" #include "src/interpreter/bytecode-array-iterator.h" #include "src/interpreter/bytecode-generator.h" #include "src/interpreter/interpreter.h" -#include "src/objects-inl.h" +#include "src/objects/objects-inl.h" #include "test/cctest/cctest.h" #include "test/cctest/interpreter/bytecode-expectations-printer.h" #include "test/cctest/test-feedback-vector.h" @@ -2650,8 +2650,6 @@ TEST(ClassAndSuperClass) { } TEST(PublicClassFields) { - bool old_flag = i::FLAG_harmony_public_fields; - i::FLAG_harmony_public_fields = true; InitializedIgnitionHandleScope scope; BytecodeExpectationsPrinter printer(CcTest::isolate()); @@ -2700,12 +2698,9 @@ TEST(PublicClassFields) { CHECK(CompareTexts(BuildActual(printer, snippets), LoadGolden("PublicClassFields.golden"))); - i::FLAG_harmony_public_fields = old_flag; } TEST(PrivateClassFields) { - bool old_flag = i::FLAG_harmony_private_fields; - i::FLAG_harmony_private_fields = true; InitializedIgnitionHandleScope scope; BytecodeExpectationsPrinter printer(CcTest::isolate()); @@ -2760,14 +2755,41 @@ TEST(PrivateClassFields) { CHECK(CompareTexts(BuildActual(printer, snippets), LoadGolden("PrivateClassFields.golden"))); - i::FLAG_harmony_private_fields = old_flag; +} + +TEST(PrivateMethods) { + bool old_methods_flag = i::FLAG_harmony_private_methods; + i::FLAG_harmony_private_methods = true; + InitializedIgnitionHandleScope scope; + BytecodeExpectationsPrinter printer(CcTest::isolate()); + + const char* snippets[] = { + "{\n" + " class A {\n" + " #a() { return 1; }\n" + " }\n" + "\n" + " new A;\n" + "}\n", + + "{\n" + " class D {\n" + " #d() {}\n" + " }\n" + "\n" + " class E extends D {\n" + " #e() {}\n" + " }\n" + "\n" + " new D;\n" + " new E;\n" + "}\n"}; + CHECK(CompareTexts(BuildActual(printer, snippets), + LoadGolden("PrivateMethods.golden"))); + i::FLAG_harmony_private_methods = old_methods_flag; } TEST(StaticClassFields) { - bool old_flag = i::FLAG_harmony_public_fields; - bool old_static_flag = i::FLAG_harmony_static_fields; - i::FLAG_harmony_public_fields = true; - i::FLAG_harmony_static_fields = true; InitializedIgnitionHandleScope scope; BytecodeExpectationsPrinter printer(CcTest::isolate()); @@ -2826,8 +2848,6 @@ TEST(StaticClassFields) { CHECK(CompareTexts(BuildActual(printer, snippets), LoadGolden("StaticClassFields.golden"))); - i::FLAG_harmony_public_fields = old_flag; - i::FLAG_harmony_static_fields = old_static_flag; } TEST(Generators) { diff --git a/deps/v8/test/cctest/interpreter/test-interpreter-intrinsics.cc b/deps/v8/test/cctest/interpreter/test-interpreter-intrinsics.cc index becc46ab9c..3e1c006f20 100644 --- a/deps/v8/test/cctest/interpreter/test-interpreter-intrinsics.cc +++ b/deps/v8/test/cctest/interpreter/test-interpreter-intrinsics.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/v8.h" +#include "src/init/v8.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/heap/heap-inl.h" #include "src/interpreter/interpreter-intrinsics.h" -#include "src/objects-inl.h" +#include "src/objects/objects-inl.h" #include "test/cctest/interpreter/interpreter-tester.h" namespace v8 { @@ -95,37 +95,6 @@ TEST(IsArray) { CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("42"))); } -TEST(IsTypedArray) { - HandleAndZoneScope handles; - - InvokeIntrinsicHelper helper(handles.main_isolate(), handles.main_zone(), - Runtime::kInlineIsTypedArray); - Factory* factory = handles.main_isolate()->factory(); - - CHECK_EQ(*factory->false_value(), - *helper.Invoke(helper.NewObject("new Date()"))); - CHECK_EQ(*factory->false_value(), - *helper.Invoke(helper.NewObject("(function() {})"))); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("([1])"))); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("({})"))); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("(/x/)"))); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.Undefined())); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.Null())); - CHECK_EQ(*factory->false_value(), - *helper.Invoke(helper.NewObject("'string'"))); - CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("42"))); - - CHECK_EQ( - *factory->true_value(), - *helper.Invoke(helper.NewObject("new Uint8Array(new ArrayBuffer(1));"))); - CHECK_EQ( - *factory->true_value(), - *helper.Invoke(helper.NewObject("new Uint16Array(new ArrayBuffer(2));"))); - CHECK_EQ( - *factory->true_value(), - *helper.Invoke(helper.NewObject("new Int32Array(new ArrayBuffer(4));"))); -} - TEST(IsSmi) { HandleAndZoneScope handles; diff --git a/deps/v8/test/cctest/interpreter/test-interpreter.cc b/deps/v8/test/cctest/interpreter/test-interpreter.cc index ba247dde50..9b907588ef 100644 --- a/deps/v8/test/cctest/interpreter/test-interpreter.cc +++ b/deps/v8/test/cctest/interpreter/test-interpreter.cc @@ -4,22 +4,22 @@ #include <tuple> -#include "src/v8.h" +#include "src/init/v8.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/base/overflowing-math.h" -#include "src/compiler.h" -#include "src/execution.h" -#include "src/handles.h" -#include "src/hash-seed-inl.h" +#include "src/codegen/compiler.h" +#include "src/execution/execution.h" +#include "src/handles/handles.h" #include "src/heap/heap-inl.h" #include "src/interpreter/bytecode-array-builder.h" #include "src/interpreter/bytecode-array-iterator.h" #include "src/interpreter/bytecode-flags.h" #include "src/interpreter/bytecode-label.h" #include "src/interpreter/interpreter.h" -#include "src/objects-inl.h" +#include "src/numbers/hash-seed-inl.h" #include "src/objects/heap-number-inl.h" +#include "src/objects/objects-inl.h" #include "src/objects/smi.h" #include "test/cctest/cctest.h" #include "test/cctest/interpreter/interpreter-tester.h" @@ -176,7 +176,7 @@ TEST(InterpreterLoadLiteral) { InterpreterTester tester(isolate, bytecode_array); auto callable = tester.GetCallable<>(); Handle<Object> return_val = callable().ToHandleChecked(); - CHECK_EQ(i::HeapNumber::cast(*return_val)->value(), -2.1e19); + CHECK_EQ(i::HeapNumber::cast(*return_val).value(), -2.1e19); } // Strings. @@ -195,7 +195,7 @@ TEST(InterpreterLoadLiteral) { InterpreterTester tester(isolate, bytecode_array); auto callable = tester.GetCallable<>(); Handle<Object> return_val = callable().ToHandleChecked(); - CHECK(i::String::cast(*return_val)->Equals(*raw_string->string())); + CHECK(i::String::cast(*return_val).Equals(*raw_string->string())); } } @@ -424,7 +424,7 @@ TEST(InterpreterBinaryOpsBigInt) { Handle<Object> return_value = callable().ToHandleChecked(); CHECK(return_value->IsBigInt()); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kBigInt, feedback->ToSmi().value()); } @@ -546,7 +546,7 @@ TEST(InterpreterStringAdd) { CHECK(return_value->SameValue(*test_cases[i].expected_value)); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); CHECK_EQ(test_cases[i].expected_feedback, feedback->ToSmi().value()); } @@ -609,7 +609,7 @@ TEST(InterpreterParameter8) { Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); InterpreterTester tester(isolate, bytecode_array, metadata); - typedef Handle<Object> H; + using H = Handle<Object>; auto callable = tester.GetCallable<H, H, H, H, H, H, H, H>(); Handle<Smi> arg1 = Handle<Smi>(Smi::FromInt(1), handles.main_isolate()); @@ -628,8 +628,6 @@ TEST(InterpreterParameter8) { } TEST(InterpreterBinaryOpTypeFeedback) { - if (FLAG_lite_mode) return; - HandleAndZoneScope handles; i::Isolate* isolate = handles.main_isolate(); Zone* zone = handles.main_zone(); @@ -754,7 +752,7 @@ TEST(InterpreterBinaryOpTypeFeedback) { auto callable = tester.GetCallable<>(); Handle<Object> return_val = callable().ToHandleChecked(); - MaybeObject feedback0 = callable.vector()->Get(slot0); + MaybeObject feedback0 = callable.vector().Get(slot0); CHECK(feedback0->IsSmi()); CHECK_EQ(test_case.feedback, feedback0->ToSmi().value()); CHECK(Object::Equals(isolate, test_case.result, return_val).ToChecked()); @@ -762,8 +760,6 @@ TEST(InterpreterBinaryOpTypeFeedback) { } TEST(InterpreterBinaryOpSmiTypeFeedback) { - if (FLAG_lite_mode) return; - HandleAndZoneScope handles; i::Isolate* isolate = handles.main_isolate(); Zone* zone = handles.main_zone(); @@ -862,7 +858,7 @@ TEST(InterpreterBinaryOpSmiTypeFeedback) { auto callable = tester.GetCallable<>(); Handle<Object> return_val = callable().ToHandleChecked(); - MaybeObject feedback0 = callable.vector()->Get(slot0); + MaybeObject feedback0 = callable.vector().Get(slot0); CHECK(feedback0->IsSmi()); CHECK_EQ(test_case.feedback, feedback0->ToSmi().value()); CHECK(Object::Equals(isolate, test_case.result, return_val).ToChecked()); @@ -870,8 +866,6 @@ TEST(InterpreterBinaryOpSmiTypeFeedback) { } TEST(InterpreterUnaryOpFeedback) { - if (FLAG_lite_mode) return; - HandleAndZoneScope handles; i::Isolate* isolate = handles.main_isolate(); Zone* zone = handles.main_zone(); @@ -925,7 +919,7 @@ TEST(InterpreterUnaryOpFeedback) { Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); InterpreterTester tester(isolate, bytecode_array, metadata); - typedef Handle<Object> H; + using H = Handle<Object>; auto callable = tester.GetCallable<H, H, H, H, H>(); Handle<Object> return_val = @@ -935,31 +929,29 @@ TEST(InterpreterUnaryOpFeedback) { test_case.bigint_feedback_value, test_case.any_feedback_value) .ToHandleChecked(); USE(return_val); - MaybeObject feedback0 = callable.vector()->Get(slot0); + MaybeObject feedback0 = callable.vector().Get(slot0); CHECK(feedback0->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kSignedSmall, feedback0->ToSmi().value()); - MaybeObject feedback1 = callable.vector()->Get(slot1); + MaybeObject feedback1 = callable.vector().Get(slot1); CHECK(feedback1->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kNumber, feedback1->ToSmi().value()); - MaybeObject feedback2 = callable.vector()->Get(slot2); + MaybeObject feedback2 = callable.vector().Get(slot2); CHECK(feedback2->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kNumber, feedback2->ToSmi().value()); - MaybeObject feedback3 = callable.vector()->Get(slot3); + MaybeObject feedback3 = callable.vector().Get(slot3); CHECK(feedback3->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kBigInt, feedback3->ToSmi().value()); - MaybeObject feedback4 = callable.vector()->Get(slot4); + MaybeObject feedback4 = callable.vector().Get(slot4); CHECK(feedback4->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kAny, feedback4->ToSmi().value()); } } TEST(InterpreterBitwiseTypeFeedback) { - if (FLAG_lite_mode) return; - HandleAndZoneScope handles; i::Isolate* isolate = handles.main_isolate(); Zone* zone = handles.main_zone(); @@ -987,7 +979,7 @@ TEST(InterpreterBitwiseTypeFeedback) { Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); InterpreterTester tester(isolate, bytecode_array, metadata); - typedef Handle<Object> H; + using H = Handle<Object>; auto callable = tester.GetCallable<H, H, H, H>(); Handle<Smi> arg1 = Handle<Smi>(Smi::FromInt(2), isolate); @@ -998,15 +990,15 @@ TEST(InterpreterBitwiseTypeFeedback) { Handle<Object> return_val = callable(arg1, arg2, arg3, arg4).ToHandleChecked(); USE(return_val); - MaybeObject feedback0 = callable.vector()->Get(slot0); + MaybeObject feedback0 = callable.vector().Get(slot0); CHECK(feedback0->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kSignedSmall, feedback0->ToSmi().value()); - MaybeObject feedback1 = callable.vector()->Get(slot1); + MaybeObject feedback1 = callable.vector().Get(slot1); CHECK(feedback1->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kNumber, feedback1->ToSmi().value()); - MaybeObject feedback2 = callable.vector()->Get(slot2); + MaybeObject feedback2 = callable.vector().Get(slot2); CHECK(feedback2->IsSmi()); CHECK_EQ(BinaryOperationFeedback::kAny, feedback2->ToSmi().value()); } @@ -1489,7 +1481,7 @@ TEST(InterpreterCall) { Handle<Object> return_val = callable(object).ToHandleChecked(); Handle<i::String> expected = factory->NewStringFromAsciiChecked("prefix_abcdefghij"); - CHECK(i::String::cast(*return_val)->Equals(*expected)); + CHECK(i::String::cast(*return_val).Equals(*expected)); } } @@ -1831,7 +1823,7 @@ TEST(InterpreterSmiComparisons) { CHECK_EQ(return_value->BooleanValue(isolate), CompareC(comparison, inputs[i], inputs[j])); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); CHECK_EQ(CompareOperationFeedback::kSignedSmall, feedback->ToSmi().value()); @@ -1882,7 +1874,7 @@ TEST(InterpreterHeapNumberComparisons) { CHECK_EQ(return_value->BooleanValue(isolate), CompareC(comparison, inputs[i], inputs[j])); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); CHECK_EQ(CompareOperationFeedback::kNumber, feedback->ToSmi().value()); @@ -1927,7 +1919,7 @@ TEST(InterpreterBigIntComparisons) { Handle<Object> return_value = callable().ToHandleChecked(); CHECK(return_value->IsBoolean()); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); CHECK_EQ(CompareOperationFeedback::kBigInt, feedback->ToSmi().value()); @@ -1977,7 +1969,7 @@ TEST(InterpreterStringComparisons) { CHECK_EQ(return_value->BooleanValue(isolate), CompareC(comparison, inputs[i], inputs[j])); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); int const expected_feedback = Token::IsOrderedRelationalCompareOp(comparison) @@ -2090,7 +2082,7 @@ TEST(InterpreterMixedComparisons) { CHECK_EQ(return_value->BooleanValue(isolate), CompareC(comparison, lhs, rhs, true)); if (tester.HasFeedbackMetadata()) { - MaybeObject feedback = callable.vector()->Get(slot); + MaybeObject feedback = callable.vector().Get(slot); CHECK(feedback->IsSmi()); // Comparison with a number and string collects kAny feedback. CHECK_EQ(CompareOperationFeedback::kAny, @@ -2173,7 +2165,7 @@ TEST(InterpreterStrictNotEqual) { } TEST(InterpreterCompareTypeOf) { - typedef TestTypeOfFlags::LiteralFlag LiteralFlag; + using LiteralFlag = TestTypeOfFlags::LiteralFlag; HandleAndZoneScope handles; Isolate* isolate = handles.main_isolate(); Factory* factory = isolate->factory(); @@ -5030,14 +5022,14 @@ TEST(InterpreterWithNativeStack) { i::Handle<i::Object> o = v8::Utils::OpenHandle(*v8_compile(source_text)); i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); - CHECK(f->shared()->HasBytecodeArray()); - i::Code code = f->shared()->GetCode(); + CHECK(f->shared().HasBytecodeArray()); + i::Code code = f->shared().GetCode(); i::Handle<i::Code> interpreter_entry_trampoline = BUILTIN_CODE(isolate, InterpreterEntryTrampoline); - CHECK(code->IsCode()); - CHECK(code->is_interpreter_trampoline_builtin()); - CHECK_NE(code->address(), interpreter_entry_trampoline->address()); + CHECK(code.IsCode()); + CHECK(code.is_interpreter_trampoline_builtin()); + CHECK_NE(code.address(), interpreter_entry_trampoline->address()); } #endif // V8_TARGET_ARCH_ARM @@ -5050,24 +5042,24 @@ TEST(InterpreterGetBytecodeHandler) { Code wide_handler = interpreter->GetBytecodeHandler(Bytecode::kWide, OperandScale::kSingle); - CHECK_EQ(wide_handler->builtin_index(), Builtins::kWideHandler); + CHECK_EQ(wide_handler.builtin_index(), Builtins::kWideHandler); Code add_handler = interpreter->GetBytecodeHandler(Bytecode::kAdd, OperandScale::kSingle); - CHECK_EQ(add_handler->builtin_index(), Builtins::kAddHandler); + CHECK_EQ(add_handler.builtin_index(), Builtins::kAddHandler); // Test that double-width bytecode handlers deserializer correctly, including // an illegal bytecode handler since there is no Wide.Wide handler. Code wide_wide_handler = interpreter->GetBytecodeHandler(Bytecode::kWide, OperandScale::kDouble); - CHECK_EQ(wide_wide_handler->builtin_index(), Builtins::kIllegalHandler); + CHECK_EQ(wide_wide_handler.builtin_index(), Builtins::kIllegalHandler); Code add_wide_handler = interpreter->GetBytecodeHandler(Bytecode::kAdd, OperandScale::kDouble); - CHECK_EQ(add_wide_handler->builtin_index(), Builtins::kAddWideHandler); + CHECK_EQ(add_wide_handler.builtin_index(), Builtins::kAddWideHandler); } TEST(InterpreterCollectSourcePositions) { @@ -5092,7 +5084,7 @@ TEST(InterpreterCollectSourcePositions) { ByteArray source_position_table = bytecode_array->SourcePositionTable(); CHECK(bytecode_array->HasSourcePositionTable()); - CHECK_GT(source_position_table->length(), 0); + CHECK_GT(source_position_table.length(), 0); } TEST(InterpreterCollectSourcePositions_StackOverflow) { @@ -5121,19 +5113,17 @@ TEST(InterpreterCollectSourcePositions_StackOverflow) { // Stack overflowed so source position table can be returned but is empty. ByteArray source_position_table = bytecode_array->SourcePositionTable(); CHECK(!bytecode_array->HasSourcePositionTable()); - CHECK_EQ(source_position_table->length(), 0); + CHECK_EQ(source_position_table.length(), 0); // Reset the stack limit and try again. isolate->stack_guard()->SetStackLimit(previous_limit); Compiler::CollectSourcePositions(isolate, sfi); source_position_table = bytecode_array->SourcePositionTable(); CHECK(bytecode_array->HasSourcePositionTable()); - CHECK_GT(source_position_table->length(), 0); + CHECK_GT(source_position_table.length(), 0); } -// TODO(v8:8510): When an exception is thrown, the top frame still has its -// source positions collected. Re-enable this test when that is fixed. -DISABLED_TEST(InterpreterCollectSourcePositions_ThrowFrom1stFrame) { +TEST(InterpreterCollectSourcePositions_ThrowFrom1stFrame) { FLAG_enable_lazy_source_positions = true; HandleAndZoneScope handles; Isolate* isolate = handles.main_isolate(); @@ -5253,7 +5243,7 @@ TEST(InterpreterCollectSourcePositions_GenerateStackTrace) { CHECK(bytecode_array->HasSourcePositionTable()); ByteArray source_position_table = bytecode_array->SourcePositionTable(); - CHECK_GT(source_position_table->length(), 0); + CHECK_GT(source_position_table.length(), 0); } } // namespace interpreter diff --git a/deps/v8/test/cctest/interpreter/test-source-positions.cc b/deps/v8/test/cctest/interpreter/test-source-positions.cc index ccdbd53558..ee9d338f01 100644 --- a/deps/v8/test/cctest/interpreter/test-source-positions.cc +++ b/deps/v8/test/cctest/interpreter/test-source-positions.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "src/v8.h" +#include "src/init/v8.h" -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/compiler/pipeline.h" -#include "src/handles.h" +#include "src/execution/isolate.h" +#include "src/handles/handles.h" #include "src/interpreter/bytecode-generator.h" #include "src/interpreter/interpreter.h" -#include "src/isolate.h" -#include "src/objects-inl.h" +#include "src/objects/objects-inl.h" #include "test/cctest/cctest.h" #include "test/cctest/interpreter/source-position-matcher.h" @@ -172,7 +172,7 @@ Handle<BytecodeArray> OptimizedBytecodeSourcePositionTester::MakeBytecode( .ToLocalChecked()); Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); - return handle(function->shared()->GetBytecodeArray(), isolate_); + return handle(function->shared().GetBytecodeArray(), isolate_); } void OptimizedBytecodeSourcePositionTester::SetOptimizationFlags( |