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

Side by Side Diff: src/objects.cc

Issue 1266713004: [Intepreter] Addition of BytecodeArrayBuilder and accumulator based bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak BytecodeArray::Disassemble(). 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
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 11585 matching lines...) Expand 10 before | Expand all | Expand 10 after
11596 #endif // ENABLE_DISASSEMBLER 11596 #endif // ENABLE_DISASSEMBLER
11597 11597
11598 11598
11599 void BytecodeArray::Disassemble(std::ostream& os) { 11599 void BytecodeArray::Disassemble(std::ostream& os) {
11600 os << "Frame size " << frame_size() << "\n"; 11600 os << "Frame size " << frame_size() << "\n";
11601 Vector<char> buf = Vector<char>::New(50); 11601 Vector<char> buf = Vector<char>::New(50);
11602 int bytes = 0; 11602 int bytes = 0;
11603 for (int i = 0; i < this->length(); i += bytes) { 11603 for (int i = 0; i < this->length(); i += bytes) {
11604 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i)); 11604 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i));
11605 bytes = interpreter::Bytecodes::Size(bytecode); 11605 bytes = interpreter::Bytecodes::Size(bytecode);
11606
11607 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i); 11606 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i);
11608 os << buf.start(); 11607 os << buf.start();
11609 for (int j = 0; j < bytes; j++) { 11608 for (int j = 0; j < bytes; j++) {
11610 SNPrintF(buf, "%02x ", get(i + j)); 11609 SNPrintF(buf, "%02x ", get(i + j));
11611 os << buf.start(); 11610 os << buf.start();
11612 } 11611 }
11613 for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) { 11612 for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) {
11614 os << " "; 11613 os << " ";
11615 } 11614 }
11616 os << bytecode << "\n"; 11615 os << bytecode << " ";
11616 for (int j = 1; j < bytes; j++) {
11617 interpreter::OperandType op_type =
11618 interpreter::Bytecodes::GetOperandType(bytecode, j - 1);
11619 uint8_t operand = get(i + j);
11620 switch (op_type) {
11621 case interpreter::OperandType::kNone:
11622 break;
11623 case interpreter::OperandType::kImm8:
11624 os << "#" << static_cast<int>(operand);
11625 break;
11626 case interpreter::OperandType::kReg:
11627 os << "r" << static_cast<int>(operand);
11628 break;
11629 }
11630 if (j + 1 < bytes) {
11631 os << ", ";
11632 }
11633 }
11634 os << "\n";
11617 } 11635 }
11618 } 11636 }
11619 11637
11620 11638
11621 // static 11639 // static
11622 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 11640 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
11623 DCHECK(capacity >= 0); 11641 DCHECK(capacity >= 0);
11624 array->GetIsolate()->factory()->NewJSArrayStorage( 11642 array->GetIsolate()->factory()->NewJSArrayStorage(
11625 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); 11643 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
11626 } 11644 }
(...skipping 4133 matching lines...) Expand 10 before | Expand all | Expand 10 after
15760 if (cell->value() != *new_value) { 15778 if (cell->value() != *new_value) {
15761 cell->set_value(*new_value); 15779 cell->set_value(*new_value);
15762 Isolate* isolate = cell->GetIsolate(); 15780 Isolate* isolate = cell->GetIsolate();
15763 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15781 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15764 isolate, DependentCode::kPropertyCellChangedGroup); 15782 isolate, DependentCode::kPropertyCellChangedGroup);
15765 } 15783 }
15766 } 15784 }
15767 15785
15768 } // namespace internal 15786 } // namespace internal
15769 } // namespace v8 15787 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698