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

Side by Side Diff: src/x64/builtins-x64.cc

Issue 10442015: Rollback of r11638, r11636 on trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 7 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/version.cc ('k') | src/x64/code-stubs-x64.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 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 static void AllocateEmptyJSArray(MacroAssembler* masm, 970 static void AllocateEmptyJSArray(MacroAssembler* masm,
971 Register array_function, 971 Register array_function,
972 Register result, 972 Register result,
973 Register scratch1, 973 Register scratch1,
974 Register scratch2, 974 Register scratch2,
975 Register scratch3, 975 Register scratch3,
976 Label* gc_required) { 976 Label* gc_required) {
977 const int initial_capacity = JSArray::kPreallocatedArrayElements; 977 const int initial_capacity = JSArray::kPreallocatedArrayElements;
978 STATIC_ASSERT(initial_capacity >= 0); 978 STATIC_ASSERT(initial_capacity >= 0);
979 979
980 __ LoadInitialArrayMap(array_function, scratch2, scratch1, false); 980 __ LoadInitialArrayMap(array_function, scratch2, scratch1);
981 981
982 // Allocate the JSArray object together with space for a fixed array with the 982 // Allocate the JSArray object together with space for a fixed array with the
983 // requested elements. 983 // requested elements.
984 int size = JSArray::kSize; 984 int size = JSArray::kSize;
985 if (initial_capacity > 0) { 985 if (initial_capacity > 0) {
986 size += FixedArray::SizeFor(initial_capacity); 986 size += FixedArray::SizeFor(initial_capacity);
987 } 987 }
988 __ AllocateInNewSpace(size, 988 __ AllocateInNewSpace(size,
989 result, 989 result,
990 scratch2, 990 scratch2,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 // register elements_array is scratched. 1069 // register elements_array is scratched.
1070 static void AllocateJSArray(MacroAssembler* masm, 1070 static void AllocateJSArray(MacroAssembler* masm,
1071 Register array_function, // Array function. 1071 Register array_function, // Array function.
1072 Register array_size, // As a smi, cannot be 0. 1072 Register array_size, // As a smi, cannot be 0.
1073 Register result, 1073 Register result,
1074 Register elements_array, 1074 Register elements_array,
1075 Register elements_array_end, 1075 Register elements_array_end,
1076 Register scratch, 1076 Register scratch,
1077 bool fill_with_hole, 1077 bool fill_with_hole,
1078 Label* gc_required) { 1078 Label* gc_required) {
1079 __ LoadInitialArrayMap(array_function, scratch, 1079 __ LoadInitialArrayMap(array_function, scratch, elements_array);
1080 elements_array, fill_with_hole);
1081 1080
1082 if (FLAG_debug_code) { // Assert that array size is not zero. 1081 if (FLAG_debug_code) { // Assert that array size is not zero.
1083 __ testq(array_size, array_size); 1082 __ testq(array_size, array_size);
1084 __ Assert(not_zero, "array size is unexpectedly 0"); 1083 __ Assert(not_zero, "array size is unexpectedly 0");
1085 } 1084 }
1086 1085
1087 // Allocate the JSArray object together with space for a FixedArray with the 1086 // Allocate the JSArray object together with space for a FixedArray with the
1088 // requested elements. 1087 // requested elements.
1089 SmiIndex index = 1088 SmiIndex index =
1090 masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2); 1089 masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 // Double values are handled by the runtime. 1296 // Double values are handled by the runtime.
1298 __ CheckMap(r8, 1297 __ CheckMap(r8,
1299 masm->isolate()->factory()->heap_number_map(), 1298 masm->isolate()->factory()->heap_number_map(),
1300 &not_double, 1299 &not_double,
1301 DONT_DO_SMI_CHECK); 1300 DONT_DO_SMI_CHECK);
1302 __ bind(&cant_transition_map); 1301 __ bind(&cant_transition_map);
1303 __ UndoAllocationInNewSpace(rbx); 1302 __ UndoAllocationInNewSpace(rbx);
1304 __ jmp(call_generic_code); 1303 __ jmp(call_generic_code);
1305 1304
1306 __ bind(&not_double); 1305 __ bind(&not_double);
1307 // Transition FAST_SMI_ELEMENTS to FAST_ELEMENTS. 1306 // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS.
1308 // rbx: JSArray 1307 // rbx: JSArray
1309 __ movq(r11, FieldOperand(rbx, HeapObject::kMapOffset)); 1308 __ movq(r11, FieldOperand(rbx, HeapObject::kMapOffset));
1310 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 1309 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
1311 FAST_ELEMENTS, 1310 FAST_ELEMENTS,
1312 r11, 1311 r11,
1313 kScratchRegister, 1312 kScratchRegister,
1314 &cant_transition_map); 1313 &cant_transition_map);
1315 1314
1316 __ movq(FieldOperand(rbx, HeapObject::kMapOffset), r11); 1315 __ movq(FieldOperand(rbx, HeapObject::kMapOffset), r11);
1317 __ RecordWriteField(rbx, HeapObject::kMapOffset, r11, r8, 1316 __ RecordWriteField(rbx, HeapObject::kMapOffset, r11, r8,
1318 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 1317 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
1319 1318
1320 // Finish the array initialization loop. 1319 // Finish the array initialization loop.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1736 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1738 generator.Generate(); 1737 generator.Generate();
1739 } 1738 }
1740 1739
1741 1740
1742 #undef __ 1741 #undef __
1743 1742
1744 } } // namespace v8::internal 1743 } } // namespace v8::internal
1745 1744
1746 #endif // V8_TARGET_ARCH_X64 1745 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/version.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698