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

Side by Side Diff: src/frames.cc

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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/frames.h ('k') | src/full-codegen.h » ('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/frames.h" 5 #include "src/frames.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return code; 379 return code;
380 } 380 }
381 381
382 382
383 bool StackFrame::HasHandler() const { 383 bool StackFrame::HasHandler() const {
384 StackHandlerIterator it(this, top_handler()); 384 StackHandlerIterator it(this, top_handler());
385 return !it.done(); 385 return !it.done();
386 } 386 }
387 387
388 388
389 #ifdef DEBUG 389 #if DCHECK_IS_ON
390 static bool GcSafeCodeContains(HeapObject* object, Address addr); 390 static bool GcSafeCodeContains(HeapObject* object, Address addr);
391 #endif 391 #endif
392 392
393 393
394 void StackFrame::IteratePc(ObjectVisitor* v, 394 void StackFrame::IteratePc(ObjectVisitor* v,
395 Address* pc_address, 395 Address* pc_address,
396 Code* holder) { 396 Code* holder) {
397 Address pc = *pc_address; 397 Address pc = *pc_address;
398 DCHECK(GcSafeCodeContains(holder, pc)); 398 DCHECK(GcSafeCodeContains(holder, pc));
399 unsigned pc_offset = static_cast<unsigned>(pc - holder->instruction_start()); 399 unsigned pc_offset = static_cast<unsigned>(pc - holder->instruction_start());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (!iterator->can_access_heap_objects_) return JAVA_SCRIPT; 433 if (!iterator->can_access_heap_objects_) return JAVA_SCRIPT;
434 Code::Kind kind = GetContainingCode(iterator->isolate(), 434 Code::Kind kind = GetContainingCode(iterator->isolate(),
435 *(state->pc_address))->kind(); 435 *(state->pc_address))->kind();
436 DCHECK(kind == Code::FUNCTION || kind == Code::OPTIMIZED_FUNCTION); 436 DCHECK(kind == Code::FUNCTION || kind == Code::OPTIMIZED_FUNCTION);
437 return (kind == Code::OPTIMIZED_FUNCTION) ? OPTIMIZED : JAVA_SCRIPT; 437 return (kind == Code::OPTIMIZED_FUNCTION) ? OPTIMIZED : JAVA_SCRIPT;
438 } 438 }
439 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); 439 return static_cast<StackFrame::Type>(Smi::cast(marker)->value());
440 } 440 }
441 441
442 442
443 #ifdef DEBUG 443 #if DCHECK_IS_ON
444 bool StackFrame::can_access_heap_objects() const { 444 bool StackFrame::can_access_heap_objects() const {
445 return iterator_->can_access_heap_objects_; 445 return iterator_->can_access_heap_objects_;
446 } 446 }
447 #endif 447 #endif
448 448
449 449
450 StackFrame::Type StackFrame::GetCallerState(State* state) const { 450 StackFrame::Type StackFrame::GetCallerState(State* state) const {
451 ComputeCallerState(state); 451 ComputeCallerState(state);
452 return ComputeType(iterator_, state); 452 return ComputeType(iterator_, state);
453 } 453 }
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 return map_word.IsForwardingAddress() ? 1443 return map_word.IsForwardingAddress() ?
1444 map_word.ToForwardingAddress()->map() : map_word.ToMap(); 1444 map_word.ToForwardingAddress()->map() : map_word.ToMap();
1445 } 1445 }
1446 1446
1447 1447
1448 static int GcSafeSizeOfCodeSpaceObject(HeapObject* object) { 1448 static int GcSafeSizeOfCodeSpaceObject(HeapObject* object) {
1449 return object->SizeFromMap(GcSafeMapOfCodeSpaceObject(object)); 1449 return object->SizeFromMap(GcSafeMapOfCodeSpaceObject(object));
1450 } 1450 }
1451 1451
1452 1452
1453 #ifdef DEBUG 1453 #if DCHECK_IS_ON
1454 static bool GcSafeCodeContains(HeapObject* code, Address addr) { 1454 static bool GcSafeCodeContains(HeapObject* code, Address addr) {
1455 Map* map = GcSafeMapOfCodeSpaceObject(code); 1455 Map* map = GcSafeMapOfCodeSpaceObject(code);
1456 DCHECK(map == code->GetHeap()->code_map()); 1456 DCHECK(map == code->GetHeap()->code_map());
1457 Address start = code->address(); 1457 Address start = code->address();
1458 Address end = code->address() + code->SizeFromMap(map); 1458 Address end = code->address() + code->SizeFromMap(map);
1459 return start <= addr && addr < end; 1459 return start <= addr && addr < end;
1460 } 1460 }
1461 #endif 1461 #endif
1462 1462
1463 1463
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 ZoneList<StackFrame*> list(10, zone); 1639 ZoneList<StackFrame*> list(10, zone);
1640 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1640 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1641 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1641 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1642 list.Add(frame, zone); 1642 list.Add(frame, zone);
1643 } 1643 }
1644 return list.ToVector(); 1644 return list.ToVector();
1645 } 1645 }
1646 1646
1647 1647
1648 } } // namespace v8::internal 1648 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698