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

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: Incorporate feedback from mstarzinger which revealed use after destruction bug. 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 12488 matching lines...) Expand 10 before | Expand all | Expand 10 after
12499 int bytecode_size = 0; 12499 int bytecode_size = 0;
12500 for (int i = 0; i < this->length(); i += bytecode_size) { 12500 for (int i = 0; i < this->length(); i += bytecode_size) {
12501 const uint8_t* bytecode_start = &first_bytecode_address[i]; 12501 const uint8_t* bytecode_start = &first_bytecode_address[i];
12502 interpreter::Bytecode bytecode = 12502 interpreter::Bytecode bytecode =
12503 interpreter::Bytecodes::FromByte(bytecode_start[0]); 12503 interpreter::Bytecodes::FromByte(bytecode_start[0]);
12504 bytecode_size = interpreter::Bytecodes::Size(bytecode); 12504 bytecode_size = interpreter::Bytecodes::Size(bytecode);
12505 12505
12506 SNPrintF(buf, "%p", bytecode_start); 12506 SNPrintF(buf, "%p", bytecode_start);
12507 os << buf.start() << " : "; 12507 os << buf.start() << " : ";
12508 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count()); 12508 interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count());
12509 if (bytecode == interpreter::Bytecode::kJump ||
12510 bytecode == interpreter::Bytecode::kJumpIfTrue ||
12511 bytecode == interpreter::Bytecode::kJumpIfFalse) {
rmcilroy 2015/10/01 09:18:56 nit - could we make a helper for IsJump, IsJumpCon
oth 2015/10/01 11:43:02 Done.
12512 int offset = static_cast<int8_t>(bytecode_start[1]);
12513 SNPrintF(buf, " (%p)", bytecode_start + offset);
12514 os << buf.start();
12515 } else if (bytecode == interpreter::Bytecode::kJumpConstant ||
12516 bytecode == interpreter::Bytecode::kJumpIfTrueConstant ||
12517 bytecode == interpreter::Bytecode::kJumpIfFalseConstant) {
12518 int index = static_cast<int>(bytecode_start[1]);
12519 int offset = Smi::cast(constant_pool()->get(index))->value();
12520 SNPrintF(buf, " (%p)", bytecode_start + offset);
12521 os << buf.start();
12522 }
12509 os << "\n"; 12523 os << "\n";
12510 } 12524 }
12511 12525
12512 os << "Constant pool (size = " << constant_pool()->length() << ")\n"; 12526 os << "Constant pool (size = " << constant_pool()->length() << ")\n";
12513 constant_pool()->Print(); 12527 constant_pool()->Print();
12514 } 12528 }
12515 12529
12516 12530
12517 // static 12531 // static
12518 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { 12532 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
(...skipping 4283 matching lines...) Expand 10 before | Expand all | Expand 10 after
16802 if (cell->value() != *new_value) { 16816 if (cell->value() != *new_value) {
16803 cell->set_value(*new_value); 16817 cell->set_value(*new_value);
16804 Isolate* isolate = cell->GetIsolate(); 16818 Isolate* isolate = cell->GetIsolate();
16805 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16819 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16806 isolate, DependentCode::kPropertyCellChangedGroup); 16820 isolate, DependentCode::kPropertyCellChangedGroup);
16807 } 16821 }
16808 } 16822 }
16809 16823
16810 } // namespace internal 16824 } // namespace internal
16811 } // namespace v8 16825 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698