Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 3ea5b19c0743a3b700350233b7e4712b33ccd711..3f7cf5723b6233076b5a62c49f716a2eecf6ced5 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::IsReadOnly() { |
| + if (!is_readonly_computed()) { |
| + Isolate* isolate = GetIsolate(); |
| + if (HasBytecodeArray()) { |
| + DisallowHeapAllocation not_handlified; |
| + Handle<BytecodeArray> array(bytecode_array(), isolate); |
|
jgruber
2017/01/10 12:46:38
Do we need to create this handle?
And what about
Yang
2017/01/10 14:14:07
We need to create the handle for the BytecodeArray
|
| + set_is_readonly(DebugEvaluate::IsReadOnly(array)); |
| + } else { |
| + set_is_readonly(false); |
| + } |
| + set_is_readonly_computed(true); |
| + } |
| + return is_readonly(); |
| +} |
| + |
| // The filter is a pattern that matches function names in this way: |
| // "*" all; the default |
| // "-" all but the top-level function |