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

Side by Side Diff: src/objects.cc

Issue 1254873002: [interpreter] A couple of minor tweaks to BytecodeArray. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/objects.h ('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 11600 matching lines...) Expand 10 before | Expand all | Expand 10 after
11611 os << "RelocInfo (size = " << relocation_size() << ")\n"; 11611 os << "RelocInfo (size = " << relocation_size() << ")\n";
11612 for (RelocIterator it(this); !it.done(); it.next()) { 11612 for (RelocIterator it(this); !it.done(); it.next()) {
11613 it.rinfo()->Print(GetIsolate(), os); 11613 it.rinfo()->Print(GetIsolate(), os);
11614 } 11614 }
11615 os << "\n"; 11615 os << "\n";
11616 } 11616 }
11617 #endif // ENABLE_DISASSEMBLER 11617 #endif // ENABLE_DISASSEMBLER
11618 11618
11619 11619
11620 void BytecodeArray::Disassemble(std::ostream& os) { 11620 void BytecodeArray::Disassemble(std::ostream& os) {
11621 os << "Frame size " << frame_size() 11621 os << "Frame size " << frame_size() << "\n";
11622 << ", number of locals = " << number_of_locals() << "\n";
11623 Vector<char> buf = Vector<char>::New(50); 11622 Vector<char> buf = Vector<char>::New(50);
11624 int bytecode_size = 0; 11623 int bytecode_size = 0;
11625 for (int i = 0; i < this->length(); i += bytecode_size) { 11624 for (int i = 0; i < this->length(); i += bytecode_size) {
11626 interpreter::Bytecode bytecode = static_cast<interpreter::Bytecode>(get(i)); 11625 interpreter::Bytecode bytecode = static_cast<interpreter::Bytecode>(get(i));
11627 bytecode_size = interpreter::Bytecodes::Size(bytecode); 11626 bytecode_size = interpreter::Bytecodes::Size(bytecode);
11628 11627
11629 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i); 11628 SNPrintF(buf, "%p : ", GetFirstBytecodeAddress() + i);
11630 os << buf.start(); 11629 os << buf.start();
11631 for (int j = 0; j < bytecode_size; j++) { 11630 for (int j = 0; j < bytecode_size; j++) {
11632 SNPrintF(buf, "%02x ", get(i + j)); 11631 SNPrintF(buf, "%02x ", get(i + j));
11633 os << buf.start(); 11632 os << buf.start();
11634 } 11633 }
11635 for (int j = bytecode_size; j < interpreter::Bytecodes::kMaximumSize; j++) { 11634 for (int j = bytecode_size; j < interpreter::Bytecodes::kMaximumSize; j++) {
11636 os << " "; 11635 os << " ";
11637 } 11636 }
11638 os << bytecode; 11637 os << bytecode << "\n";
11639 } 11638 }
11640 } 11639 }
11641 11640
11642 11641
11643 // static 11642 // static
11644 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 11643 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
11645 DCHECK(capacity >= 0); 11644 DCHECK(capacity >= 0);
11646 array->GetIsolate()->factory()->NewJSArrayStorage( 11645 array->GetIsolate()->factory()->NewJSArrayStorage(
11647 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); 11646 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
11648 } 11647 }
(...skipping 4275 matching lines...) Expand 10 before | Expand all | Expand 10 after
15924 Handle<Object> new_value) { 15923 Handle<Object> new_value) {
15925 if (cell->value() != *new_value) { 15924 if (cell->value() != *new_value) {
15926 cell->set_value(*new_value); 15925 cell->set_value(*new_value);
15927 Isolate* isolate = cell->GetIsolate(); 15926 Isolate* isolate = cell->GetIsolate();
15928 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15927 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15929 isolate, DependentCode::kPropertyCellChangedGroup); 15928 isolate, DependentCode::kPropertyCellChangedGroup);
15930 } 15929 }
15931 } 15930 }
15932 } // namespace internal 15931 } // namespace internal
15933 } // namespace v8 15932 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698