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

Side by Side Diff: src/interpreter/constant-array-builder.cc

Issue 1845313002: [interpreter] A few code coverage improvements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/interpreter/bytecode-array-builder.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/constant-array-builder.h" 5 #include "src/interpreter/constant-array-builder.h"
6 6
7 #include "src/isolate.h" 7 #include "src/isolate.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 STATIC_CONST_MEMBER_DEFINITION const size_t 52 STATIC_CONST_MEMBER_DEFINITION const size_t
53 ConstantArrayBuilder::k32BitCapacity; 53 ConstantArrayBuilder::k32BitCapacity;
54 54
55 ConstantArrayBuilder::ConstantArrayBuilder(Isolate* isolate, Zone* zone) 55 ConstantArrayBuilder::ConstantArrayBuilder(Isolate* isolate, Zone* zone)
56 : isolate_(isolate), constants_map_(isolate->heap(), zone) { 56 : isolate_(isolate), constants_map_(isolate->heap(), zone) {
57 idx_slice_[0] = 57 idx_slice_[0] =
58 new (zone) ConstantArraySlice(zone, 0, k8BitCapacity, OperandSize::kByte); 58 new (zone) ConstantArraySlice(zone, 0, k8BitCapacity, OperandSize::kByte);
59 idx_slice_[1] = new (zone) ConstantArraySlice( 59 idx_slice_[1] = new (zone) ConstantArraySlice(
60 zone, k8BitCapacity, k16BitCapacity, OperandSize::kShort); 60 zone, k8BitCapacity, k16BitCapacity, OperandSize::kShort);
61 idx_slice_[2] = new (zone) ConstantArraySlice( 61 idx_slice_[2] = new (zone) ConstantArraySlice(
62 zone, k16BitCapacity, k32BitCapacity, OperandSize::kQuad); 62 zone, k8BitCapacity + k16BitCapacity, k32BitCapacity, OperandSize::kQuad);
mythria 2016/04/01 10:10:42 This also fixes a clusterfuzz bug. https://bugs.ch
63 } 63 }
64 64
65 size_t ConstantArrayBuilder::size() const { 65 size_t ConstantArrayBuilder::size() const {
66 size_t i = arraysize(idx_slice_); 66 size_t i = arraysize(idx_slice_);
67 while (i > 0) { 67 while (i > 0) {
68 ConstantArraySlice* slice = idx_slice_[--i]; 68 ConstantArraySlice* slice = idx_slice_[--i];
69 if (slice->size() > 0) { 69 if (slice->size() > 0) {
70 return slice->start_index() + slice->size(); 70 return slice->start_index() + slice->size();
71 } 71 }
72 } 72 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return index; 194 return index;
195 } 195 }
196 196
197 void ConstantArrayBuilder::DiscardReservedEntry(OperandSize operand_size) { 197 void ConstantArrayBuilder::DiscardReservedEntry(OperandSize operand_size) {
198 OperandSizeToSlice(operand_size)->Unreserve(); 198 OperandSizeToSlice(operand_size)->Unreserve();
199 } 199 }
200 200
201 } // namespace interpreter 201 } // namespace interpreter
202 } // namespace internal 202 } // namespace internal
203 } // namespace v8 203 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698