| 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 <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 13921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13932 DCHECK(kind() == OPTIMIZED_FUNCTION); | 13932 DCHECK(kind() == OPTIMIZED_FUNCTION); |
| 13933 Object* weak_cell_cache = | 13933 Object* weak_cell_cache = |
| 13934 DeoptimizationInputData::cast(deoptimization_data())->WeakCellCache(); | 13934 DeoptimizationInputData::cast(deoptimization_data())->WeakCellCache(); |
| 13935 if (weak_cell_cache->IsWeakCell()) { | 13935 if (weak_cell_cache->IsWeakCell()) { |
| 13936 DCHECK(this == WeakCell::cast(weak_cell_cache)->value()); | 13936 DCHECK(this == WeakCell::cast(weak_cell_cache)->value()); |
| 13937 return WeakCell::cast(weak_cell_cache); | 13937 return WeakCell::cast(weak_cell_cache); |
| 13938 } | 13938 } |
| 13939 return NULL; | 13939 return NULL; |
| 13940 } | 13940 } |
| 13941 | 13941 |
| 13942 | |
| 13943 #ifdef ENABLE_DISASSEMBLER | 13942 #ifdef ENABLE_DISASSEMBLER |
| 13944 | 13943 |
| 13945 void DeoptimizationInputData::DeoptimizationInputDataPrint( | 13944 void DeoptimizationInputData::DeoptimizationInputDataPrint( |
| 13946 std::ostream& os) { // NOLINT | 13945 std::ostream& os) { // NOLINT |
| 13947 disasm::NameConverter converter; | 13946 disasm::NameConverter converter; |
| 13948 int const inlined_function_count = InlinedFunctionCount()->value(); | 13947 int const inlined_function_count = InlinedFunctionCount()->value(); |
| 13949 os << "Inlined functions (count = " << inlined_function_count << ")\n"; | 13948 os << "Inlined functions (count = " << inlined_function_count << ")\n"; |
| 13950 for (int id = 0; id < inlined_function_count; ++id) { | 13949 for (int id = 0; id < inlined_function_count; ++id) { |
| 13951 Object* info = LiteralArray()->get(id); | 13950 Object* info = LiteralArray()->get(id); |
| 13952 os << " " << Brief(SharedFunctionInfo::cast(info)) << "\n"; | 13951 os << " " << Brief(SharedFunctionInfo::cast(info)) << "\n"; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14195 const char* Code::ICState2String(InlineCacheState state) { | 14194 const char* Code::ICState2String(InlineCacheState state) { |
| 14196 switch (state) { | 14195 switch (state) { |
| 14197 case UNINITIALIZED: return "UNINITIALIZED"; | 14196 case UNINITIALIZED: return "UNINITIALIZED"; |
| 14198 case PREMONOMORPHIC: return "PREMONOMORPHIC"; | 14197 case PREMONOMORPHIC: return "PREMONOMORPHIC"; |
| 14199 case MONOMORPHIC: return "MONOMORPHIC"; | 14198 case MONOMORPHIC: return "MONOMORPHIC"; |
| 14200 case RECOMPUTE_HANDLER: | 14199 case RECOMPUTE_HANDLER: |
| 14201 return "RECOMPUTE_HANDLER"; | 14200 return "RECOMPUTE_HANDLER"; |
| 14202 case POLYMORPHIC: return "POLYMORPHIC"; | 14201 case POLYMORPHIC: return "POLYMORPHIC"; |
| 14203 case MEGAMORPHIC: return "MEGAMORPHIC"; | 14202 case MEGAMORPHIC: return "MEGAMORPHIC"; |
| 14204 case GENERIC: return "GENERIC"; | 14203 case GENERIC: return "GENERIC"; |
| 14205 case DEBUG_STUB: return "DEBUG_STUB"; | |
| 14206 } | 14204 } |
| 14207 UNREACHABLE(); | 14205 UNREACHABLE(); |
| 14208 return NULL; | 14206 return NULL; |
| 14209 } | 14207 } |
| 14210 | 14208 |
| 14211 | 14209 |
| 14212 void Code::PrintExtraICState(std::ostream& os, // NOLINT | 14210 void Code::PrintExtraICState(std::ostream& os, // NOLINT |
| 14213 Kind kind, ExtraICState extra) { | 14211 Kind kind, ExtraICState extra) { |
| 14214 os << "extra_ic_state = "; | 14212 os << "extra_ic_state = "; |
| 14215 if ((kind == STORE_IC || kind == KEYED_STORE_IC) && | 14213 if ((kind == STORE_IC || kind == KEYED_STORE_IC) && |
| 14216 is_strict(static_cast<LanguageMode>(extra))) { | 14214 is_strict(static_cast<LanguageMode>(extra))) { |
| 14217 os << "STRICT\n"; | 14215 os << "STRICT\n"; |
| 14218 } else { | 14216 } else { |
| 14219 os << extra << "\n"; | 14217 os << extra << "\n"; |
| 14220 } | 14218 } |
| 14221 } | 14219 } |
| 14222 | 14220 |
| 14223 | 14221 |
| 14224 void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT | 14222 void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT |
| 14225 os << "kind = " << Kind2String(kind()) << "\n"; | 14223 os << "kind = " << Kind2String(kind()) << "\n"; |
| 14226 if (IsCodeStubOrIC()) { | 14224 if (IsCodeStubOrIC()) { |
| 14227 const char* n = CodeStub::MajorName(CodeStub::GetMajorKey(this)); | 14225 const char* n = CodeStub::MajorName(CodeStub::GetMajorKey(this)); |
| 14228 os << "major_key = " << (n == NULL ? "null" : n) << "\n"; | 14226 os << "major_key = " << (n == NULL ? "null" : n) << "\n"; |
| 14229 } | 14227 } |
| 14230 if (is_inline_cache_stub()) { | 14228 if (is_inline_cache_stub()) { |
| 14231 os << "ic_state = " << ICState2String(ic_state()) << "\n"; | 14229 if (!IC::ICUseVector(kind())) { |
| 14230 InlineCacheState ic_state = IC::StateFromCode(this); |
| 14231 os << "ic_state = " << ICState2String(ic_state) << "\n"; |
| 14232 } |
| 14232 PrintExtraICState(os, kind(), extra_ic_state()); | 14233 PrintExtraICState(os, kind(), extra_ic_state()); |
| 14233 if (is_compare_ic_stub()) { | 14234 if (is_compare_ic_stub()) { |
| 14234 DCHECK(CodeStub::GetMajorKey(this) == CodeStub::CompareIC); | 14235 DCHECK(CodeStub::GetMajorKey(this) == CodeStub::CompareIC); |
| 14235 CompareICStub stub(stub_key(), GetIsolate()); | 14236 CompareICStub stub(stub_key(), GetIsolate()); |
| 14236 os << "compare_state = " << CompareICState::GetStateName(stub.left()) | 14237 os << "compare_state = " << CompareICState::GetStateName(stub.left()) |
| 14237 << "*" << CompareICState::GetStateName(stub.right()) << " -> " | 14238 << "*" << CompareICState::GetStateName(stub.right()) << " -> " |
| 14238 << CompareICState::GetStateName(stub.state()) << "\n"; | 14239 << CompareICState::GetStateName(stub.state()) << "\n"; |
| 14239 os << "compare_operation = " << Token::Name(stub.op()) << "\n"; | 14240 os << "compare_operation = " << Token::Name(stub.op()) << "\n"; |
| 14240 } | 14241 } |
| 14241 } | 14242 } |
| (...skipping 4619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18861 if (cell->value() != *new_value) { | 18862 if (cell->value() != *new_value) { |
| 18862 cell->set_value(*new_value); | 18863 cell->set_value(*new_value); |
| 18863 Isolate* isolate = cell->GetIsolate(); | 18864 Isolate* isolate = cell->GetIsolate(); |
| 18864 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 18865 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 18865 isolate, DependentCode::kPropertyCellChangedGroup); | 18866 isolate, DependentCode::kPropertyCellChangedGroup); |
| 18866 } | 18867 } |
| 18867 } | 18868 } |
| 18868 | 18869 |
| 18869 } // namespace internal | 18870 } // namespace internal |
| 18870 } // namespace v8 | 18871 } // namespace v8 |
| OLD | NEW |