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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 __ j(zero, miss, not_taken); | 1028 __ j(zero, miss, not_taken); |
1029 | 1029 |
1030 // Check that the maps haven't changed. | 1030 // Check that the maps haven't changed. |
1031 Register reg = | 1031 Register reg = |
1032 CheckPrototypes(object, receiver, holder, scratch1, | 1032 CheckPrototypes(object, receiver, holder, scratch1, |
1033 scratch2, scratch3, name, miss); | 1033 scratch2, scratch3, name, miss); |
1034 | 1034 |
1035 Handle<AccessorInfo> callback_handle(callback); | 1035 Handle<AccessorInfo> callback_handle(callback); |
1036 | 1036 |
1037 __ EnterInternalFrame(); | 1037 __ EnterInternalFrame(); |
1038 __ PushHandleScope(scratch2); | |
1039 // Push the stack address where the list of arguments ends. | 1038 // Push the stack address where the list of arguments ends. |
1040 __ mov(scratch2, esp); | 1039 __ mov(scratch2, esp); |
1041 __ sub(Operand(scratch2), Immediate(2 * kPointerSize)); | 1040 __ sub(Operand(scratch2), Immediate(2 * kPointerSize)); |
1042 __ push(scratch2); | 1041 __ push(scratch2); |
1043 __ push(receiver); // receiver | 1042 __ push(receiver); // receiver |
1044 __ push(reg); // holder | 1043 __ push(reg); // holder |
1045 // Push data from AccessorInfo. | 1044 // Push data from AccessorInfo. |
1046 if (Heap::InNewSpace(callback_handle->data())) { | 1045 if (Heap::InNewSpace(callback_handle->data())) { |
1047 __ mov(scratch2, Immediate(callback_handle)); | 1046 __ mov(scratch2, Immediate(callback_handle)); |
1048 __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset)); | 1047 __ push(FieldOperand(scratch2, AccessorInfo::kDataOffset)); |
(...skipping 14 matching lines...) Expand all Loading... |
1063 ApiGetterEntryStub stub(callback_handle, &fun); | 1062 ApiGetterEntryStub stub(callback_handle, &fun); |
1064 // Emitting a stub call may try to allocate (if the code is not | 1063 // Emitting a stub call may try to allocate (if the code is not |
1065 // already generated). Do not allow the assembler to perform a | 1064 // already generated). Do not allow the assembler to perform a |
1066 // garbage collection but instead return the allocation failure | 1065 // garbage collection but instead return the allocation failure |
1067 // object. | 1066 // object. |
1068 Object* result = masm()->TryCallStub(&stub); | 1067 Object* result = masm()->TryCallStub(&stub); |
1069 if (result->IsFailure()) { | 1068 if (result->IsFailure()) { |
1070 *failure = Failure::cast(result); | 1069 *failure = Failure::cast(result); |
1071 return false; | 1070 return false; |
1072 } | 1071 } |
1073 | |
1074 // We need to avoid using eax since that now holds the result. | |
1075 Register tmp = scratch2.is(eax) ? reg : scratch2; | |
1076 // Emitting PopHandleScope may try to allocate. Do not allow the | |
1077 // assembler to perform a garbage collection but instead return a | |
1078 // failure object. | |
1079 result = masm()->TryPopHandleScope(eax, tmp); | |
1080 if (result->IsFailure()) { | |
1081 *failure = Failure::cast(result); | |
1082 return false; | |
1083 } | |
1084 __ LeaveInternalFrame(); | 1072 __ LeaveInternalFrame(); |
1085 | 1073 |
1086 __ ret(0); | 1074 __ ret(0); |
1087 return true; | 1075 return true; |
1088 } | 1076 } |
1089 | 1077 |
1090 | 1078 |
1091 void StubCompiler::GenerateLoadConstant(JSObject* object, | 1079 void StubCompiler::GenerateLoadConstant(JSObject* object, |
1092 JSObject* holder, | 1080 JSObject* holder, |
1093 Register receiver, | 1081 Register receiver, |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 // Return the generated code. | 3052 // Return the generated code. |
3065 return GetCode(); | 3053 return GetCode(); |
3066 } | 3054 } |
3067 | 3055 |
3068 | 3056 |
3069 #undef __ | 3057 #undef __ |
3070 | 3058 |
3071 } } // namespace v8::internal | 3059 } } // namespace v8::internal |
3072 | 3060 |
3073 #endif // V8_TARGET_ARCH_IA32 | 3061 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |