| 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 14827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14838 int bytecode_size = 0; | 14838 int bytecode_size = 0; |
| 14839 for (int i = 0; i < this->length(); i += bytecode_size) { | 14839 for (int i = 0; i < this->length(); i += bytecode_size) { |
| 14840 const uint8_t* bytecode_start = &first_bytecode_address[i]; | 14840 const uint8_t* bytecode_start = &first_bytecode_address[i]; |
| 14841 interpreter::Bytecode bytecode = | 14841 interpreter::Bytecode bytecode = |
| 14842 interpreter::Bytecodes::FromByte(bytecode_start[0]); | 14842 interpreter::Bytecodes::FromByte(bytecode_start[0]); |
| 14843 bytecode_size = interpreter::Bytecodes::Size(bytecode); | 14843 bytecode_size = interpreter::Bytecodes::Size(bytecode); |
| 14844 | 14844 |
| 14845 SNPrintF(buf, "%p", bytecode_start); | 14845 SNPrintF(buf, "%p", bytecode_start); |
| 14846 os << buf.start() << " : "; | 14846 os << buf.start() << " : "; |
| 14847 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count()); | 14847 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count()); |
| 14848 if (interpreter::Bytecodes::IsJump(bytecode)) { | 14848 |
| 14849 int offset = static_cast<int8_t>(bytecode_start[1]); | 14849 if (interpreter::Bytecodes::IsJumpConstantWide(bytecode)) { |
| 14850 DCHECK_EQ(bytecode_size, 3); |
| 14851 int index = static_cast<int>(ReadUnalignedUInt16(bytecode_start + 1)); |
| 14852 int offset = Smi::cast(constant_pool()->get(index))->value(); |
| 14850 SNPrintF(buf, " (%p)", bytecode_start + offset); | 14853 SNPrintF(buf, " (%p)", bytecode_start + offset); |
| 14851 os << buf.start(); | 14854 os << buf.start(); |
| 14852 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) { | 14855 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) { |
| 14856 DCHECK_EQ(bytecode_size, 2); |
| 14853 int index = static_cast<int>(bytecode_start[1]); | 14857 int index = static_cast<int>(bytecode_start[1]); |
| 14854 int offset = Smi::cast(constant_pool()->get(index))->value(); | 14858 int offset = Smi::cast(constant_pool()->get(index))->value(); |
| 14855 SNPrintF(buf, " (%p)", bytecode_start + offset); | 14859 SNPrintF(buf, " (%p)", bytecode_start + offset); |
| 14856 os << buf.start(); | 14860 os << buf.start(); |
| 14861 } else if (interpreter::Bytecodes::IsJump(bytecode)) { |
| 14862 DCHECK_EQ(bytecode_size, 2); |
| 14863 int offset = static_cast<int8_t>(bytecode_start[1]); |
| 14864 SNPrintF(buf, " (%p)", bytecode_start + offset); |
| 14865 os << buf.start(); |
| 14857 } | 14866 } |
| 14858 os << "\n"; | 14867 os << "\n"; |
| 14859 } | 14868 } |
| 14860 | 14869 |
| 14861 os << "Constant pool (size = " << constant_pool()->length() << ")\n"; | 14870 os << "Constant pool (size = " << constant_pool()->length() << ")\n"; |
| 14862 constant_pool()->Print(); | 14871 constant_pool()->Print(); |
| 14863 } | 14872 } |
| 14864 | 14873 |
| 14865 | 14874 |
| 14866 // static | 14875 // static |
| (...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19493 if (cell->value() != *new_value) { | 19502 if (cell->value() != *new_value) { |
| 19494 cell->set_value(*new_value); | 19503 cell->set_value(*new_value); |
| 19495 Isolate* isolate = cell->GetIsolate(); | 19504 Isolate* isolate = cell->GetIsolate(); |
| 19496 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19505 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19497 isolate, DependentCode::kPropertyCellChangedGroup); | 19506 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19498 } | 19507 } |
| 19499 } | 19508 } |
| 19500 | 19509 |
| 19501 } // namespace internal | 19510 } // namespace internal |
| 19502 } // namespace v8 | 19511 } // namespace v8 |
| OLD | NEW |