OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 // separate code object for each one. | 1609 // separate code object for each one. |
1610 for (int i = 0; i < builtin_count; i++) { | 1610 for (int i = 0; i < builtin_count; i++) { |
1611 if (create_heap_objects) { | 1611 if (create_heap_objects) { |
1612 MacroAssembler masm(isolate, buffer, sizeof buffer); | 1612 MacroAssembler masm(isolate, buffer, sizeof buffer); |
1613 // Generate the code/adaptor. | 1613 // Generate the code/adaptor. |
1614 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); | 1614 typedef void (*Generator)(MacroAssembler*, int, BuiltinExtraArguments); |
1615 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); | 1615 Generator g = FUNCTION_CAST<Generator>(functions[i].generator); |
1616 // We pass all arguments to the generator, but it may not use all of | 1616 // We pass all arguments to the generator, but it may not use all of |
1617 // them. This works because the first arguments are on top of the | 1617 // them. This works because the first arguments are on top of the |
1618 // stack. | 1618 // stack. |
| 1619 ASSERT(!masm.has_frame()); |
1619 g(&masm, functions[i].name, functions[i].extra_args); | 1620 g(&masm, functions[i].name, functions[i].extra_args); |
1620 // Move the code into the object heap. | 1621 // Move the code into the object heap. |
1621 CodeDesc desc; | 1622 CodeDesc desc; |
1622 masm.GetCode(&desc); | 1623 masm.GetCode(&desc); |
1623 Code::Flags flags = functions[i].flags; | 1624 Code::Flags flags = functions[i].flags; |
1624 Object* code = NULL; | 1625 Object* code = NULL; |
1625 { | 1626 { |
1626 // During startup it's OK to always allocate and defer GC to later. | 1627 // During startup it's OK to always allocate and defer GC to later. |
1627 // This simplifies things because we don't need to retry. | 1628 // This simplifies things because we don't need to retry. |
1628 AlwaysAllocateScope __scope__; | 1629 AlwaysAllocateScope __scope__; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 return Handle<Code>(code_address); \ | 1699 return Handle<Code>(code_address); \ |
1699 } | 1700 } |
1700 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1701 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1701 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1702 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1702 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1703 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1703 #undef DEFINE_BUILTIN_ACCESSOR_C | 1704 #undef DEFINE_BUILTIN_ACCESSOR_C |
1704 #undef DEFINE_BUILTIN_ACCESSOR_A | 1705 #undef DEFINE_BUILTIN_ACCESSOR_A |
1705 | 1706 |
1706 | 1707 |
1707 } } // namespace v8::internal | 1708 } } // namespace v8::internal |
OLD | NEW |