Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: src/objects.cc

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rationalize jumps in bytecode-graph-builder.cc. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14789 matching lines...) Expand 10 before | Expand all | Expand 10 after
14800 int bytecode_size = 0; 14800 int bytecode_size = 0;
14801 for (int i = 0; i < this->length(); i += bytecode_size) { 14801 for (int i = 0; i < this->length(); i += bytecode_size) {
14802 const uint8_t* bytecode_start = &first_bytecode_address[i]; 14802 const uint8_t* bytecode_start = &first_bytecode_address[i];
14803 interpreter::Bytecode bytecode = 14803 interpreter::Bytecode bytecode =
14804 interpreter::Bytecodes::FromByte(bytecode_start[0]); 14804 interpreter::Bytecodes::FromByte(bytecode_start[0]);
14805 bytecode_size = interpreter::Bytecodes::Size(bytecode); 14805 bytecode_size = interpreter::Bytecodes::Size(bytecode);
14806 14806
14807 SNPrintF(buf, "%p", bytecode_start); 14807 SNPrintF(buf, "%p", bytecode_start);
14808 os << buf.start() << " : "; 14808 os << buf.start() << " : ";
14809 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count()); 14809 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count());
14810 if (interpreter::Bytecodes::IsJump(bytecode)) { 14810
14811 int offset = static_cast<int8_t>(bytecode_start[1]); 14811 if (interpreter::Bytecodes::IsJumpConstantWide(bytecode)) {
14812 DCHECK_EQ(bytecode_size, 3);
14813 int index = static_cast<int>(ReadUnalignedUInt16(bytecode_start + 1));
14814 int offset = Smi::cast(constant_pool()->get(index))->value();
14812 SNPrintF(buf, " (%p)", bytecode_start + offset); 14815 SNPrintF(buf, " (%p)", bytecode_start + offset);
14813 os << buf.start(); 14816 os << buf.start();
14814 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) { 14817 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) {
14818 DCHECK_EQ(bytecode_size, 2);
14815 int index = static_cast<int>(bytecode_start[1]); 14819 int index = static_cast<int>(bytecode_start[1]);
14816 int offset = Smi::cast(constant_pool()->get(index))->value(); 14820 int offset = Smi::cast(constant_pool()->get(index))->value();
14817 SNPrintF(buf, " (%p)", bytecode_start + offset); 14821 SNPrintF(buf, " (%p)", bytecode_start + offset);
14818 os << buf.start(); 14822 os << buf.start();
14823 } else if (interpreter::Bytecodes::IsJump(bytecode)) {
14824 DCHECK_EQ(bytecode_size, 2);
14825 int offset = static_cast<int8_t>(bytecode_start[1]);
14826 SNPrintF(buf, " (%p)", bytecode_start + offset);
14827 os << buf.start();
14819 } 14828 }
14820 os << "\n"; 14829 os << "\n";
14821 } 14830 }
14822 14831
14823 os << "Constant pool (size = " << constant_pool()->length() << ")\n"; 14832 os << "Constant pool (size = " << constant_pool()->length() << ")\n";
14824 constant_pool()->Print(); 14833 constant_pool()->Print();
14825 } 14834 }
14826 14835
14827 14836
14828 // static 14837 // static
(...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after
19455 if (cell->value() != *new_value) { 19464 if (cell->value() != *new_value) {
19456 cell->set_value(*new_value); 19465 cell->set_value(*new_value);
19457 Isolate* isolate = cell->GetIsolate(); 19466 Isolate* isolate = cell->GetIsolate();
19458 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19467 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19459 isolate, DependentCode::kPropertyCellChangedGroup); 19468 isolate, DependentCode::kPropertyCellChangedGroup);
19460 } 19469 }
19461 } 19470 }
19462 19471
19463 } // namespace internal 19472 } // namespace internal
19464 } // namespace v8 19473 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698