Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 3ea5b19c0743a3b700350233b7e4712b33ccd711..a5c73d5b489c4b5b52b06f8fb7329bc87a2a819a 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -28,6 +28,7 @@ |
#include "src/counters-inl.h" |
#include "src/counters.h" |
#include "src/date.h" |
+#include "src/debug/debug-evaluate.h" |
#include "src/debug/debug.h" |
#include "src/deoptimizer.h" |
#include "src/elements.h" |
@@ -13940,6 +13941,21 @@ String* SharedFunctionInfo::DebugName() { |
return String::cast(n); |
} |
+bool SharedFunctionInfo::HasNoSideEffect() { |
+ if (!computed_has_no_side_effect()) { |
+ Isolate* isolate = GetIsolate(); |
+ if (HasBytecodeArray()) { |
+ DisallowHeapAllocation not_handlified; |
+ Handle<BytecodeArray> array(bytecode_array(), isolate); |
+ set_has_no_side_effect(DebugEvaluate::HasNoSideEffect(array)); |
+ } else { |
+ set_has_no_side_effect(false); |
+ } |
+ set_computed_has_no_side_effect(true); |
+ } |
+ return has_no_side_effect(); |
+} |
+ |
// The filter is a pattern that matches function names in this way: |
// "*" all; the default |
// "-" all but the top-level function |