| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 | 196 |
| 197 void StackTraceFrameIterator::Advance() { | 197 void StackTraceFrameIterator::Advance() { |
| 198 while (true) { | 198 while (true) { |
| 199 JavaScriptFrameIterator::Advance(); | 199 JavaScriptFrameIterator::Advance(); |
| 200 if (done()) return; | 200 if (done()) return; |
| 201 if (IsValidFrame()) return; | 201 if (IsValidFrame()) return; |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 |
| 205 bool StackTraceFrameIterator::IsValidFrame() { | 206 bool StackTraceFrameIterator::IsValidFrame() { |
| 206 if (!frame()->function()->IsJSFunction()) return false; | 207 if (!frame()->function()->IsJSFunction()) return false; |
| 207 Object* script = JSFunction::cast(frame()->function())->shared()->script(); | 208 Object* script = JSFunction::cast(frame()->function())->shared()->script(); |
| 208 // Don't show functions from native scripts to user. | 209 // Don't show functions from native scripts to user. |
| 209 return (script->IsScript() && | 210 return (script->IsScript() && |
| 210 Script::TYPE_NATIVE != Script::cast(script)->type()->value()); | 211 Script::TYPE_NATIVE != Script::cast(script)->type()->value()); |
| 211 } | 212 } |
| 212 | 213 |
| 213 | 214 |
| 214 // ------------------------------------------------------------------------- | 215 // ------------------------------------------------------------------------- |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 | 1562 |
| 1562 void SetUpJSCallerSavedCodeData() { | 1563 void SetUpJSCallerSavedCodeData() { |
| 1563 int i = 0; | 1564 int i = 0; |
| 1564 for (int r = 0; r < kNumRegs; r++) | 1565 for (int r = 0; r < kNumRegs; r++) |
| 1565 if ((kJSCallerSaved & (1 << r)) != 0) | 1566 if ((kJSCallerSaved & (1 << r)) != 0) |
| 1566 caller_saved_code_data.reg_code[i++] = r; | 1567 caller_saved_code_data.reg_code[i++] = r; |
| 1567 | 1568 |
| 1568 ASSERT(i == kNumJSCallerSaved); | 1569 ASSERT(i == kNumJSCallerSaved); |
| 1569 } | 1570 } |
| 1570 | 1571 |
| 1572 |
| 1571 int JSCallerSavedCode(int n) { | 1573 int JSCallerSavedCode(int n) { |
| 1572 ASSERT(0 <= n && n < kNumJSCallerSaved); | 1574 ASSERT(0 <= n && n < kNumJSCallerSaved); |
| 1573 return caller_saved_code_data.reg_code[n]; | 1575 return caller_saved_code_data.reg_code[n]; |
| 1574 } | 1576 } |
| 1575 | 1577 |
| 1576 | 1578 |
| 1577 #define DEFINE_WRAPPER(type, field) \ | 1579 #define DEFINE_WRAPPER(type, field) \ |
| 1578 class field##_Wrapper : public ZoneObject { \ | 1580 class field##_Wrapper : public ZoneObject { \ |
| 1579 public: /* NOLINT */ \ | 1581 public: /* NOLINT */ \ |
| 1580 field##_Wrapper(const field& original) : frame_(original) { \ | 1582 field##_Wrapper(const field& original) : frame_(original) { \ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1593 } | 1595 } |
| 1594 | 1596 |
| 1595 switch (frame->type()) { | 1597 switch (frame->type()) { |
| 1596 STACK_FRAME_TYPE_LIST(FRAME_TYPE_CASE) | 1598 STACK_FRAME_TYPE_LIST(FRAME_TYPE_CASE) |
| 1597 default: UNREACHABLE(); | 1599 default: UNREACHABLE(); |
| 1598 } | 1600 } |
| 1599 #undef FRAME_TYPE_CASE | 1601 #undef FRAME_TYPE_CASE |
| 1600 return NULL; | 1602 return NULL; |
| 1601 } | 1603 } |
| 1602 | 1604 |
| 1605 |
| 1603 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone) { | 1606 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone) { |
| 1604 ZoneList<StackFrame*> list(10, zone); | 1607 ZoneList<StackFrame*> list(10, zone); |
| 1605 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1608 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1606 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1609 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1607 list.Add(frame, zone); | 1610 list.Add(frame, zone); |
| 1608 } | 1611 } |
| 1609 return list.ToVector(); | 1612 return list.ToVector(); |
| 1610 } | 1613 } |
| 1611 | 1614 |
| 1612 | 1615 |
| 1613 } } // namespace v8::internal | 1616 } } // namespace v8::internal |
| OLD | NEW |