Chromium Code Reviews| 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 13430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13441 shared->set_script(*script_object); | 13441 shared->set_script(*script_object); |
| 13442 } | 13442 } |
| 13443 | 13443 |
| 13444 | 13444 |
| 13445 String* SharedFunctionInfo::DebugName() { | 13445 String* SharedFunctionInfo::DebugName() { |
| 13446 Object* n = name(); | 13446 Object* n = name(); |
| 13447 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name(); | 13447 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name(); |
| 13448 return String::cast(n); | 13448 return String::cast(n); |
| 13449 } | 13449 } |
| 13450 | 13450 |
| 13451 bool SharedFunctionInfo::DebugIsBlackboxed() { | |
| 13452 if (!computed_debug_is_blackboxed()) { | |
| 13453 HandleScope handle_scope(GetIsolate()); | |
| 13454 Handle<SharedFunctionInfo> info(this); | |
| 13455 set_debug_is_blackboxed(info->GetIsolate()->debug()->IsBlackboxed(info)); | |
| 13456 set_computed_debug_is_blackboxed(true); | |
|
Yang
2017/01/23 08:48:29
Oh yeah, this is not GC-safe. set_debug_is_blackbo
kozy
2017/01/23 20:28:01
Thank you! Done. I'll try to be more accurate abou
| |
| 13457 } | |
| 13458 return debug_is_blackboxed(); | |
| 13459 } | |
| 13460 | |
| 13451 bool SharedFunctionInfo::HasNoSideEffect() { | 13461 bool SharedFunctionInfo::HasNoSideEffect() { |
| 13452 if (!computed_has_no_side_effect()) { | 13462 if (!computed_has_no_side_effect()) { |
| 13453 DisallowHeapAllocation not_handlified; | 13463 DisallowHeapAllocation not_handlified; |
| 13454 Handle<SharedFunctionInfo> info(this); | 13464 Handle<SharedFunctionInfo> info(this); |
| 13455 set_has_no_side_effect(DebugEvaluate::FunctionHasNoSideEffect(info)); | 13465 set_has_no_side_effect(DebugEvaluate::FunctionHasNoSideEffect(info)); |
| 13456 set_computed_has_no_side_effect(true); | 13466 set_computed_has_no_side_effect(true); |
| 13457 } | 13467 } |
| 13458 return has_no_side_effect(); | 13468 return has_no_side_effect(); |
| 13459 } | 13469 } |
| 13460 | 13470 |
| (...skipping 6603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 20064 // depend on this. | 20074 // depend on this. |
| 20065 return DICTIONARY_ELEMENTS; | 20075 return DICTIONARY_ELEMENTS; |
| 20066 } | 20076 } |
| 20067 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20077 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
| 20068 return kind; | 20078 return kind; |
| 20069 } | 20079 } |
| 20070 } | 20080 } |
| 20071 | 20081 |
| 20072 } // namespace internal | 20082 } // namespace internal |
| 20073 } // namespace v8 | 20083 } // namespace v8 |
| OLD | NEW |