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

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

Issue 203173003: Array constructor expects AllocationSite or undefined as feedback. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 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/runtime.cc ('k') | src/x64/code-stubs-x64.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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 __ movp(kScratchRegister, Operand(rbx, rcx, times_pointer_size, 0)); 526 __ movp(kScratchRegister, Operand(rbx, rcx, times_pointer_size, 0));
527 __ push(Operand(kScratchRegister, 0)); // dereference handle 527 __ push(Operand(kScratchRegister, 0)); // dereference handle
528 __ addq(rcx, Immediate(1)); 528 __ addq(rcx, Immediate(1));
529 __ bind(&entry); 529 __ bind(&entry);
530 __ cmpq(rcx, rax); 530 __ cmpq(rcx, rax);
531 __ j(not_equal, &loop); 531 __ j(not_equal, &loop);
532 532
533 // Invoke the code. 533 // Invoke the code.
534 if (is_construct) { 534 if (is_construct) {
535 // No type feedback cell is available 535 // No type feedback cell is available
536 Handle<Object> megamorphic_sentinel = 536 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex);
537 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
538 __ Move(rbx, megamorphic_sentinel);
539 // Expects rdi to hold function pointer. 537 // Expects rdi to hold function pointer.
540 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); 538 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
541 __ CallStub(&stub); 539 __ CallStub(&stub);
542 } else { 540 } else {
543 ParameterCount actual(rax); 541 ParameterCount actual(rax);
544 // Function must be in rdi. 542 // Function must be in rdi.
545 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper()); 543 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper());
546 } 544 }
547 // Exit the internal frame. Notice that this also removes the empty 545 // Exit the internal frame. Notice that this also removes the empty
548 // context and the function left on the stack by the code 546 // context and the function left on the stack by the code
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 // Will both indicate a NULL and a Smi. 1119 // Will both indicate a NULL and a Smi.
1122 STATIC_ASSERT(kSmiTag == 0); 1120 STATIC_ASSERT(kSmiTag == 0);
1123 Condition not_smi = NegateCondition(masm->CheckSmi(rbx)); 1121 Condition not_smi = NegateCondition(masm->CheckSmi(rbx));
1124 __ Check(not_smi, kUnexpectedInitialMapForArrayFunction); 1122 __ Check(not_smi, kUnexpectedInitialMapForArrayFunction);
1125 __ CmpObjectType(rbx, MAP_TYPE, rcx); 1123 __ CmpObjectType(rbx, MAP_TYPE, rcx);
1126 __ Check(equal, kUnexpectedInitialMapForArrayFunction); 1124 __ Check(equal, kUnexpectedInitialMapForArrayFunction);
1127 } 1125 }
1128 1126
1129 // Run the native code for the Array function called as a normal function. 1127 // Run the native code for the Array function called as a normal function.
1130 // tail call a stub 1128 // tail call a stub
1131 Handle<Object> megamorphic_sentinel = 1129 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex);
1132 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
1133 __ Move(rbx, megamorphic_sentinel);
1134 ArrayConstructorStub stub(masm->isolate()); 1130 ArrayConstructorStub stub(masm->isolate());
1135 __ TailCallStub(&stub); 1131 __ TailCallStub(&stub);
1136 } 1132 }
1137 1133
1138 1134
1139 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { 1135 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
1140 // ----------- S t a t e ------------- 1136 // ----------- S t a t e -------------
1141 // -- rax : number of arguments 1137 // -- rax : number of arguments
1142 // -- rdi : constructor function 1138 // -- rdi : constructor function
1143 // -- rsp[0] : return address 1139 // -- rsp[0] : return address
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 __ bind(&ok); 1429 __ bind(&ok);
1434 __ ret(0); 1430 __ ret(0);
1435 } 1431 }
1436 1432
1437 1433
1438 #undef __ 1434 #undef __
1439 1435
1440 } } // namespace v8::internal 1436 } } // namespace v8::internal
1441 1437
1442 #endif // V8_TARGET_ARCH_X64 1438 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698