diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc index adc80d0ae1..f20b3a64a3 100644 --- a/src/builtins/arm/builtins-arm.cc +++ b/src/builtins/arm/builtins-arm.cc @@ -1002,7 +1002,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { Register debug_info = kInterpreterBytecodeArrayRegister; DCHECK(!debug_info.is(r0)); __ ldr(debug_info, FieldMemOperand(r0, SharedFunctionInfo::kDebugInfoOffset)); - __ cmp(debug_info, Operand(DebugInfo::uninitialized())); + __ SmiTst(debug_info); // Load original bytecode array or the debug copy. __ ldr(kInterpreterBytecodeArrayRegister, FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset), eq); diff --git a/src/builtins/arm64/builtins-arm64.cc b/src/builtins/arm64/builtins-arm64.cc index ee416b148f..2cd3aae2d1 100644 --- a/src/builtins/arm64/builtins-arm64.cc +++ b/src/builtins/arm64/builtins-arm64.cc @@ -1007,8 +1007,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { Label load_debug_bytecode_array, bytecode_array_loaded; DCHECK(!debug_info.is(x0)); __ Ldr(debug_info, FieldMemOperand(x0, SharedFunctionInfo::kDebugInfoOffset)); - __ Cmp(debug_info, Operand(DebugInfo::uninitialized())); - __ B(ne, &load_debug_bytecode_array); + __ JumpIfNotSmi(debug_info, &load_debug_bytecode_array); __ Ldr(kInterpreterBytecodeArrayRegister, FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); __ Bind(&bytecode_array_loaded); diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc index c2785e6c34..4d366f6a06 100644 --- a/src/builtins/ia32/builtins-ia32.cc +++ b/src/builtins/ia32/builtins-ia32.cc @@ -534,9 +534,8 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { // it is present) and load it into kInterpreterBytecodeArrayRegister. __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); Label load_debug_bytecode_array, bytecode_array_loaded; - __ cmp(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset), - Immediate(DebugInfo::uninitialized())); - __ j(not_equal, &load_debug_bytecode_array); + __ JumpIfNotSmi(FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset), + &load_debug_bytecode_array); __ mov(kInterpreterBytecodeArrayRegister, FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); __ bind(&bytecode_array_loaded); diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc index b011d7be2f..56dc7479e5 100644 --- a/src/builtins/mips/builtins-mips.cc +++ b/src/builtins/mips/builtins-mips.cc @@ -1005,8 +1005,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { Register debug_info = kInterpreterBytecodeArrayRegister; DCHECK(!debug_info.is(a0)); __ lw(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset)); - __ Branch(&load_debug_bytecode_array, ne, debug_info, - Operand(DebugInfo::uninitialized())); + __ JumpIfNotSmi(debug_info, &load_debug_bytecode_array); __ lw(kInterpreterBytecodeArrayRegister, FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); __ bind(&bytecode_array_loaded); diff --git a/src/builtins/mips64/builtins-mips64.cc b/src/builtins/mips64/builtins-mips64.cc index 0e97668afb..ebb18a72f9 100644 --- a/src/builtins/mips64/builtins-mips64.cc +++ b/src/builtins/mips64/builtins-mips64.cc @@ -996,8 +996,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { Register debug_info = kInterpreterBytecodeArrayRegister; DCHECK(!debug_info.is(a0)); __ ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset)); - __ Branch(&load_debug_bytecode_array, ne, debug_info, - Operand(DebugInfo::uninitialized())); + __ JumpIfNotSmi(debug_info, &load_debug_bytecode_array); __ ld(kInterpreterBytecodeArrayRegister, FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); __ bind(&bytecode_array_loaded); diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc index 1fb77d9a40..b232077e65 100644 --- a/src/builtins/x64/builtins-x64.cc +++ b/src/builtins/x64/builtins-x64.cc @@ -610,10 +610,8 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { // it is present) and load it into kInterpreterBytecodeArrayRegister. __ movp(rax, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); Label load_debug_bytecode_array, bytecode_array_loaded; - DCHECK_EQ(Smi::kZero, DebugInfo::uninitialized()); - __ cmpp(FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset), - Immediate(0)); - __ j(not_equal, &load_debug_bytecode_array); + __ JumpIfNotSmi(FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset), + &load_debug_bytecode_array); __ movp(kInterpreterBytecodeArrayRegister, FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset)); __ bind(&bytecode_array_loaded); diff --git a/src/debug/debug.cc b/src/debug/debug.cc index 2c763915bd..4f1e373977 100644 --- a/src/debug/debug.cc +++ b/src/debug/debug.cc @@ -1560,8 +1560,8 @@ void Debug::RemoveDebugInfoAndClearFromShared(Handle debug_info) { } else { prev->set_next(current->next()); } + shared->set_debug_info(Smi::FromInt(debug_info->debugger_hints())); delete current; - shared->set_debug_info(DebugInfo::uninitialized()); return; } // Move to next in list. diff --git a/src/factory.cc b/src/factory.cc index fac61a6ee8..4aa6206320 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -2405,7 +2405,7 @@ Handle Factory::NewSharedFunctionInfo( share->SetConstructStub(*construct_stub); share->set_instance_class_name(*Object_string()); share->set_script(*undefined_value(), SKIP_WRITE_BARRIER); - share->set_debug_info(DebugInfo::uninitialized(), SKIP_WRITE_BARRIER); + share->set_debug_info(Smi::kZero, SKIP_WRITE_BARRIER); share->set_function_identifier(*undefined_value(), SKIP_WRITE_BARRIER); StaticFeedbackVectorSpec empty_spec; Handle feedback_metadata = @@ -2509,6 +2509,7 @@ Handle Factory::NumberToString(Handle number, Handle Factory::NewDebugInfo(Handle shared) { + DCHECK(!shared->HasDebugInfo()); // Allocate initial fixed array for active break points before allocating the // debug info object to avoid allocation while setting up the debug info // object. @@ -2528,6 +2529,7 @@ Handle Factory::NewDebugInfo(Handle shared) { Handle debug_info = Handle::cast(NewStruct(DEBUG_INFO_TYPE)); debug_info->set_shared(*shared); + debug_info->set_debugger_hints(shared->debugger_hints()); debug_info->set_debug_bytecode_array(*maybe_debug_bytecode_array); debug_info->set_break_points(*break_points); diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h index 50ff068551..15b7c608d2 100644 --- a/src/ia32/macro-assembler-ia32.h +++ b/src/ia32/macro-assembler-ia32.h @@ -476,7 +476,12 @@ class MacroAssembler: public Assembler { test(value, Immediate(kSmiTagMask)); j(not_zero, not_smi_label, distance); } - + // Jump if the operand is not a smi. + inline void JumpIfNotSmi(Operand value, Label* smi_label, + Label::Distance distance = Label::kFar) { + test(value, Immediate(kSmiTagMask)); + j(not_zero, smi_label, distance); + } // Jump if the value cannot be represented by a smi. inline void JumpIfNotValidSmiValue(Register value, Register scratch, Label* on_invalid, diff --git a/src/objects-inl.h b/src/objects-inl.h index f468c55a56..c09dfe4db8 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -5974,6 +5974,7 @@ void Script::set_origin_options(ScriptOriginOptions origin_options) { ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) +SMI_ACCESSORS(DebugInfo, debugger_hints, kDebuggerHintsIndex) ACCESSORS(DebugInfo, debug_bytecode_array, Object, kDebugBytecodeArrayIndex) ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) @@ -6043,23 +6044,6 @@ BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_named_expression, BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, kIsTopLevelBit) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation, - kAllowLazyCompilation) -BOOL_ACCESSORS(SharedFunctionInfo, - compiler_hints, - uses_arguments, - kUsesArguments) -BOOL_ACCESSORS(SharedFunctionInfo, - compiler_hints, - has_duplicate_parameters, - kHasDuplicateParameters) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration, - kIsDeclaration) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up, - kMarkedForTierUp) - #if V8_HOST_ARCH_32_BIT SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, @@ -6144,12 +6128,6 @@ PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, #endif - -BOOL_GETTER(SharedFunctionInfo, - compiler_hints, - optimization_disabled, - kOptimizationDisabled) - AbstractCode* SharedFunctionInfo::abstract_code() { if (HasBytecodeArray()) { return AbstractCode::cast(bytecode_array()); @@ -6158,20 +6136,43 @@ AbstractCode* SharedFunctionInfo::abstract_code() { } } +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation, + kAllowLazyCompilation) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, uses_arguments, + kUsesArguments) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, has_duplicate_parameters, + kHasDuplicateParameters) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration, + kIsDeclaration) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up, + kMarkedForTierUp) + +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, + kNeedsHomeObject) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, must_use_ignition_turbo, + kMustUseIgnitionTurbo) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush) +BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_asm_wasm_broken, + kIsAsmWasmBroken) + +BOOL_GETTER(SharedFunctionInfo, compiler_hints, optimization_disabled, + kOptimizationDisabled) + void SharedFunctionInfo::set_optimization_disabled(bool disable) { set_compiler_hints(BooleanBit::set(compiler_hints(), kOptimizationDisabled, disable)); } - LanguageMode SharedFunctionInfo::language_mode() { STATIC_ASSERT(LANGUAGE_END == 2); return construct_language_mode( BooleanBit::get(compiler_hints(), kStrictModeFunction)); } - void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { STATIC_ASSERT(LANGUAGE_END == 2); // We only allow language mode transitions that set the same language mode @@ -6186,7 +6187,6 @@ FunctionKind SharedFunctionInfo::kind() const { return FunctionKindBits::decode(compiler_hints()); } - void SharedFunctionInfo::set_kind(FunctionKind kind) { DCHECK(IsValidFunctionKind(kind)); int hints = compiler_hints(); @@ -6194,23 +6194,14 @@ void SharedFunctionInfo::set_kind(FunctionKind kind) { set_compiler_hints(hints); } -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, - kNeedsHomeObject) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, - name_should_print_as_anonymous, - kNameShouldPrintAsAnonymous) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous_expression, +BOOL_ACCESSORS(SharedFunctionInfo, debugger_hints, + name_should_print_as_anonymous, kNameShouldPrintAsAnonymous) +BOOL_ACCESSORS(SharedFunctionInfo, debugger_hints, is_anonymous_expression, kIsAnonymousExpression) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, must_use_ignition_turbo, - kMustUseIgnitionTurbo) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_asm_wasm_broken, - kIsAsmWasmBroken) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, has_no_side_effect, +BOOL_ACCESSORS(SharedFunctionInfo, debugger_hints, deserialized, kDeserialized) +BOOL_ACCESSORS(SharedFunctionInfo, debugger_hints, has_no_side_effect, kHasNoSideEffect) -BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, computed_has_no_side_effect, +BOOL_ACCESSORS(SharedFunctionInfo, debugger_hints, computed_has_no_side_effect, kComputedHasNoSideEffect) bool Script::HasValidSource() { @@ -6315,25 +6306,35 @@ bool SharedFunctionInfo::has_simple_parameters() { return scope_info()->HasSimpleParameters(); } - -bool SharedFunctionInfo::HasDebugInfo() { - bool has_debug_info = debug_info()->IsStruct(); +bool SharedFunctionInfo::HasDebugInfo() const { + bool has_debug_info = !debug_info()->IsSmi(); + DCHECK_EQ(debug_info()->IsStruct(), has_debug_info); DCHECK(!has_debug_info || HasDebugCode()); return has_debug_info; } - -DebugInfo* SharedFunctionInfo::GetDebugInfo() { +DebugInfo* SharedFunctionInfo::GetDebugInfo() const { DCHECK(HasDebugInfo()); return DebugInfo::cast(debug_info()); } - -bool SharedFunctionInfo::HasDebugCode() { +bool SharedFunctionInfo::HasDebugCode() const { if (HasBaselineCode()) return code()->has_debug_break_slots(); return HasBytecodeArray(); } +int SharedFunctionInfo::debugger_hints() const { + if (HasDebugInfo()) return GetDebugInfo()->debugger_hints(); + return Smi::cast(debug_info())->value(); +} + +void SharedFunctionInfo::set_debugger_hints(int value) { + if (HasDebugInfo()) { + GetDebugInfo()->set_debugger_hints(value); + } else { + set_debug_info(Smi::FromInt(value)); + } +} bool SharedFunctionInfo::IsApiFunction() { return function_data()->IsFunctionTemplateInfo(); @@ -6350,11 +6351,11 @@ void SharedFunctionInfo::set_api_func_data(FunctionTemplateInfo* data) { set_function_data(data); } -bool SharedFunctionInfo::HasBytecodeArray() { +bool SharedFunctionInfo::HasBytecodeArray() const { return function_data()->IsBytecodeArray(); } -BytecodeArray* SharedFunctionInfo::bytecode_array() { +BytecodeArray* SharedFunctionInfo::bytecode_array() const { DCHECK(HasBytecodeArray()); return BytecodeArray::cast(function_data()); } @@ -6369,11 +6370,11 @@ void SharedFunctionInfo::ClearBytecodeArray() { set_function_data(GetHeap()->undefined_value()); } -bool SharedFunctionInfo::HasAsmWasmData() { +bool SharedFunctionInfo::HasAsmWasmData() const { return function_data()->IsFixedArray(); } -FixedArray* SharedFunctionInfo::asm_wasm_data() { +FixedArray* SharedFunctionInfo::asm_wasm_data() const { DCHECK(HasAsmWasmData()); return FixedArray::cast(function_data()); } diff --git a/src/objects-printer.cc b/src/objects-printer.cc index e596bcff70..10023db559 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -1094,7 +1094,11 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT os << "\n - function token position = " << function_token_position(); os << "\n - start position = " << start_position(); os << "\n - end position = " << end_position(); - os << "\n - debug info = " << Brief(debug_info()); + if (HasDebugInfo()) { + os << "\n - debug info = " << Brief(debug_info()); + } else { + os << "\n - no debug info"; + } os << "\n - length = " << length(); os << "\n - num_literals = " << num_literals(); os << "\n - optimized_code_map = " << Brief(optimized_code_map()); diff --git a/src/objects.h b/src/objects.h index 9a22b7b683..9cf3da0ab9 100644 --- a/src/objects.h +++ b/src/objects.h @@ -7292,12 +7292,12 @@ class SharedFunctionInfo: public HeapObject { inline bool IsApiFunction(); inline FunctionTemplateInfo* get_api_func_data(); inline void set_api_func_data(FunctionTemplateInfo* data); - inline bool HasBytecodeArray(); - inline BytecodeArray* bytecode_array(); + inline bool HasBytecodeArray() const; + inline BytecodeArray* bytecode_array() const; inline void set_bytecode_array(BytecodeArray* bytecode); inline void ClearBytecodeArray(); - inline bool HasAsmWasmData(); - inline FixedArray* asm_wasm_data(); + inline bool HasAsmWasmData() const; + inline FixedArray* asm_wasm_data() const; inline void set_asm_wasm_data(FixedArray* data); inline void ClearAsmWasmData(); @@ -7335,15 +7335,41 @@ class SharedFunctionInfo: public HeapObject { inline void set_start_position_and_type(int value); // The function is subject to debugging if a debug info is attached. - inline bool HasDebugInfo(); - inline DebugInfo* GetDebugInfo(); + inline bool HasDebugInfo() const; + inline DebugInfo* GetDebugInfo() const; // A function has debug code if the compiled code has debug break slots. - inline bool HasDebugCode(); + inline bool HasDebugCode() const; // [debug info]: Debug information. DECL_ACCESSORS(debug_info, Object) + // Bit field containing various information collected for debugging. + // This field is either stored on the kDebugInfo slot or inside the + // debug info struct. + inline int debugger_hints() const; + inline void set_debugger_hints(int value); + + // Indicates that the function was created by the Function function. + // Though it's anonymous, toString should treat it as if it had the name + // "anonymous". We don't set the name itself so that the system does not + // see a binding for it. + DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous) + + // Indicates that the function is either an anonymous expression + // or an arrow function (the name field can be set through the API, + // which does not change this flag). + DECL_BOOLEAN_ACCESSORS(is_anonymous_expression) + + // Indicates that the the shared function info is deserialized from cache. + DECL_BOOLEAN_ACCESSORS(deserialized) + + // Indicates that the function cannot cause side-effects. + DECL_BOOLEAN_ACCESSORS(has_no_side_effect) + + // Indicates that |has_no_side_effect| has been computed and set. + DECL_BOOLEAN_ACCESSORS(computed_has_no_side_effect) + // The function's name if it is non-empty, otherwise the inferred name. String* DebugName(); @@ -7422,17 +7448,6 @@ class SharedFunctionInfo: public HeapObject { // Indicate that this function should always be inlined in optimized code. DECL_BOOLEAN_ACCESSORS(force_inline) - // Indicates that the function was created by the Function function. - // Though it's anonymous, toString should treat it as if it had the name - // "anonymous". We don't set the name itself so that the system does not - // see a binding for it. - DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous) - - // Indicates that the function is either an anonymous expression - // or an arrow function (the name field can be set through the API, - // which does not change this flag). - DECL_BOOLEAN_ACCESSORS(is_anonymous_expression) - // Indicates that code for this function must be compiled through the // Ignition / TurboFan pipeline, and is unsupported by // FullCodegen / Crankshaft. @@ -7444,9 +7459,6 @@ class SharedFunctionInfo: public HeapObject { // Indicates that this function is an asm function. DECL_BOOLEAN_ACCESSORS(asm_function) - // Indicates that the the shared function info is deserialized from cache. - DECL_BOOLEAN_ACCESSORS(deserialized) - // Whether this function was created from a FunctionDeclaration. DECL_BOOLEAN_ACCESSORS(is_declaration) @@ -7456,12 +7468,6 @@ class SharedFunctionInfo: public HeapObject { // Indicates that asm->wasm conversion failed and should not be re-attempted. DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) - // Indicates that the function cannot cause side-effects. - DECL_BOOLEAN_ACCESSORS(has_no_side_effect) - - // Indicates that |has_no_side_effect| has been computed and set. - DECL_BOOLEAN_ACCESSORS(computed_has_no_side_effect) - inline FunctionKind kind() const; inline void set_kind(FunctionKind kind); @@ -7736,23 +7742,30 @@ class SharedFunctionInfo: public HeapObject { // byte 1 kForceInline, kIsAsmFunction, - kIsAnonymousExpression, - kNameShouldPrintAsAnonymous, kMustUseIgnitionTurbo, kDontFlush, kIsDeclaration, + kIsAsmWasmBroken, + + kUnused1, // Unused fields. + kUnused2, - kUnused, // unused. // byte 2 kFunctionKind, // rest of byte 2 and first two bits of byte 3 are used by FunctionKind // byte 3 - kDeserialized = kFunctionKind + 10, - kIsAsmWasmBroken, + kCompilerHintsCount = kFunctionKind + 10, // Pseudo entry + }; + + // Bit positions in debugger_hints. + enum DebuggerHints { + kIsAnonymousExpression, + kNameShouldPrintAsAnonymous, + kDeserialized, kHasNoSideEffect, kComputedHasNoSideEffect, - kCompilerHintsCount, // Pseudo entry }; + // kFunctionKind has to be byte-aligned STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); @@ -11490,6 +11503,9 @@ class DebugInfo: public Struct { // The shared function info for the source being debugged. DECL_ACCESSORS(shared, SharedFunctionInfo) + // Bit field containing various information collected for debugging. + DECL_INT_ACCESSORS(debugger_hints) + DECL_ACCESSORS(debug_bytecode_array, Object) // Fixed array holding status information for each active break point. DECL_ACCESSORS(break_points, FixedArray) @@ -11510,8 +11526,6 @@ class DebugInfo: public Struct { // Get the number of break points for this function. int GetBreakPointCount(); - static Smi* uninitialized() { return Smi::kZero; } - inline bool HasDebugBytecodeArray(); inline bool HasDebugCode(); @@ -11526,8 +11540,10 @@ class DebugInfo: public Struct { DECLARE_VERIFIER(DebugInfo) static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; - static const int kDebugBytecodeArrayIndex = + static const int kDebuggerHintsIndex = kSharedFunctionInfoIndex + kPointerSize; + static const int kDebugBytecodeArrayIndex = + kDebuggerHintsIndex + kPointerSize; static const int kBreakPointsStateIndex = kDebugBytecodeArrayIndex + kPointerSize; static const int kSize = kBreakPointsStateIndex + kPointerSize; diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index 39b1768055..efb2d3c9da 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -1570,6 +1570,11 @@ void MacroAssembler::JumpIfNotSmi(Register src, j(NegateCondition(smi), on_not_smi, near_jump); } +void MacroAssembler::JumpIfNotSmi(Operand src, Label* on_not_smi, + Label::Distance near_jump) { + Condition smi = CheckSmi(src); + j(NegateCondition(smi), on_not_smi, near_jump); +} void MacroAssembler::JumpUnlessNonNegativeSmi( Register src, Label* on_not_smi_or_negative, diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h index c09b07cac8..fcd13743c6 100644 --- a/src/x64/macro-assembler-x64.h +++ b/src/x64/macro-assembler-x64.h @@ -551,6 +551,10 @@ class MacroAssembler: public Assembler { Label* on_not_smi, Label::Distance near_jump = Label::kFar); + // Jump to label if the value is not a tagged smi. + void JumpIfNotSmi(Operand src, Label* on_not_smi, + Label::Distance near_jump = Label::kFar); + // Jump to label if the value is not a non-negative tagged smi. void JumpUnlessNonNegativeSmi(Register src, Label* on_not_smi,