| OLD | NEW |
| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 | 610 |
| 611 Object* JavaScriptFrame::GetParameter(int index) const { | 611 Object* JavaScriptFrame::GetParameter(int index) const { |
| 612 ASSERT(index >= 0 && index < ComputeParametersCount()); | 612 ASSERT(index >= 0 && index < ComputeParametersCount()); |
| 613 const int offset = JavaScriptFrameConstants::kParam0Offset; | 613 const int offset = JavaScriptFrameConstants::kParam0Offset; |
| 614 return Memory::Object_at(caller_sp() + offset - (index * kPointerSize)); | 614 return Memory::Object_at(caller_sp() + offset - (index * kPointerSize)); |
| 615 } | 615 } |
| 616 | 616 |
| 617 | 617 |
| 618 int JavaScriptFrame::ComputeParametersCount() const { | 618 int JavaScriptFrame::ComputeParametersCount() const { |
| 619 Address base = caller_sp() + JavaScriptFrameConstants::kReceiverOffset; | 619 Address base = caller_sp() + JavaScriptFrameConstants::kReceiverOffset; |
| 620 Address limit = fp() + JavaScriptFrameConstants::kLastParameterOffset; | 620 Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset; |
| 621 return static_cast<int>((base - limit) / kPointerSize); | 621 return static_cast<int>((base - limit) / kPointerSize); |
| 622 } | 622 } |
| 623 | 623 |
| 624 | 624 |
| 625 bool JavaScriptFrame::IsConstructor() const { | 625 bool JavaScriptFrame::IsConstructor() const { |
| 626 Address fp = caller_fp(); | 626 Address fp = caller_fp(); |
| 627 if (has_adapted_arguments()) { | 627 if (has_adapted_arguments()) { |
| 628 // Skip the arguments adaptor frame and look at the real caller. | 628 // Skip the arguments adaptor frame and look at the real caller. |
| 629 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 629 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); |
| 630 } | 630 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 | 1077 |
| 1078 void JavaScriptFrame::Iterate(ObjectVisitor* v) const { | 1078 void JavaScriptFrame::Iterate(ObjectVisitor* v) const { |
| 1079 IterateExpressions(v); | 1079 IterateExpressions(v); |
| 1080 IteratePc(v, pc_address(), LookupCode(Isolate::Current())); | 1080 IteratePc(v, pc_address(), LookupCode(Isolate::Current())); |
| 1081 IterateArguments(v); | 1081 IterateArguments(v); |
| 1082 } | 1082 } |
| 1083 | 1083 |
| 1084 | 1084 |
| 1085 void JavaScriptFrame::IterateArguments(ObjectVisitor* v) const { | 1085 void JavaScriptFrame::IterateArguments(ObjectVisitor* v) const { |
| 1086 // Traverse callee-saved registers, receiver, and parameters. | 1086 // Traverse callee-saved registers, receiver, and parameters. |
| 1087 const int kBaseOffset = JavaScriptFrameConstants::kLastParameterOffset; | 1087 const int kBaseOffset = JavaScriptFrameConstants::kSavedRegistersOffset; |
| 1088 const int kLimitOffset = JavaScriptFrameConstants::kReceiverOffset; | 1088 const int kLimitOffset = JavaScriptFrameConstants::kReceiverOffset; |
| 1089 Object** base = &Memory::Object_at(fp() + kBaseOffset); | 1089 Object** base = &Memory::Object_at(fp() + kBaseOffset); |
| 1090 Object** limit = &Memory::Object_at(caller_sp() + kLimitOffset) + 1; | 1090 Object** limit = &Memory::Object_at(caller_sp() + kLimitOffset) + 1; |
| 1091 v->VisitPointers(base, limit); | 1091 v->VisitPointers(base, limit); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 | 1094 |
| 1095 void InternalFrame::Iterate(ObjectVisitor* v) const { | 1095 void InternalFrame::Iterate(ObjectVisitor* v) const { |
| 1096 // Internal frames only have object pointers on the expression stack | 1096 // Internal frames only have object pointers on the expression stack |
| 1097 // as they never have any arguments. | 1097 // as they never have any arguments. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 ZoneList<StackFrame*> list(10); | 1233 ZoneList<StackFrame*> list(10); |
| 1234 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1234 for (StackFrameIterator it; !it.done(); it.Advance()) { |
| 1235 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1235 StackFrame* frame = AllocateFrameCopy(it.frame()); |
| 1236 list.Add(frame); | 1236 list.Add(frame); |
| 1237 } | 1237 } |
| 1238 return list.ToVector(); | 1238 return list.ToVector(); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 | 1241 |
| 1242 } } // namespace v8::internal | 1242 } } // namespace v8::internal |
| OLD | NEW |