File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -183,12 +183,6 @@ def trace_end(trace_point)
183
183
184
184
hook = lambda do |hook_cls |
185
185
lambda do |method_id |
186
- # Don't try and trace the AppMap methods or there will be
187
- # a stack overflow in the defined hook method.
188
- next if %w[ Marshal AppMap ActiveSupport ] . member? ( ( hook_cls &.name || '' ) . split ( '::' ) [ 0 ] )
189
-
190
- next if method_id == :call
191
-
192
186
method = \
193
187
begin
194
188
hook_cls . instance_method ( method_id )
@@ -197,6 +191,16 @@ def trace_end(trace_point)
197
191
next
198
192
end
199
193
194
+ package = config . lookup_package ( hook_cls , method )
195
+ # doing this check first returned early in 98.7% of cases in sample_app_6th_ed
196
+ next unless package
197
+
198
+ # Don't try and trace the AppMap methods or there will be
199
+ # a stack overflow in the defined hook method.
200
+ next if %w[ Marshal AppMap ActiveSupport ] . member? ( ( hook_cls &.name || '' ) . split ( '::' ) [ 0 ] )
201
+
202
+ next if method_id == :call
203
+
200
204
next if self . class . already_hooked? ( method )
201
205
202
206
warn "AppMap: Examining #{ hook_cls } #{ method . name } " if LOG
@@ -206,9 +210,6 @@ def trace_end(trace_point)
206
210
# TODO: Figure out how to tell the difference?
207
211
next unless disasm
208
212
209
- package = config . lookup_package ( hook_cls , method )
210
- next unless package
211
-
212
213
package . handler_class . new ( package , hook_cls , method ) . activate
213
214
end
214
215
end
You can’t perform that action at this time.
0 commit comments