| 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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::GenerateLoadViaGetter( |
| 1324 masm, LoadStubCompiler::registers()[0], Handle<JSFunction>()); | 1324 masm, Handle<HeapType>::null(), |
| 1325 LoadStubCompiler::registers()[0], Handle<JSFunction>()); |
| 1325 } | 1326 } |
| 1326 | 1327 |
| 1327 | 1328 |
| 1328 static void Generate_LoadIC_Slow(MacroAssembler* masm) { | 1329 static void Generate_LoadIC_Slow(MacroAssembler* masm) { |
| 1329 LoadIC::GenerateRuntimeGetProperty(masm); | 1330 LoadIC::GenerateRuntimeGetProperty(masm); |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 | 1333 |
| 1333 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { | 1334 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { |
| 1334 KeyedLoadIC::GenerateInitialize(masm); | 1335 KeyedLoadIC::GenerateInitialize(masm); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 StoreIC::GenerateMiss(masm); | 1380 StoreIC::GenerateMiss(masm); |
| 1380 } | 1381 } |
| 1381 | 1382 |
| 1382 | 1383 |
| 1383 static void Generate_StoreIC_Normal(MacroAssembler* masm) { | 1384 static void Generate_StoreIC_Normal(MacroAssembler* masm) { |
| 1384 StoreIC::GenerateNormal(masm); | 1385 StoreIC::GenerateNormal(masm); |
| 1385 } | 1386 } |
| 1386 | 1387 |
| 1387 | 1388 |
| 1388 static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { | 1389 static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { |
| 1389 StoreStubCompiler::GenerateStoreViaSetter(masm, Handle<JSFunction>()); | 1390 StoreStubCompiler::GenerateStoreViaSetter( |
| 1391 masm, Handle<HeapType>::null(), Handle<JSFunction>()); |
| 1390 } | 1392 } |
| 1391 | 1393 |
| 1392 | 1394 |
| 1393 static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) { | 1395 static void Generate_KeyedStoreIC_Generic(MacroAssembler* masm) { |
| 1394 KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode); | 1396 KeyedStoreIC::GenerateGeneric(masm, kNonStrictMode); |
| 1395 } | 1397 } |
| 1396 | 1398 |
| 1397 | 1399 |
| 1398 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { | 1400 static void Generate_KeyedStoreIC_Generic_Strict(MacroAssembler* masm) { |
| 1399 KeyedStoreIC::GenerateGeneric(masm, kStrictMode); | 1401 KeyedStoreIC::GenerateGeneric(masm, kStrictMode); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1590 state, \ | 1592 state, \ |
| 1591 extra); \ | 1593 extra); \ |
| 1592 functions->extra_args = NO_EXTRA_ARGUMENTS; \ | 1594 functions->extra_args = NO_EXTRA_ARGUMENTS; \ |
| 1593 ++functions; | 1595 ++functions; |
| 1594 | 1596 |
| 1595 #define DEF_FUNCTION_PTR_H(aname, kind) \ | 1597 #define DEF_FUNCTION_PTR_H(aname, kind) \ |
| 1596 functions->generator = FUNCTION_ADDR(Generate_##aname); \ | 1598 functions->generator = FUNCTION_ADDR(Generate_##aname); \ |
| 1597 functions->c_code = NULL; \ | 1599 functions->c_code = NULL; \ |
| 1598 functions->s_name = #aname; \ | 1600 functions->s_name = #aname; \ |
| 1599 functions->name = k##aname; \ | 1601 functions->name = k##aname; \ |
| 1600 functions->flags = Code::ComputeFlags( \ | 1602 functions->flags = Code::ComputeHandlerFlags(Code::kind); \ |
| 1601 Code::HANDLER, MONOMORPHIC, kNoExtraICState, \ | |
| 1602 Code::NORMAL, Code::kind); \ | |
| 1603 functions->extra_args = NO_EXTRA_ARGUMENTS; \ | 1603 functions->extra_args = NO_EXTRA_ARGUMENTS; \ |
| 1604 ++functions; | 1604 ++functions; |
| 1605 | 1605 |
| 1606 BUILTIN_LIST_C(DEF_FUNCTION_PTR_C) | 1606 BUILTIN_LIST_C(DEF_FUNCTION_PTR_C) |
| 1607 BUILTIN_LIST_A(DEF_FUNCTION_PTR_A) | 1607 BUILTIN_LIST_A(DEF_FUNCTION_PTR_A) |
| 1608 BUILTIN_LIST_H(DEF_FUNCTION_PTR_H) | 1608 BUILTIN_LIST_H(DEF_FUNCTION_PTR_H) |
| 1609 BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A) | 1609 BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A) |
| 1610 | 1610 |
| 1611 #undef DEF_FUNCTION_PTR_C | 1611 #undef DEF_FUNCTION_PTR_C |
| 1612 #undef DEF_FUNCTION_PTR_A | 1612 #undef DEF_FUNCTION_PTR_A |
| 1613 } | 1613 } |
| 1614 | 1614 |
| 1615 | 1615 |
| 1616 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { | 1616 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { |
| 1617 ASSERT(!initialized_); | 1617 ASSERT(!initialized_); |
| 1618 Heap* heap = isolate->heap(); | 1618 Heap* heap = isolate->heap(); |
| 1619 | 1619 |
| 1620 // Create a scope for the handles in the builtins. | 1620 // Create a scope for the handles in the builtins. |
| 1621 HandleScope scope(isolate); | 1621 HandleScope scope(isolate); |
| 1622 | 1622 |
| 1623 const BuiltinDesc* functions = builtin_function_table.functions(); | 1623 const BuiltinDesc* functions = builtin_function_table.functions(); |
| 1624 | 1624 |
| 1625 // For now we generate builtin adaptor code into a stack-allocated | 1625 // For now we generate builtin adaptor code into a stack-allocated |
| 1626 // buffer, before copying it into individual code objects. Be careful | 1626 // buffer, before copying it into individual code objects. Be careful |
| 1627 // with alignment, some platforms don't like unaligned code. | 1627 // with alignment, some platforms don't like unaligned code. |
| 1628 union { int force_alignment; byte buffer[8*KB]; } u; | 1628 // TODO(jbramley): I had to increase the size of this buffer from 8KB because |
| 1629 // we can generate a lot of debug code on A64. |
| 1630 union { int force_alignment; byte buffer[16*KB]; } u; |
| 1629 | 1631 |
| 1630 // Traverse the list of builtins and generate an adaptor in a | 1632 // Traverse the list of builtins and generate an adaptor in a |
| 1631 // separate code object for each one. | 1633 // separate code object for each one. |
| 1632 for (int i = 0; i < builtin_count; i++) { | 1634 for (int i = 0; i < builtin_count; i++) { |
| 1633 if (create_heap_objects) { | 1635 if (create_heap_objects) { |
| 1634 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); | 1636 MacroAssembler masm(isolate, u.buffer, sizeof u.buffer); |
| 1635 // Generate the code/adaptor. | 1637 // Generate the code/adaptor. |
| 1636 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); | 1638 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); |
| 1637 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); | 1639 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); |
| 1638 // We pass all arguments to the generator, but it may not use all of | 1640 // We pass all arguments to the generator, but it may not use all of |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 } | 1741 } |
| 1740 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1742 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1741 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1743 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1742 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1744 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1743 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1745 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1744 #undef DEFINE_BUILTIN_ACCESSOR_C | 1746 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1745 #undef DEFINE_BUILTIN_ACCESSOR_A | 1747 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1746 | 1748 |
| 1747 | 1749 |
| 1748 } } // namespace v8::internal | 1750 } } // namespace v8::internal |
| OLD | NEW |