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

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

Issue 23699002: load ics for js api accessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: as discussed Created 7 years, 3 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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 } 1184 }
1185 } 1185 }
1186 1186
1187 1187
1188 Register BaseLoadStubCompiler::CallbackHandlerFrontend( 1188 Register BaseLoadStubCompiler::CallbackHandlerFrontend(
1189 Handle<JSObject> object, 1189 Handle<JSObject> object,
1190 Register object_reg, 1190 Register object_reg,
1191 Handle<JSObject> holder, 1191 Handle<JSObject> holder,
1192 Handle<Name> name, 1192 Handle<Name> name,
1193 Label* success, 1193 Label* success,
1194 Handle<ExecutableAccessorInfo> callback) { 1194 Handle<Object> callback) {
1195 Label miss; 1195 Label miss;
1196 1196
1197 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); 1197 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss);
1198 1198
1199 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { 1199 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
1200 ASSERT(!reg.is(scratch2())); 1200 ASSERT(!reg.is(scratch2()));
1201 ASSERT(!reg.is(scratch3())); 1201 ASSERT(!reg.is(scratch3()));
1202 ASSERT(!reg.is(scratch4())); 1202 ASSERT(!reg.is(scratch4()));
1203 1203
1204 // Load the properties dictionary. 1204 // Load the properties dictionary.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 KeyedLoadFieldStub stub(field.is_inobject(holder), 1270 KeyedLoadFieldStub stub(field.is_inobject(holder),
1271 field.translate(holder), 1271 field.translate(holder),
1272 representation); 1272 representation);
1273 GenerateTailCall(masm(), stub.GetCode(isolate())); 1273 GenerateTailCall(masm(), stub.GetCode(isolate()));
1274 } 1274 }
1275 } 1275 }
1276 1276
1277 1277
1278 void BaseLoadStubCompiler::GenerateLoadCallback( 1278 void BaseLoadStubCompiler::GenerateLoadCallback(
1279 Register reg, 1279 Register reg,
1280 const CallOptimization& call_optimization) {
1281 ASSERT(call_optimization.is_simple_api_call());
1282 ASSERT(!scratch3().is(reg));
1283 ASSERT(!receiver().is(reg));
1284
1285 // copy return value
1286 __ movq(scratch3(), StackSpaceOperand(0));
1287 // assign stack space for the call arguments
1288 __ subq(rsp, Immediate((kFastApiCallArguments + 1) * kPointerSize));
1289 // Move the return address on top of the stack.
1290 __ movq(StackOperandForReturnAddress(0), scratch3());
1291
1292 int argc = 0;
1293 int api_call_argc = argc + kFastApiCallArguments;
1294 StackArgumentsAccessor args(rsp, api_call_argc);
1295 // write holder to stack frame
1296 Register holder =
1297 call_optimization.expected_receiver_type().is_null() ?
1298 receiver() : reg;
1299 __ movq(args.GetArgumentOperand(api_call_argc), holder);
1300 // write receiver to stack frame
1301 __ movq(args.GetArgumentOperand(api_call_argc - (argc + 6)), receiver());
1302
1303 GenerateFastApiCall(masm(), call_optimization, argc);
1304 }
1305
1306
1307 void BaseLoadStubCompiler::GenerateLoadCallback(
1308 Register reg,
1280 Handle<ExecutableAccessorInfo> callback) { 1309 Handle<ExecutableAccessorInfo> callback) {
1281 // Insert additional parameters into the stack frame above return address. 1310 // Insert additional parameters into the stack frame above return address.
1282 ASSERT(!scratch4().is(reg)); 1311 ASSERT(!scratch4().is(reg));
1283 __ PopReturnAddressTo(scratch4()); 1312 __ PopReturnAddressTo(scratch4());
1284 1313
1285 __ push(receiver()); // receiver 1314 __ push(receiver()); // receiver
1286 __ push(reg); // holder 1315 __ push(reg); // holder
1287 if (heap()->InNewSpace(callback->data())) { 1316 if (heap()->InNewSpace(callback->data())) {
1288 __ Move(scratch1(), callback); 1317 __ Move(scratch1(), callback);
1289 __ push(FieldOperand(scratch1(), 1318 __ push(FieldOperand(scratch1(),
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
3141 // ----------------------------------- 3170 // -----------------------------------
3142 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3171 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3143 } 3172 }
3144 3173
3145 3174
3146 #undef __ 3175 #undef __
3147 3176
3148 } } // namespace v8::internal 3177 } } // namespace v8::internal
3149 3178
3150 #endif // V8_TARGET_ARCH_X64 3179 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ic.cc ('K') | « src/stub-cache.cc ('k') | test/cctest/test-accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698