| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 StubCache::kInterceptorArgsLength); | 743 StubCache::kInterceptorArgsLength); |
| 744 } | 744 } |
| 745 | 745 |
| 746 | 746 |
| 747 // Generate call to api function. | 747 // Generate call to api function. |
| 748 static void GenerateFastApiCall(MacroAssembler* masm, | 748 static void GenerateFastApiCall(MacroAssembler* masm, |
| 749 const CallOptimization& optimization, | 749 const CallOptimization& optimization, |
| 750 Handle<Map> receiver_map, | 750 Handle<Map> receiver_map, |
| 751 Register receiver, | 751 Register receiver, |
| 752 Register scratch, | 752 Register scratch, |
| 753 bool is_store, |
| 753 int argc, | 754 int argc, |
| 754 Register* values) { | 755 Register* values) { |
| 755 ASSERT(!AreAliased(receiver, scratch)); | 756 ASSERT(!AreAliased(receiver, scratch)); |
| 756 __ Push(receiver); | 757 __ Push(receiver); |
| 757 // Write the arguments to stack frame. | 758 // Write the arguments to stack frame. |
| 758 for (int i = 0; i < argc; i++) { | 759 for (int i = 0; i < argc; i++) { |
| 759 // TODO(jbramley): Push these in as few Push() calls as possible. | 760 // TODO(jbramley): Push these in as few Push() calls as possible. |
| 760 Register arg = values[argc-1-i]; | 761 Register arg = values[argc-1-i]; |
| 761 ASSERT(!AreAliased(receiver, scratch, arg)); | 762 ASSERT(!AreAliased(receiver, scratch, arg)); |
| 762 __ Push(arg); | 763 __ Push(arg); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 | 809 |
| 809 // Put api_function_address in place. | 810 // Put api_function_address in place. |
| 810 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 811 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 811 ApiFunction fun(function_address); | 812 ApiFunction fun(function_address); |
| 812 ExternalReference ref = ExternalReference(&fun, | 813 ExternalReference ref = ExternalReference(&fun, |
| 813 ExternalReference::DIRECT_API_CALL, | 814 ExternalReference::DIRECT_API_CALL, |
| 814 masm->isolate()); | 815 masm->isolate()); |
| 815 __ Mov(api_function_address, Operand(ref)); | 816 __ Mov(api_function_address, Operand(ref)); |
| 816 | 817 |
| 817 // Jump to stub. | 818 // Jump to stub. |
| 818 CallApiFunctionStub stub(true, call_data_undefined, argc); | 819 CallApiFunctionStub stub(is_store, call_data_undefined, argc); |
| 819 __ TailCallStub(&stub); | 820 __ TailCallStub(&stub); |
| 820 } | 821 } |
| 821 | 822 |
| 822 | 823 |
| 823 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { | 824 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { |
| 824 __ Jump(code, RelocInfo::CODE_TARGET); | 825 __ Jump(code, RelocInfo::CODE_TARGET); |
| 825 } | 826 } |
| 826 | 827 |
| 827 | 828 |
| 828 #undef __ | 829 #undef __ |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 // Return the constant value. | 1041 // Return the constant value. |
| 1041 __ LoadObject(x0, value); | 1042 __ LoadObject(x0, value); |
| 1042 __ Ret(); | 1043 __ Ret(); |
| 1043 } | 1044 } |
| 1044 | 1045 |
| 1045 | 1046 |
| 1046 void LoadStubCompiler::GenerateLoadCallback( | 1047 void LoadStubCompiler::GenerateLoadCallback( |
| 1047 const CallOptimization& call_optimization, | 1048 const CallOptimization& call_optimization, |
| 1048 Handle<Map> receiver_map) { | 1049 Handle<Map> receiver_map) { |
| 1049 GenerateFastApiCall( | 1050 GenerateFastApiCall( |
| 1050 masm(), call_optimization, receiver_map, receiver(), scratch3(), 0, NULL); | 1051 masm(), call_optimization, receiver_map, |
| 1052 receiver(), scratch3(), false, 0, NULL); |
| 1051 } | 1053 } |
| 1052 | 1054 |
| 1053 | 1055 |
| 1054 void LoadStubCompiler::GenerateLoadCallback( | 1056 void LoadStubCompiler::GenerateLoadCallback( |
| 1055 Register reg, | 1057 Register reg, |
| 1056 Handle<ExecutableAccessorInfo> callback) { | 1058 Handle<ExecutableAccessorInfo> callback) { |
| 1057 ASSERT(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); | 1059 ASSERT(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); |
| 1058 | 1060 |
| 1059 // Build ExecutableAccessorInfo::args_ list on the stack and push property | 1061 // Build ExecutableAccessorInfo::args_ list on the stack and push property |
| 1060 // name below the exit frame to make GC aware of them and store pointers to | 1062 // name below the exit frame to make GC aware of them and store pointers to |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 1535 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 1534 Handle<JSObject> object, | 1536 Handle<JSObject> object, |
| 1535 Handle<JSObject> holder, | 1537 Handle<JSObject> holder, |
| 1536 Handle<Name> name, | 1538 Handle<Name> name, |
| 1537 const CallOptimization& call_optimization) { | 1539 const CallOptimization& call_optimization) { |
| 1538 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), | 1540 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 1539 receiver(), holder, name); | 1541 receiver(), holder, name); |
| 1540 | 1542 |
| 1541 Register values[] = { value() }; | 1543 Register values[] = { value() }; |
| 1542 GenerateFastApiCall(masm(), call_optimization, handle(object->map()), | 1544 GenerateFastApiCall(masm(), call_optimization, handle(object->map()), |
| 1543 receiver(), scratch3(), 1, values); | 1545 receiver(), scratch3(), true, 1, values); |
| 1544 | 1546 |
| 1545 // Return the generated code. | 1547 // Return the generated code. |
| 1546 return GetCode(kind(), Code::FAST, name); | 1548 return GetCode(kind(), Code::FAST, name); |
| 1547 } | 1549 } |
| 1548 | 1550 |
| 1549 | 1551 |
| 1550 #undef __ | 1552 #undef __ |
| 1551 #define __ ACCESS_MASM(masm) | 1553 #define __ ACCESS_MASM(masm) |
| 1552 | 1554 |
| 1553 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( | 1555 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1575 | 1577 |
| 1576 // Miss case, call the runtime. | 1578 // Miss case, call the runtime. |
| 1577 __ Bind(&miss); | 1579 __ Bind(&miss); |
| 1578 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1580 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1579 } | 1581 } |
| 1580 | 1582 |
| 1581 | 1583 |
| 1582 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
| 1583 | 1585 |
| 1584 #endif // V8_TARGET_ARCH_A64 | 1586 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |