OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 // ReturnValue default value | 1306 // ReturnValue default value |
1307 __ push(Immediate(isolate()->factory()->undefined_value())); | 1307 __ push(Immediate(isolate()->factory()->undefined_value())); |
1308 __ push(Immediate(reinterpret_cast<int>(isolate()))); | 1308 __ push(Immediate(reinterpret_cast<int>(isolate()))); |
1309 __ push(reg); // holder | 1309 __ push(reg); // holder |
1310 | 1310 |
1311 // Save a pointer to where we pushed the arguments. This will be | 1311 // Save a pointer to where we pushed the arguments. This will be |
1312 // passed as the const PropertyAccessorInfo& to the C++ callback. | 1312 // passed as the const PropertyAccessorInfo& to the C++ callback. |
1313 __ push(esp); | 1313 __ push(esp); |
1314 | 1314 |
1315 __ push(name()); // name | 1315 __ push(name()); // name |
1316 __ mov(ebx, esp); // esp points to reference to name (handler). | |
1317 | 1316 |
1318 __ push(scratch3()); // Restore return address. | 1317 __ push(scratch3()); // Restore return address. |
1319 | 1318 |
1320 // array for v8::Arguments::values_, handler for name and pointer | 1319 // Abi for CallApiGetter |
1321 // to the values (it considered as smi in GC). | |
1322 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 2; | |
1323 // Allocate space for opional callback address parameter in case | |
1324 // CPU profiler is active. | |
1325 const int kApiArgc = 2 + 1; | |
1326 | |
1327 __ PrepareCallApiFunction(kApiArgc); | |
1328 __ mov(ApiParameterOperand(0), ebx); // name. | |
1329 __ add(ebx, Immediate(kPointerSize)); | |
1330 __ mov(ApiParameterOperand(1), ebx); // arguments pointer. | |
1331 | |
1332 // Emitting a stub call may try to allocate (if the code is not | |
1333 // already generated). Do not allow the assembler to perform a | |
1334 // garbage collection but instead return the allocation failure | |
1335 // object. | |
1336 | |
1337 Register getter_address = edx; | 1320 Register getter_address = edx; |
1338 Address function_address = v8::ToCData<Address>(callback->getter()); | 1321 Address function_address = v8::ToCData<Address>(callback->getter()); |
1339 __ mov(getter_address, Immediate(function_address)); | 1322 __ mov(getter_address, Immediate(function_address)); |
1340 | 1323 |
1341 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 1324 CallApiGetterStub stub; |
1342 | 1325 __ TailCallStub(&stub); |
1343 __ CallApiFunctionAndReturn(getter_address, | |
1344 thunk_address, | |
1345 ApiParameterOperand(2), | |
1346 kStackSpace, | |
1347 Operand(ebp, 7 * kPointerSize), | |
1348 NULL); | |
1349 } | 1326 } |
1350 | 1327 |
1351 | 1328 |
1352 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { | 1329 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { |
1353 // Return the constant value. | 1330 // Return the constant value. |
1354 __ LoadObject(eax, value); | 1331 __ LoadObject(eax, value); |
1355 __ ret(0); | 1332 __ ret(0); |
1356 } | 1333 } |
1357 | 1334 |
1358 | 1335 |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 // ----------------------------------- | 2080 // ----------------------------------- |
2104 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2081 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2105 } | 2082 } |
2106 | 2083 |
2107 | 2084 |
2108 #undef __ | 2085 #undef __ |
2109 | 2086 |
2110 } } // namespace v8::internal | 2087 } } // namespace v8::internal |
2111 | 2088 |
2112 #endif // V8_TARGET_ARCH_IA32 | 2089 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |