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

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

Issue 10081009: Add PushAddress(ExternalReference) for X64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment by Erik Corry. Created 8 years, 8 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/macro-assembler-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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 Register name, 372 Register name,
373 Handle<JSObject> holder_obj) { 373 Handle<JSObject> holder_obj) {
374 __ push(name); 374 __ push(name);
375 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); 375 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
376 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); 376 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
377 __ Move(kScratchRegister, interceptor); 377 __ Move(kScratchRegister, interceptor);
378 __ push(kScratchRegister); 378 __ push(kScratchRegister);
379 __ push(receiver); 379 __ push(receiver);
380 __ push(holder); 380 __ push(holder);
381 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset)); 381 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset));
382 __ movq(kScratchRegister, ExternalReference::isolate_address()); 382 __ PushAddress(ExternalReference::isolate_address());
383 __ push(kScratchRegister);
384 } 383 }
385 384
386 385
387 static void CompileCallLoadPropertyWithInterceptor( 386 static void CompileCallLoadPropertyWithInterceptor(
388 MacroAssembler* masm, 387 MacroAssembler* masm,
389 Register receiver, 388 Register receiver,
390 Register holder, 389 Register holder,
391 Register name, 390 Register name,
392 Handle<JSObject> holder_obj) { 391 Handle<JSObject> holder_obj) {
393 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 392 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 __ pop(scratch2); // Get return address to place it below. 1002 __ pop(scratch2); // Get return address to place it below.
1004 1003
1005 __ push(receiver); // receiver 1004 __ push(receiver); // receiver
1006 __ push(reg); // holder 1005 __ push(reg); // holder
1007 if (heap()->InNewSpace(callback->data())) { 1006 if (heap()->InNewSpace(callback->data())) {
1008 __ Move(scratch1, callback); 1007 __ Move(scratch1, callback);
1009 __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset)); // data 1008 __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset)); // data
1010 } else { 1009 } else {
1011 __ Push(Handle<Object>(callback->data())); 1010 __ Push(Handle<Object>(callback->data()));
1012 } 1011 }
1013 __ movq(kScratchRegister, ExternalReference::isolate_address()); 1012 __ PushAddress(ExternalReference::isolate_address()); // isolate
1014 __ push(kScratchRegister); // isolate
1015 __ push(name_reg); // name 1013 __ push(name_reg); // name
1016 // Save a pointer to where we pushed the arguments pointer. 1014 // Save a pointer to where we pushed the arguments pointer.
1017 // This will be passed as the const AccessorInfo& to the C++ callback. 1015 // This will be passed as the const AccessorInfo& to the C++ callback.
1018 1016
1019 #ifdef _WIN64 1017 #ifdef _WIN64
1020 // Win64 uses first register--rcx--for returned value. 1018 // Win64 uses first register--rcx--for returned value.
1021 Register accessor_info_arg = r8; 1019 Register accessor_info_arg = r8;
1022 Register name_arg = rdx; 1020 Register name_arg = rdx;
1023 #else 1021 #else
1024 Register accessor_info_arg = rsi; 1022 Register accessor_info_arg = rsi;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 ASSERT(callback->getter() != NULL); 1177 ASSERT(callback->getter() != NULL);
1180 1178
1181 // Tail call to runtime. 1179 // Tail call to runtime.
1182 // Important invariant in CALLBACKS case: the code above must be 1180 // Important invariant in CALLBACKS case: the code above must be
1183 // structured to never clobber |receiver| register. 1181 // structured to never clobber |receiver| register.
1184 __ pop(scratch2); // return address 1182 __ pop(scratch2); // return address
1185 __ push(receiver); 1183 __ push(receiver);
1186 __ push(holder_reg); 1184 __ push(holder_reg);
1187 __ Move(holder_reg, callback); 1185 __ Move(holder_reg, callback);
1188 __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset)); 1186 __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
1189 __ movq(kScratchRegister, ExternalReference::isolate_address()); 1187 __ PushAddress(ExternalReference::isolate_address());
1190 __ push(kScratchRegister);
1191 __ push(holder_reg); 1188 __ push(holder_reg);
1192 __ push(name_reg); 1189 __ push(name_reg);
1193 __ push(scratch2); // restore return address 1190 __ push(scratch2); // restore return address
1194 1191
1195 ExternalReference ref = 1192 ExternalReference ref =
1196 ExternalReference(IC_Utility(IC::kLoadCallbackProperty), 1193 ExternalReference(IC_Utility(IC::kLoadCallbackProperty),
1197 isolate()); 1194 isolate());
1198 __ TailCallExternalReference(ref, 6, 1); 1195 __ TailCallExternalReference(ref, 6, 1);
1199 } 1196 }
1200 } else { // !compile_followup_inline 1197 } else { // !compile_followup_inline
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3823 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 3820 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3824 } 3821 }
3825 } 3822 }
3826 3823
3827 3824
3828 #undef __ 3825 #undef __
3829 3826
3830 } } // namespace v8::internal 3827 } } // namespace v8::internal
3831 3828
3832 #endif // V8_TARGET_ARCH_X64 3829 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698