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

Side by Side Diff: src/ia32/builtins-ia32.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/arm/lithium-codegen-arm.cc ('k') | src/ia32/code-stubs-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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 __ cmp(ecx, eax); 466 __ cmp(ecx, eax);
467 __ j(not_equal, &loop); 467 __ j(not_equal, &loop);
468 468
469 // Get the function from the stack and call it. 469 // Get the function from the stack and call it.
470 // kPointerSize for the receiver. 470 // kPointerSize for the receiver.
471 __ mov(edi, Operand(esp, eax, times_4, kPointerSize)); 471 __ mov(edi, Operand(esp, eax, times_4, kPointerSize));
472 472
473 // Invoke the code. 473 // Invoke the code.
474 if (is_construct) { 474 if (is_construct) {
475 // No type feedback cell is available 475 // No type feedback cell is available
476 Handle<Object> megamorphic_sentinel = 476 __ mov(ebx, masm->isolate()->factory()->undefined_value());
477 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
478 __ mov(ebx, Immediate(megamorphic_sentinel));
479 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); 477 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
480 __ CallStub(&stub); 478 __ CallStub(&stub);
481 } else { 479 } else {
482 ParameterCount actual(eax); 480 ParameterCount actual(eax);
483 __ InvokeFunction(edi, actual, CALL_FUNCTION, 481 __ InvokeFunction(edi, actual, CALL_FUNCTION,
484 NullCallWrapper()); 482 NullCallWrapper());
485 } 483 }
486 484
487 // Exit the internal frame. Notice that this also removes the empty. 485 // Exit the internal frame. Notice that this also removes the empty.
488 // context and the function left on the stack by the code 486 // context and the function left on the stack by the code
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); 1048 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
1051 // Will both indicate a NULL and a Smi. 1049 // Will both indicate a NULL and a Smi.
1052 __ test(ebx, Immediate(kSmiTagMask)); 1050 __ test(ebx, Immediate(kSmiTagMask));
1053 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); 1051 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction);
1054 __ CmpObjectType(ebx, MAP_TYPE, ecx); 1052 __ CmpObjectType(ebx, MAP_TYPE, ecx);
1055 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); 1053 __ Assert(equal, kUnexpectedInitialMapForArrayFunction);
1056 } 1054 }
1057 1055
1058 // Run the native code for the Array function called as a normal function. 1056 // Run the native code for the Array function called as a normal function.
1059 // tail call a stub 1057 // tail call a stub
1060 Handle<Object> megamorphic_sentinel = 1058 __ mov(ebx, masm->isolate()->factory()->undefined_value());
1061 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
1062 __ mov(ebx, Immediate(megamorphic_sentinel));
1063 ArrayConstructorStub stub(masm->isolate()); 1059 ArrayConstructorStub stub(masm->isolate());
1064 __ TailCallStub(&stub); 1060 __ TailCallStub(&stub);
1065 } 1061 }
1066 1062
1067 1063
1068 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { 1064 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
1069 // ----------- S t a t e ------------- 1065 // ----------- S t a t e -------------
1070 // -- eax : number of arguments 1066 // -- eax : number of arguments
1071 // -- edi : constructor function 1067 // -- edi : constructor function
1072 // -- esp[0] : return address 1068 // -- esp[0] : return address
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 1360
1365 __ bind(&ok); 1361 __ bind(&ok);
1366 __ ret(0); 1362 __ ret(0);
1367 } 1363 }
1368 1364
1369 #undef __ 1365 #undef __
1370 } 1366 }
1371 } // namespace v8::internal 1367 } // namespace v8::internal
1372 1368
1373 #endif // V8_TARGET_ARCH_IA32 1369 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698