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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 Register receiver, | 784 Register receiver, |
785 Register holder, | 785 Register holder, |
786 Register name, | 786 Register name, |
787 Handle<JSObject> holder_obj) { | 787 Handle<JSObject> holder_obj) { |
788 __ push(name); | 788 __ push(name); |
789 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); | 789 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); |
790 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); | 790 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); |
791 Register scratch = name; | 791 Register scratch = name; |
792 __ mov(scratch, Operand(interceptor)); | 792 __ mov(scratch, Operand(interceptor)); |
793 __ push(scratch); | 793 __ push(scratch); |
| 794 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0); |
| 795 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1); |
| 796 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4); |
| 797 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5); |
794 __ push(receiver); | 798 __ push(receiver); |
795 __ push(holder); | |
796 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); | 799 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); |
797 __ push(scratch); | 800 __ push(scratch); |
798 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); | 801 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); |
799 __ push(scratch); | 802 __ push(scratch); |
| 803 __ push(holder); |
800 } | 804 } |
801 | 805 |
802 | 806 |
803 static void CompileCallLoadPropertyWithInterceptor( | 807 static void CompileCallLoadPropertyWithInterceptor( |
804 MacroAssembler* masm, | 808 MacroAssembler* masm, |
805 Register receiver, | 809 Register receiver, |
806 Register holder, | 810 Register holder, |
807 Register name, | 811 Register name, |
808 Handle<JSObject> holder_obj) { | 812 Handle<JSObject> holder_obj) { |
809 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 813 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 GenerateFastApiCall( | 1417 GenerateFastApiCall( |
1414 masm(), call_optimization, receiver(), scratch3(), 0, NULL); | 1418 masm(), call_optimization, receiver(), scratch3(), 0, NULL); |
1415 } | 1419 } |
1416 | 1420 |
1417 | 1421 |
1418 void BaseLoadStubCompiler::GenerateLoadCallback( | 1422 void BaseLoadStubCompiler::GenerateLoadCallback( |
1419 Register reg, | 1423 Register reg, |
1420 Handle<ExecutableAccessorInfo> callback) { | 1424 Handle<ExecutableAccessorInfo> callback) { |
1421 // Build AccessorInfo::args_ list on the stack and push property name below | 1425 // Build AccessorInfo::args_ list on the stack and push property name below |
1422 // the exit frame to make GC aware of them and store pointers to them. | 1426 // the exit frame to make GC aware of them and store pointers to them. |
| 1427 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0); |
| 1428 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1); |
| 1429 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == -2); |
| 1430 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == -3); |
| 1431 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4); |
| 1432 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5); |
1423 __ push(receiver()); | 1433 __ push(receiver()); |
1424 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_ | 1434 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_ |
1425 if (heap()->InNewSpace(callback->data())) { | 1435 if (heap()->InNewSpace(callback->data())) { |
1426 __ Move(scratch3(), callback); | 1436 __ Move(scratch3(), callback); |
1427 __ ldr(scratch3(), FieldMemOperand(scratch3(), | 1437 __ ldr(scratch3(), FieldMemOperand(scratch3(), |
1428 ExecutableAccessorInfo::kDataOffset)); | 1438 ExecutableAccessorInfo::kDataOffset)); |
1429 } else { | 1439 } else { |
1430 __ Move(scratch3(), Handle<Object>(callback->data(), isolate())); | 1440 __ Move(scratch3(), Handle<Object>(callback->data(), isolate())); |
1431 } | 1441 } |
1432 __ Push(reg, scratch3()); | 1442 __ push(scratch3()); |
1433 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); | 1443 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); |
1434 __ mov(scratch4(), scratch3()); | 1444 __ mov(scratch4(), scratch3()); |
1435 __ Push(scratch3(), scratch4()); | 1445 __ Push(scratch3(), scratch4()); |
1436 __ mov(scratch4(), | 1446 __ mov(scratch4(), |
1437 Operand(ExternalReference::isolate_address(isolate()))); | 1447 Operand(ExternalReference::isolate_address(isolate()))); |
1438 __ Push(scratch4(), name()); | 1448 |
| 1449 __ Push(scratch4(), reg); |
| 1450 __ push(name()); |
1439 __ mov(r0, sp); // r0 = Handle<Name> | 1451 __ mov(r0, sp); // r0 = Handle<Name> |
1440 | 1452 |
1441 const int kApiStackSpace = 1; | 1453 const int kApiStackSpace = 1; |
1442 FrameScope frame_scope(masm(), StackFrame::MANUAL); | 1454 FrameScope frame_scope(masm(), StackFrame::MANUAL); |
1443 __ EnterExitFrame(false, kApiStackSpace); | 1455 __ EnterExitFrame(false, kApiStackSpace); |
1444 | 1456 |
1445 // Create AccessorInfo instance on the stack above the exit frame with | 1457 // Create AccessorInfo instance on the stack above the exit frame with |
1446 // scratch2 (internal::Object** args_) as the data. | 1458 // scratch2 (internal::Object** args_) as the data. |
1447 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); | 1459 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); |
1448 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& | 1460 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& |
1449 | 1461 |
1450 const int kStackUnwindSpace = kFastApiCallArguments + 1; | 1462 const int kStackUnwindSpace = kFastApiCallArguments + 1; |
1451 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1463 Address getter_address = v8::ToCData<Address>(callback->getter()); |
1452 | 1464 |
1453 ApiFunction fun(getter_address); | 1465 ApiFunction fun(getter_address); |
1454 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; | 1466 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; |
1455 ExternalReference ref = ExternalReference(&fun, type, isolate()); | 1467 ExternalReference ref = ExternalReference(&fun, type, isolate()); |
1456 | 1468 |
1457 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 1469 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
1458 ExternalReference::Type thunk_type = | 1470 ExternalReference::Type thunk_type = |
1459 ExternalReference::PROFILING_GETTER_CALL; | 1471 ExternalReference::PROFILING_GETTER_CALL; |
1460 ApiFunction thunk_fun(thunk_address); | 1472 ApiFunction thunk_fun(thunk_address); |
1461 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, | 1473 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
1462 isolate()); | 1474 isolate()); |
1463 __ CallApiFunctionAndReturn(ref, | 1475 __ CallApiFunctionAndReturn(ref, |
1464 getter_address, | 1476 getter_address, |
1465 thunk_ref, | 1477 thunk_ref, |
1466 r2, | 1478 r2, |
1467 kStackUnwindSpace, | 1479 kStackUnwindSpace, |
1468 5); | 1480 6); |
1469 } | 1481 } |
1470 | 1482 |
1471 | 1483 |
1472 void BaseLoadStubCompiler::GenerateLoadInterceptor( | 1484 void BaseLoadStubCompiler::GenerateLoadInterceptor( |
1473 Register holder_reg, | 1485 Register holder_reg, |
1474 Handle<JSObject> object, | 1486 Handle<JSObject> object, |
1475 Handle<JSObject> interceptor_holder, | 1487 Handle<JSObject> interceptor_holder, |
1476 LookupResult* lookup, | 1488 LookupResult* lookup, |
1477 Handle<Name> name) { | 1489 Handle<Name> name) { |
1478 ASSERT(interceptor_holder->HasNamedInterceptor()); | 1490 ASSERT(interceptor_holder->HasNamedInterceptor()); |
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 // ----------------------------------- | 3218 // ----------------------------------- |
3207 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3219 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3208 } | 3220 } |
3209 | 3221 |
3210 | 3222 |
3211 #undef __ | 3223 #undef __ |
3212 | 3224 |
3213 } } // namespace v8::internal | 3225 } } // namespace v8::internal |
3214 | 3226 |
3215 #endif // V8_TARGET_ARCH_ARM | 3227 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |