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

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

Issue 18881004: Turn ElementsTransitionAndStore stub into a HydrogenCodeStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 5 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 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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 receiver_map->FindTransitionedMap(receiver_maps); 1986 receiver_map->FindTransitionedMap(receiver_maps);
1987 1987
1988 // TODO(mvstanton): The code below is doing pessimistic elements 1988 // TODO(mvstanton): The code below is doing pessimistic elements
1989 // transitions. I would like to stop doing that and rely on Allocation Site 1989 // transitions. I would like to stop doing that and rely on Allocation Site
1990 // Tracking to do a better job of ensuring the data types are what they need 1990 // Tracking to do a better job of ensuring the data types are what they need
1991 // to be. Not all the elements are in place yet, pessimistic elements 1991 // to be. Not all the elements are in place yet, pessimistic elements
1992 // transitions are still important for performance. 1992 // transitions are still important for performance.
1993 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 1993 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
1994 ElementsKind elements_kind = receiver_map->elements_kind(); 1994 ElementsKind elements_kind = receiver_map->elements_kind();
1995 if (!transitioned_map.is_null()) { 1995 if (!transitioned_map.is_null()) {
1996 cached_stub = ElementsTransitionAndStoreStub( 1996 switch (strict_mode()) {
1997 elements_kind, 1997 case kNonStrictMode:
1998 transitioned_map->elements_kind(), 1998 cached_stub = ElementsTransitionAndStoreNonStrictStub(
1999 is_js_array, 1999 elements_kind,
2000 strict_mode(), 2000 transitioned_map->elements_kind(),
2001 store_mode_).GetCode(isolate()); 2001 is_js_array,
2002 store_mode_).GetCode(isolate());
2003 break;
2004
2005 case kStrictMode:
2006 cached_stub = ElementsTransitionAndStoreStrictStub(
2007 elements_kind,
2008 transitioned_map->elements_kind(),
2009 is_js_array,
2010 store_mode_).GetCode(isolate());
2011 break;
2012 }
2002 } else { 2013 } else {
2003 if (FLAG_compiled_keyed_stores && 2014 if (FLAG_compiled_keyed_stores &&
2004 (receiver_map->has_fast_elements() || 2015 (receiver_map->has_fast_elements() ||
2005 receiver_map->has_external_array_elements())) { 2016 receiver_map->has_external_array_elements())) {
2006 cached_stub = KeyedStoreFastElementStub( 2017 cached_stub = KeyedStoreFastElementStub(
2007 is_js_array, 2018 is_js_array,
2008 elements_kind, 2019 elements_kind,
2009 store_mode_).GetCode(isolate()); 2020 store_mode_).GetCode(isolate());
2010 } else { 2021 } else {
2011 cached_stub = KeyedStoreElementStub( 2022 cached_stub = KeyedStoreElementStub(
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 Handle<FunctionTemplateInfo>( 2204 Handle<FunctionTemplateInfo>(
2194 FunctionTemplateInfo::cast(signature->receiver())); 2205 FunctionTemplateInfo::cast(signature->receiver()));
2195 } 2206 }
2196 } 2207 }
2197 2208
2198 is_simple_api_call_ = true; 2209 is_simple_api_call_ = true;
2199 } 2210 }
2200 2211
2201 2212
2202 } } // namespace v8::internal 2213 } } // namespace v8::internal
OLDNEW
« src/code-stubs.h ('K') | « 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