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

Side by Side Diff: src/frames.cc

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 years, 3 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/factory.cc ('k') | src/gdb-jit.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 Address next_addr = addr + obj_size; 1494 Address next_addr = addr + obj_size;
1495 if (next_addr > inner_pointer) return GcSafeCastToCode(obj, inner_pointer); 1495 if (next_addr > inner_pointer) return GcSafeCastToCode(obj, inner_pointer);
1496 addr = next_addr; 1496 addr = next_addr;
1497 } 1497 }
1498 } 1498 }
1499 1499
1500 1500
1501 InnerPointerToCodeCache::InnerPointerToCodeCacheEntry* 1501 InnerPointerToCodeCache::InnerPointerToCodeCacheEntry*
1502 InnerPointerToCodeCache::GetCacheEntry(Address inner_pointer) { 1502 InnerPointerToCodeCache::GetCacheEntry(Address inner_pointer) {
1503 isolate_->counters()->pc_to_code()->Increment(); 1503 isolate_->counters()->pc_to_code()->Increment();
1504 DCHECK(IsPowerOf2(kInnerPointerToCodeCacheSize)); 1504 DCHECK(base::bits::IsPowerOfTwo32(kInnerPointerToCodeCacheSize));
1505 uint32_t hash = ComputeIntegerHash( 1505 uint32_t hash = ComputeIntegerHash(
1506 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer)), 1506 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(inner_pointer)),
1507 v8::internal::kZeroHashSeed); 1507 v8::internal::kZeroHashSeed);
1508 uint32_t index = hash & (kInnerPointerToCodeCacheSize - 1); 1508 uint32_t index = hash & (kInnerPointerToCodeCacheSize - 1);
1509 InnerPointerToCodeCacheEntry* entry = cache(index); 1509 InnerPointerToCodeCacheEntry* entry = cache(index);
1510 if (entry->inner_pointer == inner_pointer) { 1510 if (entry->inner_pointer == inner_pointer) {
1511 isolate_->counters()->pc_to_code_cached()->Increment(); 1511 isolate_->counters()->pc_to_code_cached()->Increment();
1512 DCHECK(entry->code == GcSafeFindCodeForInnerPointer(inner_pointer)); 1512 DCHECK(entry->code == GcSafeFindCodeForInnerPointer(inner_pointer));
1513 } else { 1513 } else {
1514 // Because this code may be interrupted by a profiling signal that 1514 // Because this code may be interrupted by a profiling signal that
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 ZoneList<StackFrame*> list(10, zone); 1635 ZoneList<StackFrame*> list(10, zone);
1636 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1636 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1637 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1637 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1638 list.Add(frame, zone); 1638 list.Add(frame, zone);
1639 } 1639 }
1640 return list.ToVector(); 1640 return list.ToVector();
1641 } 1641 }
1642 1642
1643 1643
1644 } } // namespace v8::internal 1644 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698