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

Side by Side Diff: src/safepoint-table.cc

Issue 6334083: Streamline the code for patching optimized code for lazy deopt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Rewrite the incorrect comment mentioning absolute calls. Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/x64/deoptimizer-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ASSERT(reg_index >= 0 && reg_index < kNumSafepointRegisters); 51 ASSERT(reg_index >= 0 && reg_index < kNumSafepointRegisters);
52 int byte_index = reg_index >> kBitsPerByteLog2; 52 int byte_index = reg_index >> kBitsPerByteLog2;
53 int bit_index = reg_index & (kBitsPerByte - 1); 53 int bit_index = reg_index & (kBitsPerByte - 1);
54 return (bits_[byte_index] & (1 << bit_index)) != 0; 54 return (bits_[byte_index] & (1 << bit_index)) != 0;
55 } 55 }
56 56
57 57
58 SafepointTable::SafepointTable(Code* code) { 58 SafepointTable::SafepointTable(Code* code) {
59 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); 59 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
60 code_ = code; 60 code_ = code;
61 Address header = code->instruction_start() + code->safepoint_table_start(); 61 Address header = code->instruction_start() + code->safepoint_table_offset();
62 length_ = Memory::uint32_at(header + kLengthOffset); 62 length_ = Memory::uint32_at(header + kLengthOffset);
63 entry_size_ = Memory::uint32_at(header + kEntrySizeOffset); 63 entry_size_ = Memory::uint32_at(header + kEntrySizeOffset);
64 pc_and_deoptimization_indexes_ = header + kHeaderSize; 64 pc_and_deoptimization_indexes_ = header + kHeaderSize;
65 entries_ = pc_and_deoptimization_indexes_ + 65 entries_ = pc_and_deoptimization_indexes_ +
66 (length_ * kPcAndDeoptimizationIndexSize); 66 (length_ * kPcAndDeoptimizationIndexSize);
67 ASSERT(entry_size_ > 0); 67 ASSERT(entry_size_ > 0);
68 ASSERT_EQ(SafepointEntry::DeoptimizationIndexField::max(), 68 ASSERT_EQ(SafepointEntry::DeoptimizationIndexField::max(),
69 Safepoint::kNoDeoptimizationIndex); 69 Safepoint::kNoDeoptimizationIndex);
70 } 70 }
71 71
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 unsigned gap_size = info.pc_after_gap - info.pc; 224 unsigned gap_size = info.pc_after_gap - info.pc;
225 uint32_t encoding = SafepointEntry::DeoptimizationIndexField::encode(index); 225 uint32_t encoding = SafepointEntry::DeoptimizationIndexField::encode(index);
226 encoding |= SafepointEntry::GapCodeSizeField::encode(gap_size); 226 encoding |= SafepointEntry::GapCodeSizeField::encode(gap_size);
227 encoding |= SafepointEntry::ArgumentsField::encode(info.arguments); 227 encoding |= SafepointEntry::ArgumentsField::encode(info.arguments);
228 encoding |= SafepointEntry::SaveDoublesField::encode(info.has_doubles); 228 encoding |= SafepointEntry::SaveDoublesField::encode(info.has_doubles);
229 return encoding; 229 return encoding;
230 } 230 }
231 231
232 232
233 } } // namespace v8::internal 233 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698