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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 9304001: Implement inlining of constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed moar comments by Vyacheslav Egorov. Created 8 years, 9 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/hydrogen-instructions.cc ('k') | src/ia32/deoptimizer-ia32.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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 masm->isolate()->builtins()->HandleApiCallConstruct(); 317 masm->isolate()->builtins()->HandleApiCallConstruct();
318 ParameterCount expected(0); 318 ParameterCount expected(0);
319 __ InvokeCode(code, expected, expected, RelocInfo::CODE_TARGET, 319 __ InvokeCode(code, expected, expected, RelocInfo::CODE_TARGET,
320 CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); 320 CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
321 } else { 321 } else {
322 ParameterCount actual(eax); 322 ParameterCount actual(eax);
323 __ InvokeFunction(edi, actual, CALL_FUNCTION, 323 __ InvokeFunction(edi, actual, CALL_FUNCTION,
324 NullCallWrapper(), CALL_AS_METHOD); 324 NullCallWrapper(), CALL_AS_METHOD);
325 } 325 }
326 326
327 // Store offset of return address for deoptimizer.
328 if (!is_api_function && !count_constructions) {
329 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset());
330 }
331
327 // Restore context from the frame. 332 // Restore context from the frame.
328 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 333 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
329 334
330 // If the result is an object (in the ECMA sense), we should get rid 335 // If the result is an object (in the ECMA sense), we should get rid
331 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 336 // of the receiver and use the result; see ECMA-262 section 13.2.2-7
332 // on page 74. 337 // on page 74.
333 Label use_receiver, exit; 338 Label use_receiver, exit;
334 339
335 // If the result is a smi, it is *not* an object in the ECMA sense. 340 // If the result is a smi, it is *not* an object in the ECMA sense.
336 __ JumpIfSmi(eax, &use_receiver); 341 __ JumpIfSmi(eax, &use_receiver);
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 __ cmp(eax, ebx); 1604 __ cmp(eax, ebx);
1600 __ j(less, &fill); 1605 __ j(less, &fill);
1601 } 1606 }
1602 1607
1603 // Call the entry point. 1608 // Call the entry point.
1604 __ bind(&invoke); 1609 __ bind(&invoke);
1605 // Restore function pointer. 1610 // Restore function pointer.
1606 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 1611 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
1607 __ call(edx); 1612 __ call(edx);
1608 1613
1614 // Store offset of return address for deoptimizer.
1609 masm->isolate()->heap()->SetArgumentsAdaptorDeoptPCOffset(masm->pc_offset()); 1615 masm->isolate()->heap()->SetArgumentsAdaptorDeoptPCOffset(masm->pc_offset());
1616
1610 // Leave frame and return. 1617 // Leave frame and return.
1611 LeaveArgumentsAdaptorFrame(masm); 1618 LeaveArgumentsAdaptorFrame(masm);
1612 __ ret(0); 1619 __ ret(0);
1613 1620
1614 // ------------------------------------------- 1621 // -------------------------------------------
1615 // Dont adapt arguments. 1622 // Dont adapt arguments.
1616 // ------------------------------------------- 1623 // -------------------------------------------
1617 __ bind(&dont_adapt_arguments); 1624 __ bind(&dont_adapt_arguments);
1618 __ jmp(edx); 1625 __ jmp(edx);
1619 } 1626 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1694 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1688 generator.Generate(); 1695 generator.Generate();
1689 } 1696 }
1690 1697
1691 1698
1692 #undef __ 1699 #undef __
1693 } 1700 }
1694 } // namespace v8::internal 1701 } // namespace v8::internal
1695 1702
1696 #endif // V8_TARGET_ARCH_IA32 1703 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698