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

Side by Side Diff: src/objects-inl.h

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.cc ('k') | test/cctest/test-heap.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after
3632 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); 3632 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
3633 } 3633 }
3634 3634
3635 3635
3636 void BytecodeArray::set(int index, byte value) { 3636 void BytecodeArray::set(int index, byte value) {
3637 DCHECK(index >= 0 && index < this->length()); 3637 DCHECK(index >= 0 && index < this->length());
3638 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); 3638 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value);
3639 } 3639 }
3640 3640
3641 3641
3642 INT_ACCESSORS(BytecodeArray, frame_size, kFrameSizeOffset) 3642 void BytecodeArray::set_frame_size(int frame_size) {
3643 INT_ACCESSORS(BytecodeArray, number_of_locals, kNumberOfLocalsOffset) 3643 // We need at least one stack slot for the return register.
3644 DCHECK_GE(frame_size, kPointerSize);
3645 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize)));
3646 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size);
3647 }
3648
3649
3650 int BytecodeArray::frame_size() const {
3651 return READ_INT_FIELD(this, kFrameSizeOffset);
3652 }
3644 3653
3645 3654
3646 Address BytecodeArray::GetFirstBytecodeAddress() { 3655 Address BytecodeArray::GetFirstBytecodeAddress() {
3647 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; 3656 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize;
3648 } 3657 }
3649 3658
3650 3659
3651 uint8_t* ExternalUint8ClampedArray::external_uint8_clamped_pointer() { 3660 uint8_t* ExternalUint8ClampedArray::external_uint8_clamped_pointer() {
3652 return reinterpret_cast<uint8_t*>(external_pointer()); 3661 return reinterpret_cast<uint8_t*>(external_pointer());
3653 } 3662 }
(...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after
7350 #undef READ_SHORT_FIELD 7359 #undef READ_SHORT_FIELD
7351 #undef WRITE_SHORT_FIELD 7360 #undef WRITE_SHORT_FIELD
7352 #undef READ_BYTE_FIELD 7361 #undef READ_BYTE_FIELD
7353 #undef WRITE_BYTE_FIELD 7362 #undef WRITE_BYTE_FIELD
7354 #undef NOBARRIER_READ_BYTE_FIELD 7363 #undef NOBARRIER_READ_BYTE_FIELD
7355 #undef NOBARRIER_WRITE_BYTE_FIELD 7364 #undef NOBARRIER_WRITE_BYTE_FIELD
7356 7365
7357 } } // namespace v8::internal 7366 } } // namespace v8::internal
7358 7367
7359 #endif // V8_OBJECTS_INL_H_ 7368 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698