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

Side by Side Diff: src/objects.cc

Issue 1373903005: [Interpreter] Add for/while/do support to the bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 5 years, 2 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 "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 12541 matching lines...) Expand 10 before | Expand all | Expand 10 after
12552 int bytecode_size = 0; 12552 int bytecode_size = 0;
12553 for (int i = 0; i < this->length(); i += bytecode_size) { 12553 for (int i = 0; i < this->length(); i += bytecode_size) {
12554 const uint8_t* bytecode_start = &first_bytecode_address[i]; 12554 const uint8_t* bytecode_start = &first_bytecode_address[i];
12555 interpreter::Bytecode bytecode = 12555 interpreter::Bytecode bytecode =
12556 interpreter::Bytecodes::FromByte(bytecode_start[0]); 12556 interpreter::Bytecodes::FromByte(bytecode_start[0]);
12557 bytecode_size = interpreter::Bytecodes::Size(bytecode); 12557 bytecode_size = interpreter::Bytecodes::Size(bytecode);
12558 12558
12559 SNPrintF(buf, "%p", bytecode_start); 12559 SNPrintF(buf, "%p", bytecode_start);
12560 os << buf.start() << " : "; 12560 os << buf.start() << " : ";
12561 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count()); 12561 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count());
12562 if (interpreter::Bytecodes::IsJump(bytecode)) {
12563 int offset = static_cast<int8_t>(bytecode_start[1]);
12564 SNPrintF(buf, " (%p)", bytecode_start + offset);
12565 os << buf.start();
12566 } else if (interpreter::Bytecodes::IsJumpConstant(bytecode)) {
12567 int index = static_cast<int>(bytecode_start[1]);
12568 int offset = Smi::cast(constant_pool()->get(index))->value();
12569 SNPrintF(buf, " (%p)", bytecode_start + offset);
12570 os << buf.start();
12571 }
12562 os << "\n"; 12572 os << "\n";
12563 } 12573 }
12564 12574
12565 os << "Constant pool (size = " << constant_pool()->length() << ")\n"; 12575 os << "Constant pool (size = " << constant_pool()->length() << ")\n";
12566 constant_pool()->Print(); 12576 constant_pool()->Print();
12567 } 12577 }
12568 12578
12569 12579
12570 // static 12580 // static
12571 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 12581 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
(...skipping 4283 matching lines...) Expand 10 before | Expand all | Expand 10 after
16855 if (cell->value() != *new_value) { 16865 if (cell->value() != *new_value) {
16856 cell->set_value(*new_value); 16866 cell->set_value(*new_value);
16857 Isolate* isolate = cell->GetIsolate(); 16867 Isolate* isolate = cell->GetIsolate();
16858 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16868 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16859 isolate, DependentCode::kPropertyCellChangedGroup); 16869 isolate, DependentCode::kPropertyCellChangedGroup);
16860 } 16870 }
16861 } 16871 }
16862 16872
16863 } // namespace internal 16873 } // namespace internal
16864 } // namespace v8 16874 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/control-flow-builders.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698