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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 if (!found_it) return Heap::undefined_value(); | 542 if (!found_it) return Heap::undefined_value(); |
543 Handle<JSFunction> function(holder); | 543 Handle<JSFunction> function(holder); |
544 | 544 |
545 // Find the top invocation of the function by traversing frames. | 545 // Find the top invocation of the function by traversing frames. |
546 for (JavaScriptFrameIterator it; !it.done(); it.Advance()) { | 546 for (JavaScriptFrameIterator it; !it.done(); it.Advance()) { |
547 // Skip all frames that aren't invocations of the given function. | 547 // Skip all frames that aren't invocations of the given function. |
548 JavaScriptFrame* frame = it.frame(); | 548 JavaScriptFrame* frame = it.frame(); |
549 if (frame->function() != *function) continue; | 549 if (frame->function() != *function) continue; |
550 | 550 |
551 // If there is an arguments variable in the stack, we return that. | 551 // If there is an arguments variable in the stack, we return that. |
552 int index = ScopeInfo<>::StackSlotIndex(function->shared()->scope_info(), | 552 int index = function->shared()->scope_info()-> |
553 Heap::arguments_symbol()); | 553 StackSlotIndex(Heap::arguments_symbol()); |
554 if (index >= 0) { | 554 if (index >= 0) { |
555 Handle<Object> arguments = Handle<Object>(frame->GetExpression(index)); | 555 Handle<Object> arguments = Handle<Object>(frame->GetExpression(index)); |
556 if (!arguments->IsTheHole()) return *arguments; | 556 if (!arguments->IsTheHole()) return *arguments; |
557 } | 557 } |
558 | 558 |
559 // If there isn't an arguments variable in the stack, we need to | 559 // If there isn't an arguments variable in the stack, we need to |
560 // find the frame that holds the actual arguments passed to the | 560 // find the frame that holds the actual arguments passed to the |
561 // function on the stack. | 561 // function on the stack. |
562 it.AdvanceToArgumentsFrame(); | 562 it.AdvanceToArgumentsFrame(); |
563 frame = it.frame(); | 563 frame = it.frame(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 } | 652 } |
653 | 653 |
654 | 654 |
655 const AccessorDescriptor Accessors::ObjectPrototype = { | 655 const AccessorDescriptor Accessors::ObjectPrototype = { |
656 ObjectGetPrototype, | 656 ObjectGetPrototype, |
657 ObjectSetPrototype, | 657 ObjectSetPrototype, |
658 0 | 658 0 |
659 }; | 659 }; |
660 | 660 |
661 } } // namespace v8::internal | 661 } } // namespace v8::internal |
OLD | NEW |