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

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

Issue 12314155: Allow direct allocation in old pointer space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 STATIC_ASSERT(initial_capacity >= 0); 994 STATIC_ASSERT(initial_capacity >= 0);
995 995
996 __ LoadInitialArrayMap(array_function, scratch2, scratch1, false); 996 __ LoadInitialArrayMap(array_function, scratch2, scratch1, false);
997 997
998 // Allocate the JSArray object together with space for a fixed array with the 998 // Allocate the JSArray object together with space for a fixed array with the
999 // requested elements. 999 // requested elements.
1000 int size = JSArray::kSize; 1000 int size = JSArray::kSize;
1001 if (initial_capacity > 0) { 1001 if (initial_capacity > 0) {
1002 size += FixedArray::SizeFor(initial_capacity); 1002 size += FixedArray::SizeFor(initial_capacity);
1003 } 1003 }
1004 __ AllocateInNewSpace(size, 1004 __ Allocate(size, result, scratch2, scratch3, gc_required, TAG_OBJECT);
1005 result,
1006 scratch2,
1007 scratch3,
1008 gc_required,
1009 TAG_OBJECT);
1010 1005
1011 // Allocated the JSArray. Now initialize the fields except for the elements 1006 // Allocated the JSArray. Now initialize the fields except for the elements
1012 // array. 1007 // array.
1013 // result: JSObject 1008 // result: JSObject
1014 // scratch1: initial map 1009 // scratch1: initial map
1015 // scratch2: start of next object 1010 // scratch2: start of next object
1016 __ mov(FieldOperand(result, JSObject::kMapOffset), scratch1); 1011 __ mov(FieldOperand(result, JSObject::kMapOffset), scratch1);
1017 Factory* factory = masm->isolate()->factory(); 1012 Factory* factory = masm->isolate()->factory();
1018 __ mov(FieldOperand(result, JSArray::kPropertiesOffset), 1013 __ mov(FieldOperand(result, JSArray::kPropertiesOffset),
1019 factory->empty_fixed_array()); 1014 factory->empty_fixed_array());
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 __ IncrementCounter(counters->string_ctor_cached_number(), 1); 1542 __ IncrementCounter(counters->string_ctor_cached_number(), 1);
1548 __ bind(&argument_is_string); 1543 __ bind(&argument_is_string);
1549 // ----------- S t a t e ------------- 1544 // ----------- S t a t e -------------
1550 // -- ebx : argument converted to string 1545 // -- ebx : argument converted to string
1551 // -- edi : constructor function 1546 // -- edi : constructor function
1552 // -- esp[0] : return address 1547 // -- esp[0] : return address
1553 // ----------------------------------- 1548 // -----------------------------------
1554 1549
1555 // Allocate a JSValue and put the tagged pointer into eax. 1550 // Allocate a JSValue and put the tagged pointer into eax.
1556 Label gc_required; 1551 Label gc_required;
1557 __ AllocateInNewSpace(JSValue::kSize, 1552 __ Allocate(JSValue::kSize,
1558 eax, // Result. 1553 eax, // Result.
1559 ecx, // New allocation top (we ignore it). 1554 ecx, // New allocation top (we ignore it).
1560 no_reg, 1555 no_reg,
1561 &gc_required, 1556 &gc_required,
1562 TAG_OBJECT); 1557 TAG_OBJECT);
1563 1558
1564 // Set the map. 1559 // Set the map.
1565 __ LoadGlobalFunctionInitialMap(edi, ecx); 1560 __ LoadGlobalFunctionInitialMap(edi, ecx);
1566 if (FLAG_debug_code) { 1561 if (FLAG_debug_code) {
1567 __ cmpb(FieldOperand(ecx, Map::kInstanceSizeOffset), 1562 __ cmpb(FieldOperand(ecx, Map::kInstanceSizeOffset),
1568 JSValue::kSize >> kPointerSizeLog2); 1563 JSValue::kSize >> kPointerSizeLog2);
1569 __ Assert(equal, "Unexpected string wrapper instance size"); 1564 __ Assert(equal, "Unexpected string wrapper instance size");
1570 __ cmpb(FieldOperand(ecx, Map::kUnusedPropertyFieldsOffset), 0); 1565 __ cmpb(FieldOperand(ecx, Map::kUnusedPropertyFieldsOffset), 0);
1571 __ Assert(equal, "Unexpected unused properties of string wrapper"); 1566 __ Assert(equal, "Unexpected unused properties of string wrapper");
1572 } 1567 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1819 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1825 generator.Generate(); 1820 generator.Generate();
1826 } 1821 }
1827 1822
1828 1823
1829 #undef __ 1824 #undef __
1830 } 1825 }
1831 } // namespace v8::internal 1826 } // namespace v8::internal
1832 1827
1833 #endif // V8_TARGET_ARCH_IA32 1828 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698