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

Side by Side Diff: src/ia32/stub-cache-ia32.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
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')
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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 } 1254 }
1255 } 1255 }
1256 1256
1257 1257
1258 Register BaseLoadStubCompiler::CallbackHandlerFrontend( 1258 Register BaseLoadStubCompiler::CallbackHandlerFrontend(
1259 Handle<JSObject> object, 1259 Handle<JSObject> object,
1260 Register object_reg, 1260 Register object_reg,
1261 Handle<JSObject> holder, 1261 Handle<JSObject> holder,
1262 Handle<Name> name, 1262 Handle<Name> name,
1263 Label* success, 1263 Label* success,
1264 Handle<ExecutableAccessorInfo> callback) { 1264 Handle<Object> callback) {
1265 Label miss; 1265 Label miss;
1266 1266
1267 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); 1267 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss);
1268 1268
1269 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { 1269 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
1270 ASSERT(!reg.is(scratch2())); 1270 ASSERT(!reg.is(scratch2()));
1271 ASSERT(!reg.is(scratch3())); 1271 ASSERT(!reg.is(scratch3()));
1272 Register dictionary = scratch1(); 1272 Register dictionary = scratch1();
1273 bool must_preserve_dictionary_reg = reg.is(dictionary); 1273 bool must_preserve_dictionary_reg = reg.is(dictionary);
1274 1274
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 KeyedLoadFieldStub stub(field.is_inobject(holder), 1349 KeyedLoadFieldStub stub(field.is_inobject(holder),
1350 field.translate(holder), 1350 field.translate(holder),
1351 representation); 1351 representation);
1352 GenerateTailCall(masm(), stub.GetCode(isolate())); 1352 GenerateTailCall(masm(), stub.GetCode(isolate()));
1353 } 1353 }
1354 } 1354 }
1355 1355
1356 1356
1357 void BaseLoadStubCompiler::GenerateLoadCallback( 1357 void BaseLoadStubCompiler::GenerateLoadCallback(
1358 Register reg, 1358 Register reg,
1359 const CallOptimization& call_optimization) {
1360 ASSERT(call_optimization.is_simple_api_call());
1361 ASSERT(!scratch3().is(reg));
1362 ASSERT(!receiver().is(reg));
1363
1364 // copy return value
1365 __ mov(scratch3(), Operand(esp, 0));
1366 // assign stack space for the call arguments
Michael Starzinger 2013/09/04 16:32:31 nit: Capitalize and punctuate comments.
1367 __ sub(esp, Immediate((kFastApiCallArguments + 1) * kPointerSize));
1368 // Move the return address on top of the stack.
1369 __ mov(Operand(esp, 0), scratch3());
1370
1371 int argc = 0;
1372 int api_call_argc = argc + kFastApiCallArguments;
1373 // write holder to stack frame
1374 Register holder =
1375 call_optimization.expected_receiver_type().is_null() ?
Michael Starzinger 2013/09/04 16:32:31 We should just always use receiver() here, because
1376 receiver() : reg;
1377 __ mov(Operand(esp, 1 * kPointerSize), holder);
1378 // write receiver to stack frame
1379 __ mov(Operand(esp, (api_call_argc + 1) * kPointerSize), receiver());
1380
1381 GenerateFastApiCall(masm(), call_optimization, argc);
1382 }
1383
1384
1385 void BaseLoadStubCompiler::GenerateLoadCallback(
1386 Register reg,
1359 Handle<ExecutableAccessorInfo> callback) { 1387 Handle<ExecutableAccessorInfo> callback) {
1360 // Insert additional parameters into the stack frame above return address. 1388 // Insert additional parameters into the stack frame above return address.
1361 ASSERT(!scratch3().is(reg)); 1389 ASSERT(!scratch3().is(reg));
1362 __ pop(scratch3()); // Get return address to place it below. 1390 __ pop(scratch3()); // Get return address to place it below.
1363 1391
1364 __ push(receiver()); // receiver 1392 __ push(receiver()); // receiver
1365 __ mov(scratch2(), esp); 1393 __ mov(scratch2(), esp);
1366 ASSERT(!scratch2().is(reg)); 1394 ASSERT(!scratch2().is(reg));
1367 __ push(reg); // holder 1395 __ push(reg); // holder
1368 // Push data from ExecutableAccessorInfo. 1396 // Push data from ExecutableAccessorInfo.
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 // ----------------------------------- 3270 // -----------------------------------
3243 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3271 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3244 } 3272 }
3245 3273
3246 3274
3247 #undef __ 3275 #undef __
3248 3276
3249 } } // namespace v8::internal 3277 } } // namespace v8::internal
3250 3278
3251 #endif // V8_TARGET_ARCH_IA32 3279 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698