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

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: Fix MSVC/gcc-pedantic compilation. 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 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 int bytes = 0;
picksi 2015/08/03 11:06:01 Can we name 'bytes' to say what this is (the size
oth 2015/08/03 15:39:59 Reworked in https://codereview.chromium.org/125919
11615 for (int i = 0; i < this->length(); i += bytes) { 11615 for (int i = 0; i < this->length(); i += bytes) {
11616 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i)); 11616 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(get(i));
11617 bytes = interpreter::Bytecodes::Size(bytecode); 11617 bytes = interpreter::Bytecodes::Size(bytecode);
11618
11619 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i); 11618 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i);
11620 os << buf.start(); 11619 os << buf.start();
11621 for (int j = 0; j < bytes; j++) { 11620 for (int j = 0; j < bytes; j++) {
11622 SNPrintF(buf, "%02x ", get(i + j)); 11621 SNPrintF(buf, "%02x ", get(i + j));
11623 os << buf.start(); 11622 os << buf.start();
11624 } 11623 }
11625 for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) { 11624 for (int j = bytes; j < interpreter::Bytecodes::MaximumSize(); j++) {
11626 os << " "; 11625 os << " ";
11627 } 11626 }
11628 os << bytecode << "\n"; 11627 os << bytecode << " ";
11628 for (int j = 1; j < bytes; j++) {
picksi 2015/08/03 11:06:01 Should this for-loop be pulled out into a separate
oth 2015/08/03 15:39:59 Reworked in https://codereview.chromium.org/125919
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";
11629 } 11648 }
11630 } 11649 }
11631 11650
11632 11651
11633 // static 11652 // static
11634 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 11653 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
11635 DCHECK(capacity >= 0); 11654 DCHECK(capacity >= 0);
11636 array->GetIsolate()->factory()->NewJSArrayStorage( 11655 array->GetIsolate()->factory()->NewJSArrayStorage(
11637 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); 11656 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
11638 } 11657 }
(...skipping 4133 matching lines...) Expand 10 before | Expand all | Expand 10 after
15772 if (cell->value() != *new_value) { 15791 if (cell->value() != *new_value) {
15773 cell->set_value(*new_value); 15792 cell->set_value(*new_value);
15774 Isolate* isolate = cell->GetIsolate(); 15793 Isolate* isolate = cell->GetIsolate();
15775 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15794 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15776 isolate, DependentCode::kPropertyCellChangedGroup); 15795 isolate, DependentCode::kPropertyCellChangedGroup);
15777 } 15796 }
15778 } 15797 }
15779 15798
15780 } // namespace internal 15799 } // namespace internal
15781 } // namespace v8 15800 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698