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

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

Issue 23620036: Refactoring PropertyCallbackInfo & FunctionCallbackInfo, step 1. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: no mips 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Register receiver, 391 Register receiver,
392 Register holder, 392 Register holder,
393 Register name, 393 Register name,
394 Handle<JSObject> holder_obj) { 394 Handle<JSObject> holder_obj) {
395 __ push(name); 395 __ push(name);
396 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); 396 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
397 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); 397 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
398 Register scratch = name; 398 Register scratch = name;
399 __ mov(scratch, Immediate(interceptor)); 399 __ mov(scratch, Immediate(interceptor));
400 __ push(scratch); 400 __ push(scratch);
401 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0);
402 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1);
403 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4);
Michael Starzinger 2013/09/11 09:55:19 See comments in stub-cache.cc about these constant
marja 2013/09/11 16:35:32 Done.
404 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5);
401 __ push(receiver); 405 __ push(receiver);
402 __ push(holder);
403 __ push(FieldOperand(scratch, InterceptorInfo::kDataOffset)); 406 __ push(FieldOperand(scratch, InterceptorInfo::kDataOffset));
404 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); 407 __ push(Immediate(reinterpret_cast<int>(masm->isolate())));
408 __ push(holder);
405 } 409 }
406 410
407 411
408 static void CompileCallLoadPropertyWithInterceptor( 412 static void CompileCallLoadPropertyWithInterceptor(
409 MacroAssembler* masm, 413 MacroAssembler* masm,
410 Register receiver, 414 Register receiver,
411 Register holder, 415 Register holder,
412 Register name, 416 Register name,
413 Handle<JSObject> holder_obj) { 417 Handle<JSObject> holder_obj) {
414 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 418 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 } 1398 }
1395 1399
1396 1400
1397 void BaseLoadStubCompiler::GenerateLoadCallback( 1401 void BaseLoadStubCompiler::GenerateLoadCallback(
1398 Register reg, 1402 Register reg,
1399 Handle<ExecutableAccessorInfo> callback) { 1403 Handle<ExecutableAccessorInfo> callback) {
1400 // Insert additional parameters into the stack frame above return address. 1404 // Insert additional parameters into the stack frame above return address.
1401 ASSERT(!scratch3().is(reg)); 1405 ASSERT(!scratch3().is(reg));
1402 __ pop(scratch3()); // Get return address to place it below. 1406 __ pop(scratch3()); // Get return address to place it below.
1403 1407
1408 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 0);
1409 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == -1);
1410 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == -2);
1411 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == -3);
1412 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == -4);
1413 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == -5);
1404 __ push(receiver()); // receiver 1414 __ push(receiver()); // receiver
1405 __ mov(scratch2(), esp); 1415 __ mov(scratch2(), esp);
1406 ASSERT(!scratch2().is(reg)); 1416 ASSERT(!scratch2().is(reg));
1407 __ push(reg); // holder
1408 // Push data from ExecutableAccessorInfo. 1417 // Push data from ExecutableAccessorInfo.
1409 if (isolate()->heap()->InNewSpace(callback->data())) { 1418 if (isolate()->heap()->InNewSpace(callback->data())) {
1419 ASSERT(!scratch1().is(reg));
1410 __ mov(scratch1(), Immediate(callback)); 1420 __ mov(scratch1(), Immediate(callback));
1411 __ push(FieldOperand(scratch1(), ExecutableAccessorInfo::kDataOffset)); 1421 __ push(FieldOperand(scratch1(), ExecutableAccessorInfo::kDataOffset));
1412 } else { 1422 } else {
1413 __ push(Immediate(Handle<Object>(callback->data(), isolate()))); 1423 __ push(Immediate(Handle<Object>(callback->data(), isolate())));
1414 } 1424 }
1415 __ push(Immediate(isolate()->factory()->undefined_value())); // ReturnValue 1425 __ push(Immediate(isolate()->factory()->undefined_value())); // ReturnValue
1416 // ReturnValue default value 1426 // ReturnValue default value
1417 __ push(Immediate(isolate()->factory()->undefined_value())); 1427 __ push(Immediate(isolate()->factory()->undefined_value()));
1418 __ push(Immediate(reinterpret_cast<int>(isolate()))); 1428 __ push(Immediate(reinterpret_cast<int>(isolate())));
1429 __ push(reg); // holder
1419 1430
1420 // Save a pointer to where we pushed the arguments pointer. This will be 1431 // Save a pointer to where we pushed the arguments pointer. This will be
1421 // passed as the const ExecutableAccessorInfo& to the C++ callback. 1432 // passed as the const ExecutableAccessorInfo& to the C++ callback.
1422 __ push(scratch2()); 1433 __ push(scratch2());
1423 1434
1424 __ push(name()); // name 1435 __ push(name()); // name
1425 __ mov(ebx, esp); // esp points to reference to name (handler). 1436 __ mov(ebx, esp); // esp points to reference to name (handler).
1426 1437
1427 __ push(scratch3()); // Restore return address. 1438 __ push(scratch3()); // Restore return address.
1428 1439
(...skipping 14 matching lines...) Expand all
1443 // already generated). Do not allow the assembler to perform a 1454 // already generated). Do not allow the assembler to perform a
1444 // garbage collection but instead return the allocation failure 1455 // garbage collection but instead return the allocation failure
1445 // object. 1456 // object.
1446 1457
1447 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); 1458 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1448 1459
1449 __ CallApiFunctionAndReturn(getter_address, 1460 __ CallApiFunctionAndReturn(getter_address,
1450 thunk_address, 1461 thunk_address,
1451 ApiParameterOperand(2), 1462 ApiParameterOperand(2),
1452 kStackSpace, 1463 kStackSpace,
1453 6); 1464 7);
1454 } 1465 }
1455 1466
1456 1467
1457 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { 1468 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1458 // Return the constant value. 1469 // Return the constant value.
1459 __ LoadObject(eax, value); 1470 __ LoadObject(eax, value);
1460 __ ret(0); 1471 __ ret(0);
1461 } 1472 }
1462 1473
1463 1474
(...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after
3300 // ----------------------------------- 3311 // -----------------------------------
3301 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3312 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3302 } 3313 }
3303 3314
3304 3315
3305 #undef __ 3316 #undef __
3306 3317
3307 } } // namespace v8::internal 3318 } } // namespace v8::internal
3308 3319
3309 #endif // V8_TARGET_ARCH_IA32 3320 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/stub-cache.cc » ('j') | src/stub-cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698