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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 162903004: Add a premonomorphic state to the call target cache. Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 6 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
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2194 __ j(not_equal, &miss); 2194 __ j(not_equal, &miss);
2195 2195
2196 // Make sure the function is the Array() function 2196 // Make sure the function is the Array() function
2197 __ LoadArrayFunction(rcx); 2197 __ LoadArrayFunction(rcx);
2198 __ cmpq(rdi, rcx); 2198 __ cmpq(rdi, rcx);
2199 __ j(not_equal, &megamorphic); 2199 __ j(not_equal, &megamorphic);
2200 __ jmp(&done); 2200 __ jmp(&done);
2201 2201
2202 __ bind(&miss); 2202 __ bind(&miss);
2203 2203
2204 // A monomorphic miss (i.e, here the cache is not uninitialized) goes 2204 // A monomorphic miss (i.e, here the cache is not uninitialized or
2205 // megamorphic. 2205 // pre-monomorphic) goes megamorphic.
2206 Label not_uninitialized;
2206 __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate)); 2207 __ Cmp(rcx, TypeFeedbackInfo::UninitializedSentinel(isolate));
2208 __ j(not_equal, &not_uninitialized);
2209
2210 // PremonomorphicSentinel is an immortal immovable object (null) so no
2211 // write-barrier is needed.
2212 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize),
2213 TypeFeedbackInfo::PremonomorphicSentinel(isolate));
2214 __ jmp(&done);
2215
2216 // If the cache isn't uninitialized, it is either premonomorphic or
2217 // monomorphic. If it is premonomorphic, we initialize it thus making
2218 // it monomorphic. Otherwise, we go megamorphic.
2219 __ bind(&not_uninitialized);
2220 __ Cmp(rcx, TypeFeedbackInfo::PremonomorphicSentinel(isolate));
2207 __ j(equal, &initialize); 2221 __ j(equal, &initialize);
2222
2208 // MegamorphicSentinel is an immortal immovable object (undefined) so no 2223 // MegamorphicSentinel is an immortal immovable object (undefined) so no
2209 // write-barrier is needed. 2224 // write-barrier is needed.
2210 __ bind(&megamorphic); 2225 __ bind(&megamorphic);
2211 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize), 2226 __ Move(FieldOperand(rbx, rdx, times_pointer_size, FixedArray::kHeaderSize),
2212 TypeFeedbackInfo::MegamorphicSentinel(isolate)); 2227 TypeFeedbackInfo::MegamorphicSentinel(isolate));
2213 __ jmp(&done); 2228 __ jmp(&done);
2214 2229
2215 // An uninitialized cache is patched with the function or sentinel to 2230 // An uninitialized cache is patched with the function or sentinel to
2216 // indicate the ElementsKind if function is the Array constructor. 2231 // indicate the ElementsKind if function is the Array constructor.
2217 __ bind(&initialize); 2232 __ bind(&initialize);
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after
5327 return_value_operand, 5342 return_value_operand,
5328 NULL); 5343 NULL);
5329 } 5344 }
5330 5345
5331 5346
5332 #undef __ 5347 #undef __
5333 5348
5334 } } // namespace v8::internal 5349 } } // namespace v8::internal
5335 5350
5336 #endif // V8_TARGET_ARCH_X64 5351 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698