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

Side by Side Diff: src/ic.cc

Issue 23484060: Optimize typed-array length loading. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/hydrogen-instructions.h ('k') | no next file » | 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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 if (!holder->HasFastProperties()) break; 1364 if (!holder->HasFastProperties()) break;
1365 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); 1365 Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
1366 CallOptimization call_optimization(function); 1366 CallOptimization call_optimization(function);
1367 if (call_optimization.is_simple_api_call() && 1367 if (call_optimization.is_simple_api_call() &&
1368 call_optimization.IsCompatibleReceiver(*receiver)) { 1368 call_optimization.IsCompatibleReceiver(*receiver)) {
1369 return isolate()->stub_cache()->ComputeLoadCallback( 1369 return isolate()->stub_cache()->ComputeLoadCallback(
1370 name, receiver, holder, call_optimization); 1370 name, receiver, holder, call_optimization);
1371 } 1371 }
1372 return isolate()->stub_cache()->ComputeLoadViaGetter( 1372 return isolate()->stub_cache()->ComputeLoadViaGetter(
1373 name, receiver, holder, function); 1373 name, receiver, holder, function);
1374 } else if (receiver->IsJSArray() && 1374 } else if (name->Equals(isolate()->heap()->length_string())) {
1375 name->Equals(isolate()->heap()->length_string())) { 1375 if (receiver->IsJSArray()) {
1376 PropertyIndex lengthIndex = PropertyIndex::NewHeaderIndex( 1376 PropertyIndex lengthIndex = PropertyIndex::NewHeaderIndex(
1377 JSArray::kLengthOffset / kPointerSize); 1377 JSArray::kLengthOffset / kPointerSize);
1378 return isolate()->stub_cache()->ComputeLoadField( 1378 return isolate()->stub_cache()->ComputeLoadField(
1379 name, receiver, holder, lengthIndex, Representation::Tagged()); 1379 name, receiver, holder, lengthIndex, Representation::Tagged());
1380 } else if (receiver->IsJSTypedArray()) {
Dmitry Lomov (no reviews) 2013/09/19 17:45:46 Are you sure you this code path is hit? For typed
1381 PropertyIndex lengthIndex = PropertyIndex::NewHeaderIndex(
1382 JSTypedArray::kLengthOffset / kPointerSize);
1383 return isolate()->stub_cache()->ComputeLoadField(
1384 name, receiver, holder, lengthIndex, Representation::Tagged());
1385 }
1380 } 1386 }
1381 // TODO(dcarney): Handle correctly. 1387 // TODO(dcarney): Handle correctly.
1382 if (callback->IsDeclaredAccessorInfo()) break; 1388 if (callback->IsDeclaredAccessorInfo()) break;
1383 ASSERT(callback->IsForeign()); 1389 ASSERT(callback->IsForeign());
1384 // No IC support for old-style native accessors. 1390 // No IC support for old-style native accessors.
1385 break; 1391 break;
1386 } 1392 }
1387 case INTERCEPTOR: 1393 case INTERCEPTOR:
1388 ASSERT(HasInterceptorGetter(*holder)); 1394 ASSERT(HasInterceptorGetter(*holder));
1389 return isolate()->stub_cache()->ComputeLoadInterceptor( 1395 return isolate()->stub_cache()->ComputeLoadInterceptor(
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after
3156 #undef ADDR 3162 #undef ADDR
3157 }; 3163 };
3158 3164
3159 3165
3160 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3166 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3161 return IC_utilities[id]; 3167 return IC_utilities[id];
3162 } 3168 }
3163 3169
3164 3170
3165 } } // namespace v8::internal 3171 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698