OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 | 1400 |
1401 // Return the generated code. | 1401 // Return the generated code. |
1402 String* function_name = NULL; | 1402 String* function_name = NULL; |
1403 if (function->shared()->name()->IsString()) { | 1403 if (function->shared()->name()->IsString()) { |
1404 function_name = String::cast(function->shared()->name()); | 1404 function_name = String::cast(function->shared()->name()); |
1405 } | 1405 } |
1406 return GetCode(CONSTANT_FUNCTION, function_name); | 1406 return GetCode(CONSTANT_FUNCTION, function_name); |
1407 } | 1407 } |
1408 | 1408 |
1409 | 1409 |
1410 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 1410 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
1411 JSObject* holder, | 1411 JSObject* holder, |
1412 String* name) { | 1412 String* name) { |
1413 // ----------- S t a t e ------------- | 1413 // ----------- S t a t e ------------- |
1414 // -- ecx : name | 1414 // -- ecx : name |
1415 // -- esp[0] : return address | 1415 // -- esp[0] : return address |
1416 // -- esp[(argc - n) * 4] : arg[n] (zero-based) | 1416 // -- esp[(argc - n) * 4] : arg[n] (zero-based) |
1417 // -- ... | 1417 // -- ... |
1418 // -- esp[(argc + 1) * 4] : receiver | 1418 // -- esp[(argc + 1) * 4] : receiver |
1419 // ----------------------------------- | 1419 // ----------------------------------- |
1420 Label miss; | 1420 Label miss; |
1421 | 1421 |
1422 // Get the number of arguments. | 1422 // Get the number of arguments. |
1423 const int argc = arguments().immediate(); | 1423 const int argc = arguments().immediate(); |
1424 | 1424 |
1425 LookupResult lookup; | 1425 LookupResult lookup; |
1426 LookupPostInterceptor(holder, name, &lookup); | 1426 LookupPostInterceptor(holder, name, &lookup); |
1427 | 1427 |
1428 // Get the receiver from the stack. | 1428 // Get the receiver from the stack. |
1429 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1429 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
1430 | 1430 |
1431 CallInterceptorCompiler compiler(this, arguments(), ecx); | 1431 CallInterceptorCompiler compiler(this, arguments(), ecx); |
1432 compiler.Compile(masm(), | 1432 compiler.Compile(masm(), |
1433 JSObject::cast(object), | 1433 object, |
1434 holder, | 1434 holder, |
1435 name, | 1435 name, |
1436 &lookup, | 1436 &lookup, |
1437 edx, | 1437 edx, |
1438 ebx, | 1438 ebx, |
1439 edi, | 1439 edi, |
1440 &miss); | 1440 &miss); |
1441 | 1441 |
1442 // Restore receiver. | 1442 // Restore receiver. |
1443 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 1443 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 2252 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
2253 | 2253 |
2254 // Return the generated code. | 2254 // Return the generated code. |
2255 return GetCode(); | 2255 return GetCode(); |
2256 } | 2256 } |
2257 | 2257 |
2258 | 2258 |
2259 #undef __ | 2259 #undef __ |
2260 | 2260 |
2261 } } // namespace v8::internal | 2261 } } // namespace v8::internal |
OLD | NEW |