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

Side by Side Diff: src/compiler/register-allocator.cc

Issue 924453002: Fix invalid use of int in Zone. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Windows again... Created 5 years, 10 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/linkage.h" 5 #include "src/compiler/linkage.h"
6 #include "src/compiler/register-allocator.h" 6 #include "src/compiler/register-allocator.h"
7 #include "src/string-stream.h" 7 #include "src/string-stream.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 1507
1508 class LiveRangeBoundArray { 1508 class LiveRangeBoundArray {
1509 public: 1509 public:
1510 LiveRangeBoundArray() : length_(0), start_(nullptr) {} 1510 LiveRangeBoundArray() : length_(0), start_(nullptr) {}
1511 1511
1512 bool ShouldInitialize() { return start_ == nullptr; } 1512 bool ShouldInitialize() { return start_ == nullptr; }
1513 1513
1514 void Initialize(Zone* zone, const LiveRange* const range) { 1514 void Initialize(Zone* zone, const LiveRange* const range) {
1515 size_t length = 0; 1515 size_t length = 0;
1516 for (auto i = range; i != nullptr; i = i->next()) length++; 1516 for (auto i = range; i != nullptr; i = i->next()) length++;
1517 start_ = zone->NewArray<LiveRangeBound>(static_cast<int>(length)); 1517 start_ = zone->NewArray<LiveRangeBound>(length);
1518 length_ = length; 1518 length_ = length;
1519 auto curr = start_; 1519 auto curr = start_;
1520 for (auto i = range; i != nullptr; i = i->next(), ++curr) { 1520 for (auto i = range; i != nullptr; i = i->next(), ++curr) {
1521 new (curr) LiveRangeBound(i); 1521 new (curr) LiveRangeBound(i);
1522 } 1522 }
1523 } 1523 }
1524 1524
1525 LiveRangeBound* Find(const LifetimePosition position) const { 1525 LiveRangeBound* Find(const LifetimePosition position) const {
1526 size_t left_index = 0; 1526 size_t left_index = 0;
1527 size_t right_index = length_; 1527 size_t right_index = length_;
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 } else { 2504 } else {
2505 DCHECK(range->Kind() == GENERAL_REGISTERS); 2505 DCHECK(range->Kind() == GENERAL_REGISTERS);
2506 assigned_registers_->Add(reg); 2506 assigned_registers_->Add(reg);
2507 } 2507 }
2508 range->set_assigned_register(reg, operand_cache()); 2508 range->set_assigned_register(reg, operand_cache());
2509 } 2509 }
2510 2510
2511 } // namespace compiler 2511 } // namespace compiler
2512 } // namespace internal 2512 } // namespace internal
2513 } // namespace v8 2513 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698