| OLD | NEW |
| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 if (array->HasFastElements()) { | 670 if (array->HasFastElements()) { |
| 671 elms = array->elements(); | 671 elms = array->elements(); |
| 672 } else { | 672 } else { |
| 673 return CallJsBuiltin(isolate, "ArraySlice", args); | 673 return CallJsBuiltin(isolate, "ArraySlice", args); |
| 674 } | 674 } |
| 675 | 675 |
| 676 len = Smi::cast(array->length())->value(); | 676 len = Smi::cast(array->length())->value(); |
| 677 } else { | 677 } else { |
| 678 // Array.slice(arguments, ...) is quite a common idiom (notably more | 678 // Array.slice(arguments, ...) is quite a common idiom (notably more |
| 679 // than 50% of invocations in Web apps). Treat it in C++ as well. | 679 // than 50% of invocations in Web apps). Treat it in C++ as well. |
| 680 Map* arguments_map = | 680 Map* arguments_map = isolate->context()->native_context()-> |
| 681 isolate->context()->native_context()->arguments_boilerplate()->map(); | 681 sloppy_arguments_boilerplate()->map(); |
| 682 | 682 |
| 683 bool is_arguments_object_with_fast_elements = | 683 bool is_arguments_object_with_fast_elements = |
| 684 receiver->IsJSObject() && | 684 receiver->IsJSObject() && |
| 685 JSObject::cast(receiver)->map() == arguments_map; | 685 JSObject::cast(receiver)->map() == arguments_map; |
| 686 if (!is_arguments_object_with_fast_elements) { | 686 if (!is_arguments_object_with_fast_elements) { |
| 687 return CallJsBuiltin(isolate, "ArraySlice", args); | 687 return CallJsBuiltin(isolate, "ArraySlice", args); |
| 688 } | 688 } |
| 689 JSObject* object = JSObject::cast(receiver); | 689 JSObject* object = JSObject::cast(receiver); |
| 690 | 690 |
| 691 if (object->HasFastElements()) { | 691 if (object->HasFastElements()) { |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 Handle<FunctionTemplateInfo> desc(fun_data, isolate); | 1167 Handle<FunctionTemplateInfo> desc(fun_data, isolate); |
| 1168 bool pending_exception = false; | 1168 bool pending_exception = false; |
| 1169 isolate->factory()->ConfigureInstance( | 1169 isolate->factory()->ConfigureInstance( |
| 1170 desc, Handle<JSObject>::cast(args.receiver()), &pending_exception); | 1170 desc, Handle<JSObject>::cast(args.receiver()), &pending_exception); |
| 1171 ASSERT(isolate->has_pending_exception() == pending_exception); | 1171 ASSERT(isolate->has_pending_exception() == pending_exception); |
| 1172 if (pending_exception) return Failure::Exception(); | 1172 if (pending_exception) return Failure::Exception(); |
| 1173 fun_data = *desc; | 1173 fun_data = *desc; |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 SharedFunctionInfo* shared = function->shared(); | 1176 SharedFunctionInfo* shared = function->shared(); |
| 1177 if (shared->is_classic_mode() && !shared->native()) { | 1177 if (shared->strict_mode() == SLOPPY && !shared->native()) { |
| 1178 Object* recv = args[0]; | 1178 Object* recv = args[0]; |
| 1179 ASSERT(!recv->IsNull()); | 1179 ASSERT(!recv->IsNull()); |
| 1180 if (recv->IsUndefined()) { | 1180 if (recv->IsUndefined()) { |
| 1181 args[0] = function->context()->global_object()->global_receiver(); | 1181 args[0] = function->context()->global_object()->global_receiver(); |
| 1182 } | 1182 } |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data); | 1185 Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data); |
| 1186 | 1186 |
| 1187 if (raw_holder->IsNull()) { | 1187 if (raw_holder->IsNull()) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 LoadIC::GenerateMiss(masm); | 1313 LoadIC::GenerateMiss(masm); |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 | 1316 |
| 1317 static void Generate_LoadIC_Normal(MacroAssembler* masm) { | 1317 static void Generate_LoadIC_Normal(MacroAssembler* masm) { |
| 1318 LoadIC::GenerateNormal(masm); | 1318 LoadIC::GenerateNormal(masm); |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 | 1321 |
| 1322 static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { | 1322 static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { |
| 1323 LoadStubCompiler::GenerateLoadViaGetter( | 1323 LoadStubCompiler::GenerateLoadViaGetterForDeopt(masm); |
| 1324 masm, Handle<HeapType>::null(), | |
| 1325 LoadStubCompiler::registers()[0], Handle<JSFunction>()); | |
| 1326 } | 1324 } |
| 1327 | 1325 |
| 1328 | 1326 |
| 1329 static void Generate_LoadIC_Slow(MacroAssembler* masm) { | 1327 static void Generate_LoadIC_Slow(MacroAssembler* masm) { |
| 1330 LoadIC::GenerateRuntimeGetProperty(masm); | 1328 LoadIC::GenerateRuntimeGetProperty(masm); |
| 1331 } | 1329 } |
| 1332 | 1330 |
| 1333 | 1331 |
| 1334 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { | 1332 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { |
| 1335 KeyedLoadIC::GenerateInitialize(masm); | 1333 KeyedLoadIC::GenerateInitialize(masm); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1359 static void Generate_KeyedLoadIC_PreMonomorphic(MacroAssembler* masm) { | 1357 static void Generate_KeyedLoadIC_PreMonomorphic(MacroAssembler* masm) { |
| 1360 KeyedLoadIC::GeneratePreMonomorphic(masm); | 1358 KeyedLoadIC::GeneratePreMonomorphic(masm); |
| 1361 } | 1359 } |
| 1362 | 1360 |
| 1363 | 1361 |
| 1364 static void Generate_KeyedLoadIC_IndexedInterceptor(MacroAssembler* masm) { | 1362 static void Generate_KeyedLoadIC_IndexedInterceptor(MacroAssembler* masm) { |
| 1365 KeyedLoadIC::GenerateIndexedInterceptor(masm); | 1363 KeyedLoadIC::GenerateIndexedInterceptor(masm); |
| 1366 } | 1364 } |
| 1367 | 1365 |
| 1368 | 1366 |
| 1369 static void Generate_KeyedLoadIC_NonStrictArguments(MacroAssembler* masm) { | 1367 static void Generate_KeyedLoadIC_SloppyArguments(MacroAssembler* masm) { |
| 1370 KeyedLoadIC::GenerateNonStrictArguments(masm); | 1368 KeyedLoadIC::GenerateSloppyArguments(masm); |
| 1371 } | 1369 } |
| 1372 | 1370 |
| 1373 | 1371 |
| 1374 static void Generate_StoreIC_Slow(MacroAssembler* masm) { | 1372 static void Generate_StoreIC_Slow(MacroAssembler* masm) { |
| 1375 StoreIC::GenerateSlow(masm); | 1373 StoreIC::GenerateSlow(masm); |
| 1376 } | 1374 } |
| 1377 | 1375 |
| 1378 | 1376 |
| 1379 static void Generate_StoreIC_Miss(MacroAssembler* masm) { | 1377 static void Generate_StoreIC_Miss(MacroAssembler* masm) { |
| 1380 StoreIC::GenerateMiss(masm); | 1378 StoreIC::GenerateMiss(masm); |
| 1381 } | 1379 } |
| 1382 | 1380 |
| 1383 | 1381 |
| 1384 static void Generate_StoreIC_Normal(MacroAssembler* masm) { | 1382 static void Generate_StoreIC_Normal(MacroAssembler* masm) { |
| 1385 StoreIC::GenerateNormal(masm); | 1383 StoreIC::GenerateNormal(masm); |
| 1386 } | 1384 } |
| 1387 | 1385 |
| 1388 | 1386 |
| 1389 static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { | 1387 static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { |
| 1390 StoreStubCompiler::GenerateStoreViaSetter( | 1388 StoreStubCompiler::GenerateStoreViaSetterForDeopt(masm); |
| 1391 masm, Handle<HeapType>::null(), Handle<JSFunction>()); | |
| 1392 } | 1389 } |
| 1393 | 1390 |
| 1394 | 1391 |
| 1395 static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) { | 1392 static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) { |
| 1396 KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode); | 1393 KeyedStoreIC::GenerateGeneric(masm, SLOPPY); |
| 1397 } | 1394 } |
| 1398 | 1395 |
| 1399 | 1396 |
| 1400 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { | 1397 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { |
| 1401 KeyedStoreIC::GenerateGeneric(masm, kStrictMode); | 1398 KeyedStoreIC::GenerateGeneric(masm, STRICT); |
| 1402 } | 1399 } |
| 1403 | 1400 |
| 1404 | 1401 |
| 1405 static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { | 1402 static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { |
| 1406 KeyedStoreIC::GenerateMiss(masm); | 1403 KeyedStoreIC::GenerateMiss(masm); |
| 1407 } | 1404 } |
| 1408 | 1405 |
| 1409 | 1406 |
| 1410 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { | 1407 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { |
| 1411 KeyedStoreIC::GenerateSlow(masm); | 1408 KeyedStoreIC::GenerateSlow(masm); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1425 static void Generate_KeyedStoreIC_PreMonomorphic(MacroAssembler* masm) { | 1422 static void Generate_KeyedStoreIC_PreMonomorphic(MacroAssembler* masm) { |
| 1426 KeyedStoreIC::GeneratePreMonomorphic(masm); | 1423 KeyedStoreIC::GeneratePreMonomorphic(masm); |
| 1427 } | 1424 } |
| 1428 | 1425 |
| 1429 | 1426 |
| 1430 static void Generate_KeyedStoreIC_PreMonomorphic_Strict(MacroAssembler* masm) { | 1427 static void Generate_KeyedStoreIC_PreMonomorphic_Strict(MacroAssembler* masm) { |
| 1431 KeyedStoreIC::GeneratePreMonomorphic(masm); | 1428 KeyedStoreIC::GeneratePreMonomorphic(masm); |
| 1432 } | 1429 } |
| 1433 | 1430 |
| 1434 | 1431 |
| 1435 static void Generate_KeyedStoreIC_NonStrictArguments(MacroAssembler* masm) { | 1432 static void Generate_KeyedStoreIC_SloppyArguments(MacroAssembler* masm) { |
| 1436 KeyedStoreIC::GenerateNonStrictArguments(masm); | 1433 KeyedStoreIC::GenerateSloppyArguments(masm); |
| 1437 } | 1434 } |
| 1438 | 1435 |
| 1439 | 1436 |
| 1440 #ifdef ENABLE_DEBUGGER_SUPPORT | 1437 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 1441 static void Generate_LoadIC_DebugBreak(MacroAssembler* masm) { | 1438 static void Generate_LoadIC_DebugBreak(MacroAssembler* masm) { |
| 1442 Debug::GenerateLoadICDebugBreak(masm); | 1439 Debug::GenerateLoadICDebugBreak(masm); |
| 1443 } | 1440 } |
| 1444 | 1441 |
| 1445 | 1442 |
| 1446 static void Generate_StoreIC_DebugBreak(MacroAssembler* masm) { | 1443 static void Generate_StoreIC_DebugBreak(MacroAssembler* masm) { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 } | 1738 } |
| 1742 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1739 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1743 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1740 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1744 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1741 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1745 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1742 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1746 #undef DEFINE_BUILTIN_ACCESSOR_C | 1743 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1747 #undef DEFINE_BUILTIN_ACCESSOR_A | 1744 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1748 | 1745 |
| 1749 | 1746 |
| 1750 } } // namespace v8::internal | 1747 } } // namespace v8::internal |
| OLD | NEW |