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

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

Issue 181283003: Symbols for type cells. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. 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/heap.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> undefined_sentinel( 476 Handle<Object> megamorphic_sentinel =
477 masm->isolate()->heap()->undefined_value(), masm->isolate()); 477 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
478 __ mov(ebx, Immediate(undefined_sentinel)); 478 __ mov(ebx, Immediate(megamorphic_sentinel));
479 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); 479 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
480 __ CallStub(&stub); 480 __ CallStub(&stub);
481 } else { 481 } else {
482 ParameterCount actual(eax); 482 ParameterCount actual(eax);
483 __ InvokeFunction(edi, actual, CALL_FUNCTION, 483 __ InvokeFunction(edi, actual, CALL_FUNCTION,
484 NullCallWrapper()); 484 NullCallWrapper());
485 } 485 }
486 486
487 // Exit the internal frame. Notice that this also removes the empty. 487 // Exit the internal frame. Notice that this also removes the empty.
488 // context and the function left on the stack by the code 488 // 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)); 1050 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
1051 // Will both indicate a NULL and a Smi. 1051 // Will both indicate a NULL and a Smi.
1052 __ test(ebx, Immediate(kSmiTagMask)); 1052 __ test(ebx, Immediate(kSmiTagMask));
1053 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); 1053 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction);
1054 __ CmpObjectType(ebx, MAP_TYPE, ecx); 1054 __ CmpObjectType(ebx, MAP_TYPE, ecx);
1055 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); 1055 __ Assert(equal, kUnexpectedInitialMapForArrayFunction);
1056 } 1056 }
1057 1057
1058 // Run the native code for the Array function called as a normal function. 1058 // Run the native code for the Array function called as a normal function.
1059 // tail call a stub 1059 // tail call a stub
1060 Handle<Object> undefined_sentinel( 1060 Handle<Object> megamorphic_sentinel =
1061 masm->isolate()->heap()->undefined_value(), 1061 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
1062 masm->isolate()); 1062 __ mov(ebx, Immediate(megamorphic_sentinel));
1063 __ mov(ebx, Immediate(undefined_sentinel));
1064 ArrayConstructorStub stub(masm->isolate()); 1063 ArrayConstructorStub stub(masm->isolate());
1065 __ TailCallStub(&stub); 1064 __ TailCallStub(&stub);
1066 } 1065 }
1067 1066
1068 1067
1069 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { 1068 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
1070 // ----------- S t a t e ------------- 1069 // ----------- S t a t e -------------
1071 // -- eax : number of arguments 1070 // -- eax : number of arguments
1072 // -- edi : constructor function 1071 // -- edi : constructor function
1073 // -- esp[0] : return address 1072 // -- esp[0] : return address
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1364
1366 __ bind(&ok); 1365 __ bind(&ok);
1367 __ ret(0); 1366 __ ret(0);
1368 } 1367 }
1369 1368
1370 #undef __ 1369 #undef __
1371 } 1370 }
1372 } // namespace v8::internal 1371 } // namespace v8::internal
1373 1372
1374 #endif // V8_TARGET_ARCH_IA32 1373 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698