OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 void VirtualFrame::Enter() { | 56 void VirtualFrame::Enter() { |
57 // Registers live on entry to a JS frame: | 57 // Registers live on entry to a JS frame: |
58 // rsp: stack pointer, points to return address from this function. | 58 // rsp: stack pointer, points to return address from this function. |
59 // rbp: base pointer, points to previous JS, ArgumentsAdaptor, or | 59 // rbp: base pointer, points to previous JS, ArgumentsAdaptor, or |
60 // Trampoline frame. | 60 // Trampoline frame. |
61 // rsi: context of this function call. | 61 // rsi: context of this function call. |
62 // rdi: pointer to this function object. | 62 // rdi: pointer to this function object. |
63 Comment cmnt(masm(), "[ Enter JS frame"); | 63 Comment cmnt(masm(), "[ Enter JS frame"); |
64 | 64 |
65 #ifdef DEBUG | 65 #ifdef DEBUG |
66 // Verify that rdi contains a JS function. The following code | 66 if (FLAG_debug_code) { |
67 // relies on rax being available for use. | 67 // Verify that rdi contains a JS function. The following code |
68 Condition not_smi = masm()->CheckNotSmi(rdi); | 68 // relies on rax being available for use. |
69 __ Check(not_smi, | 69 Condition not_smi = masm()->CheckNotSmi(rdi); |
70 "VirtualFrame::Enter - rdi is not a function (smi check)."); | 70 __ Check(not_smi, |
71 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); | 71 "VirtualFrame::Enter - rdi is not a function (smi check)."); |
72 __ Check(equal, | 72 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); |
73 "VirtualFrame::Enter - rdi is not a function (map check)."); | 73 __ Check(equal, |
| 74 "VirtualFrame::Enter - rdi is not a function (map check)."); |
| 75 } |
74 #endif | 76 #endif |
75 | 77 |
76 EmitPush(rbp); | 78 EmitPush(rbp); |
77 | 79 |
78 __ movq(rbp, rsp); | 80 __ movq(rbp, rsp); |
79 | 81 |
80 // Store the context in the frame. The context is kept in rsi and a | 82 // Store the context in the frame. The context is kept in rsi and a |
81 // copy is stored in the frame. The external reference to rsi | 83 // copy is stored in the frame. The external reference to rsi |
82 // remains. | 84 // remains. |
83 EmitPush(rsi); | 85 EmitPush(rsi); |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 // Grow the expression stack by handler size less one (the return | 1055 // Grow the expression stack by handler size less one (the return |
1054 // address is already pushed by a call instruction). | 1056 // address is already pushed by a call instruction). |
1055 Adjust(kHandlerSize - 1); | 1057 Adjust(kHandlerSize - 1); |
1056 __ PushTryHandler(IN_JAVASCRIPT, type); | 1058 __ PushTryHandler(IN_JAVASCRIPT, type); |
1057 } | 1059 } |
1058 | 1060 |
1059 | 1061 |
1060 #undef __ | 1062 #undef __ |
1061 | 1063 |
1062 } } // namespace v8::internal | 1064 } } // namespace v8::internal |
OLD | NEW |