| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index 235faa3c3998dc1f9e22db7948927177d51abf92..1e6a92908261652e2ef82ac809f03146d2fdb93e 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -1481,6 +1481,12 @@ Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) {
|
| Code);
|
| }
|
|
|
| +Handle<BytecodeArray> Factory::CopyBytecodeArray(
|
| + Handle<BytecodeArray> bytecode_array) {
|
| + CALL_HEAP_FUNCTION(isolate(),
|
| + isolate()->heap()->CopyBytecodeArray(*bytecode_array),
|
| + BytecodeArray);
|
| +}
|
|
|
| Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor,
|
| PretenureFlag pretenure) {
|
| @@ -2129,7 +2135,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
|
| share->set_instance_class_name(*Object_string());
|
| share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER);
|
| share->set_script(*undefined_value(), SKIP_WRITE_BARRIER);
|
| - share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER);
|
| + share->set_debug_info(DebugInfo::uninitialized(), SKIP_WRITE_BARRIER);
|
| share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER);
|
| StaticFeedbackVectorSpec empty_spec;
|
| Handle<TypeFeedbackMetadata> feedback_metadata =
|
| @@ -2251,7 +2257,10 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
|
| Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
|
| debug_info->set_shared(*shared);
|
| if (shared->HasBytecodeArray()) {
|
| - debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array()));
|
| + // Create a copy for debugging.
|
| + Handle<BytecodeArray> original(shared->bytecode_array(), isolate());
|
| + Handle<BytecodeArray> copy = CopyBytecodeArray(original);
|
| + debug_info->set_abstract_code(AbstractCode::cast(*copy));
|
| } else {
|
| debug_info->set_abstract_code(AbstractCode::cast(shared->code()));
|
| }
|
|
|