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