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

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

Issue 2095893002: Use source position table for unoptimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 5 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 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 6408 matching lines...) Expand 10 before | Expand all | Expand 10 after
6419 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) 6419 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset)
6420 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) 6420 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset)
6421 6421
6422 6422
6423 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) 6423 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
6424 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) 6424 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset)
6425 INT_ACCESSORS(Code, constant_pool_offset, kConstantPoolOffset) 6425 INT_ACCESSORS(Code, constant_pool_offset, kConstantPoolOffset)
6426 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) 6426 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
6427 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) 6427 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset)
6428 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) 6428 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
6429 ACCESSORS(Code, source_position_table, ByteArray, kSourcePositionTableOffset)
6429 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) 6430 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset)
6430 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset) 6431 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset)
6431 6432
6432 6433
6433 void Code::WipeOutHeader() { 6434 void Code::WipeOutHeader() {
6434 WRITE_FIELD(this, kRelocationInfoOffset, NULL); 6435 WRITE_FIELD(this, kRelocationInfoOffset, NULL);
6435 WRITE_FIELD(this, kHandlerTableOffset, NULL); 6436 WRITE_FIELD(this, kHandlerTableOffset, NULL);
6436 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); 6437 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL);
6438 WRITE_FIELD(this, kSourcePositionTableOffset, NULL);
6437 // Do not wipe out major/minor keys on a code stub or IC 6439 // Do not wipe out major/minor keys on a code stub or IC
6438 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { 6440 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
6439 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); 6441 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL);
6440 } 6442 }
6441 WRITE_FIELD(this, kNextCodeLinkOffset, NULL); 6443 WRITE_FIELD(this, kNextCodeLinkOffset, NULL);
6442 WRITE_FIELD(this, kGCMetadataOffset, NULL); 6444 WRITE_FIELD(this, kGCMetadataOffset, NULL);
6443 } 6445 }
6444 6446
6445 6447
6446 Object* Code::type_feedback_info() { 6448 Object* Code::type_feedback_info() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
6486 6488
6487 int Code::body_size() { 6489 int Code::body_size() {
6488 return RoundUp(instruction_size(), kObjectAlignment); 6490 return RoundUp(instruction_size(), kObjectAlignment);
6489 } 6491 }
6490 6492
6491 int Code::SizeIncludingMetadata() { 6493 int Code::SizeIncludingMetadata() {
6492 int size = CodeSize(); 6494 int size = CodeSize();
6493 size += relocation_info()->Size(); 6495 size += relocation_info()->Size();
6494 size += deoptimization_data()->Size(); 6496 size += deoptimization_data()->Size();
6495 size += handler_table()->Size(); 6497 size += handler_table()->Size();
6498 if (kind() == FUNCTION) size += source_position_table()->Size();
6496 return size; 6499 return size;
6497 } 6500 }
6498 6501
6499 ByteArray* Code::unchecked_relocation_info() { 6502 ByteArray* Code::unchecked_relocation_info() {
6500 return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset)); 6503 return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset));
6501 } 6504 }
6502 6505
6503 6506
6504 byte* Code::relocation_start() { 6507 byte* Code::relocation_start() {
6505 return unchecked_relocation_info()->GetDataStartAddress(); 6508 return unchecked_relocation_info()->GetDataStartAddress();
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
7951 #undef WRITE_INT64_FIELD 7954 #undef WRITE_INT64_FIELD
7952 #undef READ_BYTE_FIELD 7955 #undef READ_BYTE_FIELD
7953 #undef WRITE_BYTE_FIELD 7956 #undef WRITE_BYTE_FIELD
7954 #undef NOBARRIER_READ_BYTE_FIELD 7957 #undef NOBARRIER_READ_BYTE_FIELD
7955 #undef NOBARRIER_WRITE_BYTE_FIELD 7958 #undef NOBARRIER_WRITE_BYTE_FIELD
7956 7959
7957 } // namespace internal 7960 } // namespace internal
7958 } // namespace v8 7961 } // namespace v8
7959 7962
7960 #endif // V8_OBJECTS_INL_H_ 7963 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698