OLD | NEW |
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return Memory::Object_at(fp() + offset); | 478 return Memory::Object_at(fp() + offset); |
479 } | 479 } |
480 | 480 |
481 | 481 |
482 Code* ExitFrame::unchecked_code() const { | 482 Code* ExitFrame::unchecked_code() const { |
483 return reinterpret_cast<Code*>(code_slot()); | 483 return reinterpret_cast<Code*>(code_slot()); |
484 } | 484 } |
485 | 485 |
486 | 486 |
487 void ExitFrame::ComputeCallerState(State* state) const { | 487 void ExitFrame::ComputeCallerState(State* state) const { |
488 // Setup the caller state. | 488 // Set up the caller state. |
489 state->sp = caller_sp(); | 489 state->sp = caller_sp(); |
490 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); | 490 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); |
491 state->pc_address | 491 state->pc_address |
492 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); | 492 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 void ExitFrame::SetCallerFp(Address caller_fp) { | 496 void ExitFrame::SetCallerFp(Address caller_fp) { |
497 Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset) = caller_fp; | 497 Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset) = caller_fp; |
498 } | 498 } |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 addr = next_addr; | 1296 addr = next_addr; |
1297 } | 1297 } |
1298 } | 1298 } |
1299 | 1299 |
1300 | 1300 |
1301 InnerPointerToCodeCache::InnerPointerToCodeCacheEntry* | 1301 InnerPointerToCodeCache::InnerPointerToCodeCacheEntry* |
1302 InnerPointerToCodeCache::GetCacheEntry(Address inner_pointer) { | 1302 InnerPointerToCodeCache::GetCacheEntry(Address inner_pointer) { |
1303 isolate_->counters()->pc_to_code()->Increment(); | 1303 isolate_->counters()->pc_to_code()->Increment(); |
1304 ASSERT(IsPowerOf2(kInnerPointerToCodeCacheSize)); | 1304 ASSERT(IsPowerOf2(kInnerPointerToCodeCacheSize)); |
1305 uint32_t hash = ComputeIntegerHash( | 1305 uint32_t hash = ComputeIntegerHash( |
1306 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer))); | 1306 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer)), |
| 1307 v8::internal::kZeroHashSeed); |
1307 uint32_t index = hash & (kInnerPointerToCodeCacheSize - 1); | 1308 uint32_t index = hash & (kInnerPointerToCodeCacheSize - 1); |
1308 InnerPointerToCodeCacheEntry* entry = cache(index); | 1309 InnerPointerToCodeCacheEntry* entry = cache(index); |
1309 if (entry->inner_pointer == inner_pointer) { | 1310 if (entry->inner_pointer == inner_pointer) { |
1310 isolate_->counters()->pc_to_code_cached()->Increment(); | 1311 isolate_->counters()->pc_to_code_cached()->Increment(); |
1311 ASSERT(entry->code == GcSafeFindCodeForInnerPointer(inner_pointer)); | 1312 ASSERT(entry->code == GcSafeFindCodeForInnerPointer(inner_pointer)); |
1312 } else { | 1313 } else { |
1313 // Because this code may be interrupted by a profiling signal that | 1314 // Because this code may be interrupted by a profiling signal that |
1314 // also queries the cache, we cannot update inner_pointer before the code | 1315 // also queries the cache, we cannot update inner_pointer before the code |
1315 // has been set. Otherwise, we risk trying to use a cache entry before | 1316 // has been set. Otherwise, we risk trying to use a cache entry before |
1316 // the code has been computed. | 1317 // the code has been computed. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 ZoneList<StackFrame*> list(10); | 1387 ZoneList<StackFrame*> list(10); |
1387 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1388 for (StackFrameIterator it; !it.done(); it.Advance()) { |
1388 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1389 StackFrame* frame = AllocateFrameCopy(it.frame()); |
1389 list.Add(frame); | 1390 list.Add(frame); |
1390 } | 1391 } |
1391 return list.ToVector(); | 1392 return list.ToVector(); |
1392 } | 1393 } |
1393 | 1394 |
1394 | 1395 |
1395 } } // namespace v8::internal | 1396 } } // namespace v8::internal |
OLD | NEW |