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

Side by Side Diff: src/frames.cc

Issue 118500: Get rid of the notion of "parameter pointer" that no longer exists in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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/frames.h ('k') | src/frames-inl.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 395
396 Code* ExitFrame::code() const { 396 Code* ExitFrame::code() const {
397 return Heap::c_entry_code(); 397 return Heap::c_entry_code();
398 } 398 }
399 399
400 400
401 void ExitFrame::ComputeCallerState(State* state) const { 401 void ExitFrame::ComputeCallerState(State* state) const {
402 // Setup the caller state. 402 // Setup the caller state.
403 state->sp = pp(); 403 state->sp = caller_sp();
404 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset); 404 state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset);
405 state->pc_address 405 state->pc_address
406 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset); 406 = reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset);
407 } 407 }
408 408
409 409
410 Address ExitFrame::GetCallerStackPointer() const { 410 Address ExitFrame::GetCallerStackPointer() const {
411 return fp() + ExitFrameConstants::kPPDisplacement; 411 return fp() + ExitFrameConstants::kCallerSPDisplacement;
412 } 412 }
413 413
414 414
415 Code* ExitDebugFrame::code() const { 415 Code* ExitDebugFrame::code() const {
416 return Heap::c_entry_debug_break_code(); 416 return Heap::c_entry_debug_break_code();
417 } 417 }
418 418
419 419
420 Address StandardFrame::GetExpressionAddress(int n) const { 420 Address StandardFrame::GetExpressionAddress(int n) const {
421 const int offset = StandardFrameConstants::kExpressionsOffset; 421 const int offset = StandardFrameConstants::kExpressionsOffset;
(...skipping 24 matching lines...) Expand all
446 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { 446 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) {
447 if (it.handler()->includes(address)) return true; 447 if (it.handler()->includes(address)) return true;
448 } 448 }
449 return false; 449 return false;
450 } 450 }
451 451
452 452
453 Object* JavaScriptFrame::GetParameter(int index) const { 453 Object* JavaScriptFrame::GetParameter(int index) const {
454 ASSERT(index >= 0 && index < ComputeParametersCount()); 454 ASSERT(index >= 0 && index < ComputeParametersCount());
455 const int offset = JavaScriptFrameConstants::kParam0Offset; 455 const int offset = JavaScriptFrameConstants::kParam0Offset;
456 return Memory::Object_at(pp() + offset - (index * kPointerSize)); 456 return Memory::Object_at(caller_sp() + offset - (index * kPointerSize));
457 } 457 }
458 458
459 459
460 int JavaScriptFrame::ComputeParametersCount() const { 460 int JavaScriptFrame::ComputeParametersCount() const {
461 Address base = pp() + JavaScriptFrameConstants::kReceiverOffset; 461 Address base = caller_sp() + JavaScriptFrameConstants::kReceiverOffset;
462 Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset; 462 Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset;
463 return (base - limit) / kPointerSize; 463 return (base - limit) / kPointerSize;
464 } 464 }
465 465
466 466
467 bool JavaScriptFrame::IsConstructor() const { 467 bool JavaScriptFrame::IsConstructor() const {
468 Address fp = caller_fp(); 468 Address fp = caller_fp();
469 if (has_adapted_arguments()) { 469 if (has_adapted_arguments()) {
470 // Skip the arguments adaptor frame and look at the real caller. 470 // Skip the arguments adaptor frame and look at the real caller.
471 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); 471 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 } 676 }
677 677
678 678
679 void JavaScriptFrame::Iterate(ObjectVisitor* v) const { 679 void JavaScriptFrame::Iterate(ObjectVisitor* v) const {
680 IterateExpressions(v); 680 IterateExpressions(v);
681 681
682 // Traverse callee-saved registers, receiver, and parameters. 682 // Traverse callee-saved registers, receiver, and parameters.
683 const int kBaseOffset = JavaScriptFrameConstants::kSavedRegistersOffset; 683 const int kBaseOffset = JavaScriptFrameConstants::kSavedRegistersOffset;
684 const int kLimitOffset = JavaScriptFrameConstants::kReceiverOffset; 684 const int kLimitOffset = JavaScriptFrameConstants::kReceiverOffset;
685 Object** base = &Memory::Object_at(fp() + kBaseOffset); 685 Object** base = &Memory::Object_at(fp() + kBaseOffset);
686 Object** limit = &Memory::Object_at(pp() + kLimitOffset) + 1; 686 Object** limit = &Memory::Object_at(caller_sp() + kLimitOffset) + 1;
687 v->VisitPointers(base, limit); 687 v->VisitPointers(base, limit);
688 } 688 }
689 689
690 690
691 void InternalFrame::Iterate(ObjectVisitor* v) const { 691 void InternalFrame::Iterate(ObjectVisitor* v) const {
692 // Internal frames only have object pointers on the expression stack 692 // Internal frames only have object pointers on the expression stack
693 // as they never have any arguments. 693 // as they never have any arguments.
694 IterateExpressions(v); 694 IterateExpressions(v);
695 } 695 }
696 696
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 reg_code[i++] = r; 734 reg_code[i++] = r;
735 735
736 ASSERT(i == kNumJSCallerSaved); 736 ASSERT(i == kNumJSCallerSaved);
737 } 737 }
738 ASSERT(0 <= n && n < kNumJSCallerSaved); 738 ASSERT(0 <= n && n < kNumJSCallerSaved);
739 return reg_code[n]; 739 return reg_code[n];
740 } 740 }
741 741
742 742
743 } } // namespace v8::internal 743 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698