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

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

Issue 148383017: MIPS: stub api getters. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Fixed typo. 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
« no previous file with comments | « src/mips/code-stubs-mips.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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize)); 1306 __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize));
1307 __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize)); 1307 __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize));
1308 __ li(scratch4(), 1308 __ li(scratch4(),
1309 Operand(ExternalReference::isolate_address(isolate()))); 1309 Operand(ExternalReference::isolate_address(isolate())));
1310 __ sw(scratch4(), MemOperand(sp, 2 * kPointerSize)); 1310 __ sw(scratch4(), MemOperand(sp, 2 * kPointerSize));
1311 __ sw(reg, MemOperand(sp, 1 * kPointerSize)); 1311 __ sw(reg, MemOperand(sp, 1 * kPointerSize));
1312 __ sw(name(), MemOperand(sp, 0 * kPointerSize)); 1312 __ sw(name(), MemOperand(sp, 0 * kPointerSize));
1313 __ Addu(scratch2(), sp, 1 * kPointerSize); 1313 __ Addu(scratch2(), sp, 1 * kPointerSize);
1314 1314
1315 __ mov(a2, scratch2()); // Saved in case scratch2 == a1. 1315 __ mov(a2, scratch2()); // Saved in case scratch2 == a1.
1316 __ mov(a0, sp); // (first argument - a0) = Handle<Name> 1316 // Abi for CallApiGetter.
1317 Register getter_address_reg = a3;
1318 Register thunk_last_arg = a2;
1317 1319
1318 const int kApiStackSpace = 1;
1319 FrameScope frame_scope(masm(), StackFrame::MANUAL);
1320 __ EnterExitFrame(false, kApiStackSpace);
1321
1322 // Create PropertyAccessorInfo instance on the stack above the exit frame with
1323 // scratch2 (internal::Object** args_) as the data.
1324 __ sw(a2, MemOperand(sp, kPointerSize));
1325 // (second argument - a1) = AccessorInfo&
1326 __ Addu(a1, sp, kPointerSize);
1327
1328 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
1329 Address getter_address = v8::ToCData<Address>(callback->getter()); 1320 Address getter_address = v8::ToCData<Address>(callback->getter());
1330 ApiFunction fun(getter_address); 1321 ApiFunction fun(getter_address);
1331 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; 1322 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL;
1332 ExternalReference ref = ExternalReference(&fun, type, isolate()); 1323 ExternalReference ref = ExternalReference(&fun, type, isolate());
1333 Register getter_address_reg = a3;
1334 Register thunk_last_arg = a2;
1335 __ li(getter_address_reg, Operand(ref)); 1324 __ li(getter_address_reg, Operand(ref));
1336 __ li(thunk_last_arg, Operand(reinterpret_cast<int32_t>(getter_address))); 1325 __ li(thunk_last_arg, Operand(reinterpret_cast<int32_t>(getter_address)));
1337 1326
1338 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); 1327 CallApiGetterStub stub;
1339 ExternalReference::Type thunk_type = 1328 __ TailCallStub(&stub);
1340 ExternalReference::PROFILING_GETTER_CALL;
1341 ApiFunction thunk_fun(thunk_address);
1342 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
1343 isolate());
1344 __ CallApiFunctionAndReturn(getter_address_reg,
1345 thunk_ref,
1346 thunk_last_arg,
1347 kStackUnwindSpace,
1348 MemOperand(fp, 6 * kPointerSize),
1349 NULL);
1350 } 1329 }
1351 1330
1352 1331
1353 void LoadStubCompiler::GenerateLoadInterceptor( 1332 void LoadStubCompiler::GenerateLoadInterceptor(
1354 Register holder_reg, 1333 Register holder_reg,
1355 Handle<Object> object, 1334 Handle<Object> object,
1356 Handle<JSObject> interceptor_holder, 1335 Handle<JSObject> interceptor_holder,
1357 LookupResult* lookup, 1336 LookupResult* lookup,
1358 Handle<Name> name) { 1337 Handle<Name> name) {
1359 ASSERT(interceptor_holder->HasNamedInterceptor()); 1338 ASSERT(interceptor_holder->HasNamedInterceptor());
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 // ----------------------------------- 2083 // -----------------------------------
2105 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 2084 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2106 } 2085 }
2107 2086
2108 2087
2109 #undef __ 2088 #undef __
2110 2089
2111 } } // namespace v8::internal 2090 } } // namespace v8::internal
2112 2091
2113 #endif // V8_TARGET_ARCH_MIPS 2092 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698