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

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

Issue 14429003: Refactor ExternalReference::isolate_address() to not rely on Isolate::Current(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 Register name, 708 Register name,
709 Handle<JSObject> holder_obj) { 709 Handle<JSObject> holder_obj) {
710 __ push(name); 710 __ push(name);
711 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); 711 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
712 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); 712 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
713 Register scratch = name; 713 Register scratch = name;
714 __ li(scratch, Operand(interceptor)); 714 __ li(scratch, Operand(interceptor));
715 __ Push(scratch, receiver, holder); 715 __ Push(scratch, receiver, holder);
716 __ lw(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); 716 __ lw(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset));
717 __ push(scratch); 717 __ push(scratch);
718 __ li(scratch, Operand(ExternalReference::isolate_address())); 718 __ li(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
719 __ push(scratch); 719 __ push(scratch);
720 } 720 }
721 721
722 722
723 static void CompileCallLoadPropertyWithInterceptor( 723 static void CompileCallLoadPropertyWithInterceptor(
724 MacroAssembler* masm, 724 MacroAssembler* masm,
725 Register receiver, 725 Register receiver,
726 Register holder, 726 Register holder,
727 Register name, 727 Register name,
728 Handle<JSObject> holder_obj) { 728 Handle<JSObject> holder_obj) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 // Pass the additional arguments. 782 // Pass the additional arguments.
783 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 783 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
784 Handle<Object> call_data(api_call_info->data(), masm->isolate()); 784 Handle<Object> call_data(api_call_info->data(), masm->isolate());
785 if (masm->isolate()->heap()->InNewSpace(*call_data)) { 785 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
786 __ li(a0, api_call_info); 786 __ li(a0, api_call_info);
787 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); 787 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset));
788 } else { 788 } else {
789 __ li(t2, call_data); 789 __ li(t2, call_data);
790 } 790 }
791 791
792 __ li(t3, Operand(ExternalReference::isolate_address())); 792 __ li(t3, Operand(ExternalReference::isolate_address(masm->isolate())));
793 // Store JS function, call data and isolate. 793 // Store JS function, call data and isolate.
794 __ sw(t1, MemOperand(sp, 1 * kPointerSize)); 794 __ sw(t1, MemOperand(sp, 1 * kPointerSize));
795 __ sw(t2, MemOperand(sp, 2 * kPointerSize)); 795 __ sw(t2, MemOperand(sp, 2 * kPointerSize));
796 __ sw(t3, MemOperand(sp, 3 * kPointerSize)); 796 __ sw(t3, MemOperand(sp, 3 * kPointerSize));
797 797
798 // Prepare arguments. 798 // Prepare arguments.
799 __ Addu(a2, sp, Operand(3 * kPointerSize)); 799 __ Addu(a2, sp, Operand(3 * kPointerSize));
800 800
801 // Allocate the v8::Arguments structure in the arguments' space since 801 // Allocate the v8::Arguments structure in the arguments' space since
802 // it's not controlled by GC. 802 // it's not controlled by GC.
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 Handle<ExecutableAccessorInfo> callback) { 1285 Handle<ExecutableAccessorInfo> callback) {
1286 // Build AccessorInfo::args_ list on the stack and push property name below 1286 // Build AccessorInfo::args_ list on the stack and push property name below
1287 // the exit frame to make GC aware of them and store pointers to them. 1287 // the exit frame to make GC aware of them and store pointers to them.
1288 __ push(receiver()); 1288 __ push(receiver());
1289 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_ 1289 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_
1290 if (heap()->InNewSpace(callback->data())) { 1290 if (heap()->InNewSpace(callback->data())) {
1291 __ li(scratch3(), callback); 1291 __ li(scratch3(), callback);
1292 __ lw(scratch3(), FieldMemOperand(scratch3(), 1292 __ lw(scratch3(), FieldMemOperand(scratch3(),
1293 ExecutableAccessorInfo::kDataOffset)); 1293 ExecutableAccessorInfo::kDataOffset));
1294 } else { 1294 } else {
1295 __ li(scratch3(), Handle<Object>(callback->data(), 1295 __ li(scratch3(), Handle<Object>(callback->data(), masm()->isolate()));
1296 callback->GetIsolate()));
1297 } 1296 }
1298 __ Subu(sp, sp, 4 * kPointerSize); 1297 __ Subu(sp, sp, 4 * kPointerSize);
1299 __ sw(reg, MemOperand(sp, 3 * kPointerSize)); 1298 __ sw(reg, MemOperand(sp, 3 * kPointerSize));
1300 __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize)); 1299 __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize));
1301 __ li(scratch3(), Operand(ExternalReference::isolate_address())); 1300 __ li(scratch3(),
1301 Operand(ExternalReference::isolate_address(masm()->isolate())));
1302 __ sw(scratch3(), MemOperand(sp, 1 * kPointerSize)); 1302 __ sw(scratch3(), MemOperand(sp, 1 * kPointerSize));
1303 __ sw(name(), MemOperand(sp, 0 * kPointerSize)); 1303 __ sw(name(), MemOperand(sp, 0 * kPointerSize));
1304 1304
1305 __ mov(a2, scratch2()); // Saved in case scratch2 == a1. 1305 __ mov(a2, scratch2()); // Saved in case scratch2 == a1.
1306 __ mov(a1, sp); // a1 (first argument - see note below) = Handle<Name> 1306 __ mov(a1, sp); // a1 (first argument - see note below) = Handle<Name>
1307 1307
1308 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a 1308 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a
1309 // struct from the function (which is currently the case). This means we pass 1309 // struct from the function (which is currently the case). This means we pass
1310 // the arguments in a1-a2 instead of a0-a1. TryCallApiFunctionAndReturn 1310 // the arguments in a1-a2 instead of a0-a1. TryCallApiFunctionAndReturn
1311 // will handle setting up a0. 1311 // will handle setting up a0.
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3745 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3746 } 3746 }
3747 } 3747 }
3748 3748
3749 3749
3750 #undef __ 3750 #undef __
3751 3751
3752 } } // namespace v8::internal 3752 } } // namespace v8::internal
3753 3753
3754 #endif // V8_TARGET_ARCH_MIPS 3754 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698