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 g(&masm, functions[i].name, functions[i].extra_args); | 1619 { |
1620 NoCurrentFrameScope scope(&masm); | |
Søren Thygesen Gjesse
2011/05/31 07:51:45
This might deserve a comment.
Erik Corry
2011/05/31 11:52:52
Replaced with an assert that there is no current f
| |
1621 g(&masm, functions[i].name, functions[i].extra_args); | |
1622 } | |
1620 // Move the code into the object heap. | 1623 // Move the code into the object heap. |
1621 CodeDesc desc; | 1624 CodeDesc desc; |
1622 masm.GetCode(&desc); | 1625 masm.GetCode(&desc); |
1623 Code::Flags flags = functions[i].flags; | 1626 Code::Flags flags = functions[i].flags; |
1624 Object* code = NULL; | 1627 Object* code = NULL; |
1625 { | 1628 { |
1626 // During startup it's OK to always allocate and defer GC to later. | 1629 // During startup it's OK to always allocate and defer GC to later. |
1627 // This simplifies things because we don't need to retry. | 1630 // This simplifies things because we don't need to retry. |
1628 AlwaysAllocateScope __scope__; | 1631 AlwaysAllocateScope __scope__; |
1629 { MaybeObject* maybe_code = | 1632 { MaybeObject* maybe_code = |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1698 return Handle<Code>(code_address); \ | 1701 return Handle<Code>(code_address); \ |
1699 } | 1702 } |
1700 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1703 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1701 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1704 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1702 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1705 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1703 #undef DEFINE_BUILTIN_ACCESSOR_C | 1706 #undef DEFINE_BUILTIN_ACCESSOR_C |
1704 #undef DEFINE_BUILTIN_ACCESSOR_A | 1707 #undef DEFINE_BUILTIN_ACCESSOR_A |
1705 | 1708 |
1706 | 1709 |
1707 } } // namespace v8::internal | 1710 } } // namespace v8::internal |
OLD | NEW |