Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 150213003: stub api getters (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 ASSERT(!kScratchRegister.is(reg)); 1211 ASSERT(!kScratchRegister.is(reg));
1212 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); 1212 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
1213 __ push(kScratchRegister); // return value 1213 __ push(kScratchRegister); // return value
1214 __ push(kScratchRegister); // return value default 1214 __ push(kScratchRegister); // return value default
1215 __ PushAddress(ExternalReference::isolate_address(isolate())); 1215 __ PushAddress(ExternalReference::isolate_address(isolate()));
1216 __ push(reg); // holder 1216 __ push(reg); // holder
1217 __ push(name()); // name 1217 __ push(name()); // name
1218 // Save a pointer to where we pushed the arguments pointer. This will be 1218 // Save a pointer to where we pushed the arguments pointer. This will be
1219 // passed as the const PropertyAccessorInfo& to the C++ callback. 1219 // passed as the const PropertyAccessorInfo& to the C++ callback.
1220 1220
1221 Address getter_address = v8::ToCData<Address>(callback->getter());
1222
1223 #if defined(__MINGW64__) || defined(_WIN64)
1224 Register getter_arg = r8;
1225 Register accessor_info_arg = rdx;
1226 Register name_arg = rcx;
1227 #else
1228 Register getter_arg = rdx;
1229 Register accessor_info_arg = rsi;
1230 Register name_arg = rdi;
1231 #endif
1232
1233 ASSERT(!name_arg.is(scratch4()));
1234 __ movp(name_arg, rsp);
1235 __ PushReturnAddressFrom(scratch4()); 1221 __ PushReturnAddressFrom(scratch4());
1236 1222
1237 // v8::Arguments::values_ and handler for name. 1223 // Abi for CallApiGetter
1238 const int kStackSpace = PropertyCallbackArguments::kArgsLength + 1;
1239
1240 // Allocate v8::AccessorInfo in non-GCed stack space.
1241 const int kArgStackSpace = 1;
1242
1243 __ PrepareCallApiFunction(kArgStackSpace);
1244 __ lea(rax, Operand(name_arg, 1 * kPointerSize));
1245
1246 // v8::PropertyAccessorInfo::args_.
1247 __ movp(StackSpaceOperand(0), rax);
1248
1249 // The context register (rsi) has been saved in PrepareCallApiFunction and
1250 // could be used to pass arguments.
1251 __ lea(accessor_info_arg, StackSpaceOperand(0));
1252
1253 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1254
1255 Register api_function_address = r8; 1224 Register api_function_address = r8;
1256 // It's okay if api_function_address == getter_arg 1225 Address getter_address = v8::ToCData<Address>(callback->getter());
1257 // but not accessor_info_arg or name_arg
1258 ASSERT(!api_function_address.is(accessor_info_arg) &&
1259 !api_function_address.is(name_arg));
1260
1261 __ Move(api_function_address, getter_address, RelocInfo::EXTERNAL_REFERENCE); 1226 __ Move(api_function_address, getter_address, RelocInfo::EXTERNAL_REFERENCE);
1262 1227
1263 // The name handler is counted as an argument. 1228 CallApiGetterStub stub;
1264 StackArgumentsAccessor args(rbp, PropertyCallbackArguments::kArgsLength); 1229 __ TailCallStub(&stub);
1265 Operand return_value_operand = args.GetArgumentOperand(
1266 PropertyCallbackArguments::kArgsLength - 1 -
1267 PropertyCallbackArguments::kReturnValueOffset);
1268 __ CallApiFunctionAndReturn(api_function_address,
1269 thunk_address,
1270 getter_arg,
1271 kStackSpace,
1272 return_value_operand,
1273 NULL);
1274 } 1230 }
1275 1231
1276 1232
1277 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { 1233 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1278 // Return the constant value. 1234 // Return the constant value.
1279 __ Move(rax, value); 1235 __ Move(rax, value);
1280 __ ret(0); 1236 __ ret(0);
1281 } 1237 }
1282 1238
1283 1239
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 // ----------------------------------- 1978 // -----------------------------------
2023 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1979 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2024 } 1980 }
2025 1981
2026 1982
2027 #undef __ 1983 #undef __
2028 1984
2029 } } // namespace v8::internal 1985 } } // namespace v8::internal
2030 1986
2031 #endif // V8_TARGET_ARCH_X64 1987 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698