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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 | 2683 |
2684 // ------------------------------------------------------------------------ | 2684 // ------------------------------------------------------------------------ |
2685 // Fast-case: Use inline caching. | 2685 // Fast-case: Use inline caching. |
2686 // --- | 2686 // --- |
2687 // According to ECMA-262, section 11.2.3, page 44, the function to call | 2687 // According to ECMA-262, section 11.2.3, page 44, the function to call |
2688 // must be resolved after the arguments have been evaluated. The IC code | 2688 // must be resolved after the arguments have been evaluated. The IC code |
2689 // automatically handles this by loading the arguments before the function | 2689 // automatically handles this by loading the arguments before the function |
2690 // is resolved in cache misses (this also holds for megamorphic calls). | 2690 // is resolved in cache misses (this also holds for megamorphic calls). |
2691 // ------------------------------------------------------------------------ | 2691 // ------------------------------------------------------------------------ |
2692 | 2692 |
| 2693 if (node->eval_type() == Call::POTENTIALLY_DIRECT) { |
| 2694 __ CallRuntime(Runtime::kSetInPotentiallyDirectEval, 0); |
| 2695 } else { |
| 2696 __ CallRuntime(Runtime::kClearInPotentiallyDirectEval, 0); |
| 2697 } |
| 2698 |
2693 if (var != NULL && !var->is_this() && var->is_global()) { | 2699 if (var != NULL && !var->is_this() && var->is_global()) { |
2694 // ---------------------------------- | 2700 // ---------------------------------- |
2695 // JavaScript example: 'foo(1, 2, 3)' // foo is global | 2701 // JavaScript example: 'foo(1, 2, 3)' // foo is global |
2696 // ---------------------------------- | 2702 // ---------------------------------- |
2697 | 2703 |
2698 // Push the name of the function and the receiver onto the stack. | 2704 // Push the name of the function and the receiver onto the stack. |
2699 frame_->Push(Immediate(var->name())); | 2705 frame_->Push(Immediate(var->name())); |
2700 | 2706 |
2701 // Pass the global object as the receiver and let the IC stub | 2707 // Pass the global object as the receiver and let the IC stub |
2702 // patch the stack to use the global proxy as 'this' in the | 2708 // patch the stack to use the global proxy as 'this' in the |
(...skipping 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5153 | 5159 |
5154 // Slow-case: Go through the JavaScript implementation. | 5160 // Slow-case: Go through the JavaScript implementation. |
5155 __ bind(&slow); | 5161 __ bind(&slow); |
5156 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5162 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5157 } | 5163 } |
5158 | 5164 |
5159 | 5165 |
5160 #undef __ | 5166 #undef __ |
5161 | 5167 |
5162 } } // namespace v8::internal | 5168 } } // namespace v8::internal |
OLD | NEW |