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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 6287030: Create specialized code stubs for PixelArray loads. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: cleanup before review Created 9 years, 10 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
OLDNEW
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 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 __ ret(0); 3148 __ ret(0);
3149 3149
3150 __ bind(&miss); 3150 __ bind(&miss);
3151 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 3151 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3152 3152
3153 // Return the generated code. 3153 // Return the generated code.
3154 return GetCode(NORMAL, NULL); 3154 return GetCode(NORMAL, NULL);
3155 } 3155 }
3156 3156
3157 3157
3158 MaybeObject* KeyedLoadStubCompiler::CompileLoadPixelArray(JSObject* receiver) {
3159 // ----------- S t a t e -------------
3160 // -- eax : key
3161 // -- edx : receiver
3162 // -- esp[0] : return address
3163 // -----------------------------------
3164 Label miss;
3165
3166 // Check that the receiver isn't a smi.
3167 __ test(edx, Immediate(kSmiTagMask));
3168 __ j(zero, &miss, not_taken);
3169
3170 // Check that the map matches.
3171 __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
Mads Ager (chromium) 2011/02/01 12:02:12 CheckMap? I believe CheckMap can check for smi as
danno 2011/02/03 12:53:26 Done.
3172 Immediate(Handle<Map>(receiver->map())));
3173 __ j(not_equal, &miss, not_taken);
3174
3175 GenerateFastPixelArrayLoad(masm(),
3176 edx,
3177 eax,
3178 ecx,
3179 ebx,
3180 eax,
3181 &miss,
3182 &miss,
3183 &miss);
3184
3185 // Handle load cache miss.
3186 __ bind(&miss);
3187 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Miss));
3188 __ jmp(ic, RelocInfo::CODE_TARGET);
3189
3190 // Return the generated code.
3191 return GetCode(NORMAL, NULL);
3192 }
3193
3194
3158 // Specialized stub for constructing objects from functions which only have only 3195 // Specialized stub for constructing objects from functions which only have only
3159 // simple assignments of the form this.x = ...; in their body. 3196 // simple assignments of the form this.x = ...; in their body.
3160 MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) { 3197 MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) {
3161 // ----------- S t a t e ------------- 3198 // ----------- S t a t e -------------
3162 // -- eax : argc 3199 // -- eax : argc
3163 // -- edi : constructor 3200 // -- edi : constructor
3164 // -- esp[0] : return address 3201 // -- esp[0] : return address
3165 // -- esp[4] : last argument 3202 // -- esp[4] : last argument
3166 // ----------------------------------- 3203 // -----------------------------------
3167 Label generic_stub_call; 3204 Label generic_stub_call;
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
3649 3686
3650 return GetCode(flags); 3687 return GetCode(flags);
3651 } 3688 }
3652 3689
3653 3690
3654 #undef __ 3691 #undef __
3655 3692
3656 } } // namespace v8::internal 3693 } } // namespace v8::internal
3657 3694
3658 #endif // V8_TARGET_ARCH_IA32 3695 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698