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

Side by Side Diff: src/objects.cc

Issue 1259193004: [Interpreter] Consistency fixes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant argument to Bytecodes::Decode(). Created 5 years, 4 months 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
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 11593 matching lines...) Expand 10 before | Expand all | Expand 10 after
11604 it.rinfo()->Print(GetIsolate(), os); 11604 it.rinfo()->Print(GetIsolate(), os);
11605 } 11605 }
11606 os << "\n"; 11606 os << "\n";
11607 } 11607 }
11608 #endif // ENABLE_DISASSEMBLER 11608 #endif // ENABLE_DISASSEMBLER
11609 11609
11610 11610
11611 void BytecodeArray::Disassemble(std::ostream& os) { 11611 void BytecodeArray::Disassemble(std::ostream& os) {
11612 os << "Frame size " << frame_size() << "\n"; 11612 os << "Frame size " << frame_size() << "\n";
11613 Vector<char> buf = Vector<char>::New(50); 11613 Vector<char> buf = Vector<char>::New(50);
11614 int bytes = 0; 11614
11615 for (int i = 0; i < this->length(); i += bytes) { 11615 const uint8_t* first_bytecode_address = GetFirstBytecodeAddress();
11616 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i)); 11616 int bytecode_size = 0;
11617 bytes = interpreter::Bytecodes::Size(bytecode); 11617 for (int i = 0; i < this->length(); i += bytecode_size) {
11618 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i); 11618 const uint8_t* bytecode_start = &first_bytecode_address[i];
11619 os << buf.start(); 11619 interpreter::Bytecode bytecode =
11620 for (int j = 0; j < bytes; j++) { 11620 interpreter::Bytecodes::FromByte(bytecode_start[0]);
11621 SNPrintF(buf, "%02x ", get(i + j)); 11621 bytecode_size = interpreter::Bytecodes::Size(bytecode);
11622 os << buf.start(); 11622
11623 } 11623 SNPrintF(buf, "%p", bytecode_start);
11624 for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) { 11624 os << buf.start() << " : ";
11625 os << " "; 11625 interpreter::Bytecodes::Decode(os, bytecode_start);
11626 }
11627 os << bytecode << " ";
11628 for (int j = 1; j < bytes; j++) {
11629 interpreter::OperandType op_type =
11630 interpreter::Bytecodes::GetOperandType(bytecode, j - 1);
11631 uint8_t operand = get(i + j);
11632 switch (op_type) {
11633 case interpreter::OperandType::kImm8:
11634 os << "#" << static_cast<int>(operand);
11635 break;
11636 case interpreter::OperandType::kReg:
11637 os << "r" << static_cast<int>(operand);
11638 break;
11639 case interpreter::OperandType::kNone:
11640 UNREACHABLE();
11641 break;
11642 }
11643 if (j + 1 < bytes) {
11644 os << ", ";
11645 }
11646 }
11647 os << "\n"; 11626 os << "\n";
11648 } 11627 }
11649 } 11628 }
11650 11629
11651 11630
11652 // static 11631 // static
11653 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 11632 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
11654 DCHECK(capacity >= 0); 11633 DCHECK(capacity >= 0);
11655 array->GetIsolate()->factory()->NewJSArrayStorage( 11634 array->GetIsolate()->factory()->NewJSArrayStorage(
11656 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); 11635 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
(...skipping 4134 matching lines...) Expand 10 before | Expand all | Expand 10 after
15791 if (cell->value() != *new_value) { 15770 if (cell->value() != *new_value) {
15792 cell->set_value(*new_value); 15771 cell->set_value(*new_value);
15793 Isolate* isolate = cell->GetIsolate(); 15772 Isolate* isolate = cell->GetIsolate();
15794 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15773 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15795 isolate, DependentCode::kPropertyCellChangedGroup); 15774 isolate, DependentCode::kPropertyCellChangedGroup);
15796 } 15775 }
15797 } 15776 }
15798 15777
15799 } // namespace internal 15778 } // namespace internal
15800 } // namespace v8 15779 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698