Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 806 // generated). Do not allow the call to perform a garbage | 806 // generated). Do not allow the call to perform a garbage |
| 807 // collection but instead return the allocation failure object. | 807 // collection but instead return the allocation failure object. |
| 808 Object* result = masm()->TryCallStub(&stub); | 808 Object* result = masm()->TryCallStub(&stub); |
| 809 if (result->IsFailure()) { | 809 if (result->IsFailure()) { |
| 810 *failure = Failure::cast(result); | 810 *failure = Failure::cast(result); |
| 811 return false; | 811 return false; |
| 812 } | 812 } |
| 813 | 813 |
| 814 // We need to avoid using eax since that now holds the result. | 814 // We need to avoid using eax since that now holds the result. |
| 815 Register tmp = other.is(eax) ? reg : other; | 815 Register tmp = other.is(eax) ? reg : other; |
| 816 __ PopHandleScope(eax, tmp); | 816 // The code emitted for PopHandleScope tries to call the runtime |
| 817 // through a stub. Do not allow the call to perform a garbage | |
| 818 // collection but instead return a failure object. | |
|
iposva
2009/12/20 05:04:51
This comment is very confusing. Isn't it so that e
| |
| 819 result = masm()->TryPopHandleScope(eax, tmp); | |
| 820 if (result->IsFailure()) { | |
| 821 *failure = Failure::cast(result); | |
| 822 return false; | |
| 823 } | |
| 817 __ LeaveInternalFrame(); | 824 __ LeaveInternalFrame(); |
| 818 | 825 |
| 819 __ ret(0); | 826 __ ret(0); |
| 820 return true; | 827 return true; |
| 821 } | 828 } |
| 822 | 829 |
| 823 | 830 |
| 824 void StubCompiler::GenerateLoadConstant(JSObject* object, | 831 void StubCompiler::GenerateLoadConstant(JSObject* object, |
| 825 JSObject* holder, | 832 JSObject* holder, |
| 826 Register receiver, | 833 Register receiver, |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1938 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 1945 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1939 | 1946 |
| 1940 // Return the generated code. | 1947 // Return the generated code. |
| 1941 return GetCode(); | 1948 return GetCode(); |
| 1942 } | 1949 } |
| 1943 | 1950 |
| 1944 | 1951 |
| 1945 #undef __ | 1952 #undef __ |
| 1946 | 1953 |
| 1947 } } // namespace v8::internal | 1954 } } // namespace v8::internal |
| OLD | NEW |