| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 void FastNewClosureStub::Generate(MacroAssembler* masm) { | 65 void FastNewClosureStub::Generate(MacroAssembler* masm) { |
| 66 // Create a new closure from the given function info in new | 66 // Create a new closure from the given function info in new |
| 67 // space. Set the context to the current context in esi. | 67 // space. Set the context to the current context in esi. |
| 68 Label gc; | 68 Label gc; |
| 69 __ AllocateInNewSpace(JSFunction::kSize, eax, ebx, ecx, &gc, TAG_OBJECT); | 69 __ AllocateInNewSpace(JSFunction::kSize, eax, ebx, ecx, &gc, TAG_OBJECT); |
| 70 | 70 |
| 71 // Get the function info from the stack. | 71 // Get the function info from the stack. |
| 72 __ mov(edx, Operand(esp, 1 * kPointerSize)); | 72 __ mov(edx, Operand(esp, 1 * kPointerSize)); |
| 73 | 73 |
| 74 int map_index = strict_mode_ == kStrictMode | 74 int map_index = (language_mode_ == CLASSIC_MODE) |
| 75 ? Context::STRICT_MODE_FUNCTION_MAP_INDEX | 75 ? Context::FUNCTION_MAP_INDEX |
| 76 : Context::FUNCTION_MAP_INDEX; | 76 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; |
| 77 | 77 |
| 78 // Compute the function map in the current global context and set that | 78 // Compute the function map in the current global context and set that |
| 79 // as the map of the allocated object. | 79 // as the map of the allocated object. |
| 80 __ mov(ecx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 80 __ mov(ecx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 81 __ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalContextOffset)); | 81 __ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalContextOffset)); |
| 82 __ mov(ecx, Operand(ecx, Context::SlotOffset(map_index))); | 82 __ mov(ecx, Operand(ecx, Context::SlotOffset(map_index))); |
| 83 __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); | 83 __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); |
| 84 | 84 |
| 85 // Initialize the rest of the function. We don't have to update the | 85 // Initialize the rest of the function. We don't have to update the |
| 86 // write barrier because the allocated object is in new space. | 86 // write barrier because the allocated object is in new space. |
| (...skipping 7020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7107 false); | 7107 false); |
| 7108 __ pop(edx); | 7108 __ pop(edx); |
| 7109 __ ret(0); | 7109 __ ret(0); |
| 7110 } | 7110 } |
| 7111 | 7111 |
| 7112 #undef __ | 7112 #undef __ |
| 7113 | 7113 |
| 7114 } } // namespace v8::internal | 7114 } } // namespace v8::internal |
| 7115 | 7115 |
| 7116 #endif // V8_TARGET_ARCH_IA32 | 7116 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |