diff options
author | Matheus Marchini <mmarchini@netflix.com> | 2020-03-05 10:49:19 -0800 |
---|---|---|
committer | Matheus Marchini <mmarchini@netflix.com> | 2020-03-18 16:23:22 -0700 |
commit | 2883c855e0105b51e5c8020d21458af109ffe3d4 (patch) | |
tree | 26777aad0a398e9f7755c8b65ac76827fe352a81 /deps/v8/src/execution/messages.cc | |
parent | 5f0af2af2a67216e00fe07ccda11e889d14abfcd (diff) | |
download | node-new-2883c855e0105b51e5c8020d21458af109ffe3d4.tar.gz |
deps: update V8 to 8.1.307.20
PR-URL: https://github.com/nodejs/node/pull/32116
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps/v8/src/execution/messages.cc')
-rw-r--r-- | deps/v8/src/execution/messages.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/deps/v8/src/execution/messages.cc b/deps/v8/src/execution/messages.cc index 96fb94cd4e..f11ab23848 100644 --- a/deps/v8/src/execution/messages.cc +++ b/deps/v8/src/execution/messages.cc @@ -320,6 +320,8 @@ Handle<Object> StackFrameBase::GetWasmModuleName() { return isolate_->factory()->undefined_value(); } +int StackFrameBase::GetWasmFunctionIndex() { return StackFrameBase::kNone; } + Handle<Object> StackFrameBase::GetWasmInstance() { return isolate_->factory()->undefined_value(); } @@ -389,8 +391,8 @@ namespace { bool CheckMethodName(Isolate* isolate, Handle<JSReceiver> receiver, Handle<Name> name, Handle<JSFunction> fun, LookupIterator::Configuration config) { - LookupIterator iter = - LookupIterator::PropertyOrElement(isolate, receiver, name, config); + LookupIterator::Key key(isolate, name); + LookupIterator iter(isolate, receiver, key, config); if (iter.state() == LookupIterator::DATA) { return iter.GetDataValue().is_identical_to(fun); } else if (iter.state() == LookupIterator::ACCESSOR) { @@ -652,12 +654,9 @@ int AsmJsWasmStackFrame::GetPosition() const { int byte_offset = FrameSummary::WasmCompiledFrameSummary::GetWasmSourcePosition(code_, offset_); - Handle<WasmModuleObject> module_object(wasm_instance_->module_object(), - isolate_); - DCHECK_LE(0, byte_offset); - return WasmModuleObject::GetSourcePosition(module_object, wasm_func_index_, - static_cast<uint32_t>(byte_offset), - is_at_number_conversion_); + const wasm::WasmModule* module = wasm_instance_->module(); + return GetSourcePosition(module, wasm_func_index_, byte_offset, + is_at_number_conversion_); } int AsmJsWasmStackFrame::GetLineNumber() { @@ -687,7 +686,7 @@ void FrameArrayIterator::Advance() { frame_ix_++; } StackFrameBase* FrameArrayIterator::Frame() { DCHECK(HasFrame()); const int flags = array_->Flags(frame_ix_).value(); - int flag_mask = FrameArray::kIsWasmFrame | + int flag_mask = FrameArray::kIsWasmCompiledFrame | FrameArray::kIsWasmInterpretedFrame | FrameArray::kIsAsmJsWasmFrame; switch (flags & flag_mask) { @@ -695,7 +694,7 @@ StackFrameBase* FrameArrayIterator::Frame() { // JavaScript Frame. js_frame_.FromFrameArray(isolate_, array_, frame_ix_); return &js_frame_; - case FrameArray::kIsWasmFrame: + case FrameArray::kIsWasmCompiledFrame: case FrameArray::kIsWasmInterpretedFrame: // Wasm Frame: wasm_frame_.FromFrameArray(isolate_, array_, frame_ix_); @@ -991,7 +990,7 @@ MaybeHandle<String> MessageFormatter::Format(Isolate* isolate, return builder.Finish(); } -MaybeHandle<Object> ErrorUtils::Construct( +MaybeHandle<JSObject> ErrorUtils::Construct( Isolate* isolate, Handle<JSFunction> target, Handle<Object> new_target, Handle<Object> message, FrameSkipMode mode, Handle<Object> caller, StackTraceCollection stack_trace_collection) { @@ -1008,7 +1007,7 @@ MaybeHandle<Object> ErrorUtils::Construct( ASSIGN_RETURN_ON_EXCEPTION( isolate, err, JSObject::New(target, new_target_recv, Handle<AllocationSite>::null()), - Object); + JSObject); // 3. If message is not undefined, then // a. Let msg be ? ToString(message). @@ -1020,23 +1019,23 @@ MaybeHandle<Object> ErrorUtils::Construct( if (!message->IsUndefined(isolate)) { Handle<String> msg_string; ASSIGN_RETURN_ON_EXCEPTION(isolate, msg_string, - Object::ToString(isolate, message), Object); + Object::ToString(isolate, message), JSObject); RETURN_ON_EXCEPTION( isolate, JSObject::SetOwnPropertyIgnoreAttributes( err, isolate->factory()->message_string(), msg_string, DONT_ENUM), - Object); + JSObject); } switch (stack_trace_collection) { case StackTraceCollection::kDetailed: RETURN_ON_EXCEPTION( - isolate, isolate->CaptureAndSetDetailedStackTrace(err), Object); + isolate, isolate->CaptureAndSetDetailedStackTrace(err), JSObject); V8_FALLTHROUGH; case StackTraceCollection::kSimple: RETURN_ON_EXCEPTION( isolate, isolate->CaptureAndSetSimpleStackTrace(err, mode, caller), - Object); + JSObject); break; case StackTraceCollection::kNone: break; @@ -1145,7 +1144,7 @@ Handle<String> DoFormatMessage(Isolate* isolate, MessageTemplate index, } // namespace // static -MaybeHandle<Object> ErrorUtils::MakeGenericError( +Handle<JSObject> ErrorUtils::MakeGenericError( Isolate* isolate, Handle<JSFunction> constructor, MessageTemplate index, Handle<Object> arg0, Handle<Object> arg1, Handle<Object> arg2, FrameSkipMode mode) { @@ -1168,8 +1167,11 @@ MaybeHandle<Object> ErrorUtils::MakeGenericError( DCHECK(mode != SKIP_UNTIL_SEEN); Handle<Object> no_caller; + // The call below can't fail because constructor is a builtin. + DCHECK(constructor->shared().HasBuiltinId()); return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, - no_caller, StackTraceCollection::kDetailed); + no_caller, StackTraceCollection::kDetailed) + .ToHandleChecked(); } namespace { @@ -1226,9 +1228,9 @@ Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object, MessageLocation* location, CallPrinter::ErrorHint* hint) { if (ComputeLocation(isolate, location)) { - ParseInfo info(isolate, location->shared()); + ParseInfo info(isolate, *location->shared()); if (parsing::ParseAny(&info, location->shared(), isolate)) { - info.ast_value_factory()->Internalize(isolate); + info.ast_value_factory()->Internalize(isolate->factory()); CallPrinter printer(isolate, location->shared()->IsUserJavaScript()); Handle<String> str = printer.Print(info.literal(), location->start_pos()); *hint = printer.GetErrorHint(); @@ -1327,9 +1329,9 @@ Object ErrorUtils::ThrowLoadFromNullOrUndefined(Isolate* isolate, if (ComputeLocation(isolate, &location)) { location_computed = true; - ParseInfo info(isolate, location.shared()); + ParseInfo info(isolate, *location.shared()); if (parsing::ParseAny(&info, location.shared(), isolate)) { - info.ast_value_factory()->Internalize(isolate); + info.ast_value_factory()->Internalize(isolate->factory()); CallPrinter printer(isolate, location.shared()->IsUserJavaScript()); Handle<String> str = printer.Print(info.literal(), location.start_pos()); @@ -1346,7 +1348,8 @@ Object ErrorUtils::ThrowLoadFromNullOrUndefined(Isolate* isolate, maybe_property_name = destructuring_prop->key() ->AsLiteral() ->AsRawPropertyName() - ->string(); + ->string() + .get<Factory>(); // Change the message location to point at the property name. pos = destructuring_prop->key()->position(); } |