OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "src/base/bits.h" | 21 #include "src/base/bits.h" |
22 #include "src/base/utils/random-number-generator.h" | 22 #include "src/base/utils/random-number-generator.h" |
23 #include "src/bootstrapper.h" | 23 #include "src/bootstrapper.h" |
24 #include "src/code-stubs.h" | 24 #include "src/code-stubs.h" |
25 #include "src/codegen.h" | 25 #include "src/codegen.h" |
26 #include "src/compilation-dependencies.h" | 26 #include "src/compilation-dependencies.h" |
27 #include "src/compiler.h" | 27 #include "src/compiler.h" |
28 #include "src/counters-inl.h" | 28 #include "src/counters-inl.h" |
29 #include "src/counters.h" | 29 #include "src/counters.h" |
30 #include "src/date.h" | 30 #include "src/date.h" |
31 #include "src/debug/debug-evaluate.h" | |
31 #include "src/debug/debug.h" | 32 #include "src/debug/debug.h" |
32 #include "src/deoptimizer.h" | 33 #include "src/deoptimizer.h" |
33 #include "src/elements.h" | 34 #include "src/elements.h" |
34 #include "src/execution.h" | 35 #include "src/execution.h" |
35 #include "src/field-index-inl.h" | 36 #include "src/field-index-inl.h" |
36 #include "src/field-index.h" | 37 #include "src/field-index.h" |
37 #include "src/field-type.h" | 38 #include "src/field-type.h" |
38 #include "src/frames-inl.h" | 39 #include "src/frames-inl.h" |
39 #include "src/full-codegen/full-codegen.h" | 40 #include "src/full-codegen/full-codegen.h" |
40 #include "src/globals.h" | 41 #include "src/globals.h" |
(...skipping 13892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13933 shared->set_script(*script_object); | 13934 shared->set_script(*script_object); |
13934 } | 13935 } |
13935 | 13936 |
13936 | 13937 |
13937 String* SharedFunctionInfo::DebugName() { | 13938 String* SharedFunctionInfo::DebugName() { |
13938 Object* n = name(); | 13939 Object* n = name(); |
13939 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name(); | 13940 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name(); |
13940 return String::cast(n); | 13941 return String::cast(n); |
13941 } | 13942 } |
13942 | 13943 |
13944 bool SharedFunctionInfo::IsReadOnly() { | |
13945 if (!is_readonly_computed()) { | |
13946 Isolate* isolate = GetIsolate(); | |
13947 if (HasBytecodeArray()) { | |
13948 DisallowHeapAllocation not_handlified; | |
13949 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
| |
13950 set_is_readonly(DebugEvaluate::IsReadOnly(array)); | |
13951 } else { | |
13952 set_is_readonly(false); | |
13953 } | |
13954 set_is_readonly_computed(true); | |
13955 } | |
13956 return is_readonly(); | |
13957 } | |
13958 | |
13943 // The filter is a pattern that matches function names in this way: | 13959 // The filter is a pattern that matches function names in this way: |
13944 // "*" all; the default | 13960 // "*" all; the default |
13945 // "-" all but the top-level function | 13961 // "-" all but the top-level function |
13946 // "-name" all but the function "name" | 13962 // "-name" all but the function "name" |
13947 // "" only the top-level function | 13963 // "" only the top-level function |
13948 // "name" only the function "name" | 13964 // "name" only the function "name" |
13949 // "name*" only functions starting with "name" | 13965 // "name*" only functions starting with "name" |
13950 // "~" none; the tilde is not an identifier | 13966 // "~" none; the tilde is not an identifier |
13951 bool SharedFunctionInfo::PassesFilter(const char* raw_filter) { | 13967 bool SharedFunctionInfo::PassesFilter(const char* raw_filter) { |
13952 if (*raw_filter == '*') return true; | 13968 if (*raw_filter == '*') return true; |
(...skipping 6538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20491 // depend on this. | 20507 // depend on this. |
20492 return DICTIONARY_ELEMENTS; | 20508 return DICTIONARY_ELEMENTS; |
20493 } | 20509 } |
20494 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20510 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20495 return kind; | 20511 return kind; |
20496 } | 20512 } |
20497 } | 20513 } |
20498 | 20514 |
20499 } // namespace internal | 20515 } // namespace internal |
20500 } // namespace v8 | 20516 } // namespace v8 |
OLD | NEW |