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

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

Issue 90643003: Experimental implementation: Exposing SIMD instructions into JavaScript Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/simd128.js ('k') | src/types.h » ('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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 isolate_, *object, cache_holder)); 264 isolate_, *object, cache_holder));
265 265
266 // Compute check type based on receiver/holder. 266 // Compute check type based on receiver/holder.
267 CheckType check = RECEIVER_MAP_CHECK; 267 CheckType check = RECEIVER_MAP_CHECK;
268 if (object->IsString()) { 268 if (object->IsString()) {
269 check = STRING_CHECK; 269 check = STRING_CHECK;
270 } else if (object->IsSymbol()) { 270 } else if (object->IsSymbol()) {
271 check = SYMBOL_CHECK; 271 check = SYMBOL_CHECK;
272 } else if (object->IsNumber()) { 272 } else if (object->IsNumber()) {
273 check = NUMBER_CHECK; 273 check = NUMBER_CHECK;
274 } else if (object->IsFloat32x4()) {
275 check = FLOAT32x4_CHECK;
276 } else if (object->IsInt32x4()) {
277 check = INT32x4_CHECK;
274 } else if (object->IsBoolean()) { 278 } else if (object->IsBoolean()) {
275 check = BOOLEAN_CHECK; 279 check = BOOLEAN_CHECK;
276 } 280 }
277 281
278 if (check != RECEIVER_MAP_CHECK && 282 if (check != RECEIVER_MAP_CHECK &&
279 !function->IsBuiltin() && 283 !function->IsBuiltin() &&
280 function->shared()->is_classic_mode()) { 284 function->shared()->is_classic_mode()) {
281 // Calling non-strict non-builtins with a value as the receiver 285 // Calling non-strict non-builtins with a value as the receiver
282 // requires boxing. 286 // requires boxing.
283 return Handle<Code>::null(); 287 return Handle<Code>::null();
(...skipping 30 matching lines...) Expand all
314 PropertyIndex index) { 318 PropertyIndex index) {
315 // Compute the check type and the map. 319 // Compute the check type and the map.
316 InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*object); 320 InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*object);
317 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( 321 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder(
318 isolate_, *object, cache_holder)); 322 isolate_, *object, cache_holder));
319 323
320 // TODO(1233596): We cannot do receiver map check for non-JS objects 324 // TODO(1233596): We cannot do receiver map check for non-JS objects
321 // because they may be represented as immediates without a 325 // because they may be represented as immediates without a
322 // map. Instead, we check against the map in the holder. 326 // map. Instead, we check against the map in the holder.
323 if (object->IsNumber() || object->IsSymbol() || 327 if (object->IsNumber() || object->IsSymbol() ||
324 object->IsBoolean() || object->IsString()) { 328 object->IsBoolean() || object->IsString() ||
329 object->IsFloat32x4() || object->IsInt32x4()) {
325 object = holder; 330 object = holder;
326 } 331 }
327 332
328 Code::Flags flags = Code::ComputeMonomorphicFlags( 333 Code::Flags flags = Code::ComputeMonomorphicFlags(
329 kind, extra_state, cache_holder, Code::FAST, argc); 334 kind, extra_state, cache_holder, Code::FAST, argc);
330 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), 335 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
331 isolate_); 336 isolate_);
332 if (probe->IsCode()) return Handle<Code>::cast(probe); 337 if (probe->IsCode()) return Handle<Code>::cast(probe);
333 338
334 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); 339 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder);
(...skipping 17 matching lines...) Expand all
352 Handle<JSObject> holder) { 357 Handle<JSObject> holder) {
353 // Compute the check type and the map. 358 // Compute the check type and the map.
354 InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*object); 359 InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*object);
355 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( 360 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder(
356 isolate_, *object, cache_holder)); 361 isolate_, *object, cache_holder));
357 362
358 // TODO(1233596): We cannot do receiver map check for non-JS objects 363 // TODO(1233596): We cannot do receiver map check for non-JS objects
359 // because they may be represented as immediates without a 364 // because they may be represented as immediates without a
360 // map. Instead, we check against the map in the holder. 365 // map. Instead, we check against the map in the holder.
361 if (object->IsNumber() || object->IsSymbol() || 366 if (object->IsNumber() || object->IsSymbol() ||
362 object->IsBoolean() || object->IsString()) { 367 object->IsBoolean() || object->IsString() ||
368 object->IsFloat32x4() || object->IsInt32x4()) {
363 object = holder; 369 object = holder;
364 } 370 }
365 371
366 Code::Flags flags = Code::ComputeMonomorphicFlags( 372 Code::Flags flags = Code::ComputeMonomorphicFlags(
367 kind, extra_state, cache_holder, Code::FAST, argc); 373 kind, extra_state, cache_holder, Code::FAST, argc);
368 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), 374 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
369 isolate_); 375 isolate_);
370 if (probe->IsCode()) return Handle<Code>::cast(probe); 376 if (probe->IsCode()) return Handle<Code>::cast(probe);
371 377
372 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); 378 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder);
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 Handle<Name> name, 1139 Handle<Name> name,
1134 Label* miss) { 1140 Label* miss) {
1135 PrototypeCheckType check_type = CHECK_ALL_MAPS; 1141 PrototypeCheckType check_type = CHECK_ALL_MAPS;
1136 int function_index = -1; 1142 int function_index = -1;
1137 if (type->Is(Type::String())) { 1143 if (type->Is(Type::String())) {
1138 function_index = Context::STRING_FUNCTION_INDEX; 1144 function_index = Context::STRING_FUNCTION_INDEX;
1139 } else if (type->Is(Type::Symbol())) { 1145 } else if (type->Is(Type::Symbol())) {
1140 function_index = Context::SYMBOL_FUNCTION_INDEX; 1146 function_index = Context::SYMBOL_FUNCTION_INDEX;
1141 } else if (type->Is(Type::Number())) { 1147 } else if (type->Is(Type::Number())) {
1142 function_index = Context::NUMBER_FUNCTION_INDEX; 1148 function_index = Context::NUMBER_FUNCTION_INDEX;
1149 } else if (type->Is(Type::Float32x4())) {
1150 function_index = Context::FLOAT32x4_FUNCTION_INDEX;
1151 } else if (type->Is(Type::Int32x4())) {
1152 function_index = Context::INT32x4_FUNCTION_INDEX;
1143 } else if (type->Is(Type::Boolean())) { 1153 } else if (type->Is(Type::Boolean())) {
1144 // Booleans use the generic oddball map, so an additional check is needed to 1154 // Booleans use the generic oddball map, so an additional check is needed to
1145 // ensure the receiver is really a boolean. 1155 // ensure the receiver is really a boolean.
1146 GenerateBooleanCheck(object_reg, miss); 1156 GenerateBooleanCheck(object_reg, miss);
1147 function_index = Context::BOOLEAN_FUNCTION_INDEX; 1157 function_index = Context::BOOLEAN_FUNCTION_INDEX;
1148 } else { 1158 } else {
1149 check_type = SKIP_RECEIVER; 1159 check_type = SKIP_RECEIVER;
1150 } 1160 }
1151 1161
1152 if (check_type == CHECK_ALL_MAPS) { 1162 if (check_type == CHECK_ALL_MAPS) {
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 Handle<FunctionTemplateInfo>( 1843 Handle<FunctionTemplateInfo>(
1834 FunctionTemplateInfo::cast(signature->receiver())); 1844 FunctionTemplateInfo::cast(signature->receiver()));
1835 } 1845 }
1836 } 1846 }
1837 1847
1838 is_simple_api_call_ = true; 1848 is_simple_api_call_ = true;
1839 } 1849 }
1840 1850
1841 1851
1842 } } // namespace v8::internal 1852 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/simd128.js ('k') | src/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698