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

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

Issue 23984002: load ics for js api accessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « src/stub-cache.cc ('k') | test/cctest/test-accessors.cc » ('j') | 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 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } else { 1269 } else {
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 const CallOptimization& call_optimization) {
1280 ASSERT(call_optimization.is_simple_api_call());
1281
1282 // Copy return value.
1283 __ movq(scratch3(), Operand(rsp, 0));
1284 // Assign stack space for the call arguments.
1285 __ subq(rsp, Immediate((kFastApiCallArguments + 1) * kPointerSize));
1286 // Move the return address on top of the stack.
1287 __ movq(Operand(rsp, 0), scratch3());
1288
1289 int argc = 0;
1290 int api_call_argc = argc + kFastApiCallArguments;
1291 StackArgumentsAccessor args(rsp, api_call_argc);
1292 // Write holder to stack frame.
1293 __ movq(args.GetArgumentOperand(api_call_argc), receiver());
1294 // Write receiver to stack frame.
1295 __ movq(args.GetArgumentOperand(api_call_argc - 6), receiver());
1296
1297 GenerateFastApiCall(masm(), call_optimization, argc);
1298 }
1299
1300
1301 void BaseLoadStubCompiler::GenerateLoadCallback(
1279 Register reg, 1302 Register reg,
1280 Handle<ExecutableAccessorInfo> callback) { 1303 Handle<ExecutableAccessorInfo> callback) {
1281 // Insert additional parameters into the stack frame above return address. 1304 // Insert additional parameters into the stack frame above return address.
1282 ASSERT(!scratch4().is(reg)); 1305 ASSERT(!scratch4().is(reg));
1283 __ PopReturnAddressTo(scratch4()); 1306 __ PopReturnAddressTo(scratch4());
1284 1307
1285 __ push(receiver()); // receiver 1308 __ push(receiver()); // receiver
1286 __ push(reg); // holder 1309 __ push(reg); // holder
1287 if (heap()->InNewSpace(callback->data())) { 1310 if (heap()->InNewSpace(callback->data())) {
1288 __ Move(scratch1(), callback); 1311 __ Move(scratch1(), callback);
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
3141 // ----------------------------------- 3164 // -----------------------------------
3142 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3165 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3143 } 3166 }
3144 3167
3145 3168
3146 #undef __ 3169 #undef __
3147 3170
3148 } } // namespace v8::internal 3171 } } // namespace v8::internal
3149 3172
3150 #endif // V8_TARGET_ARCH_X64 3173 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « 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