| 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 4015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4026 // chain (i.e., the static scope chain and runtime context chain do | 4026 // chain (i.e., the static scope chain and runtime context chain do |
| 4027 // not agree). A variable occurring in such a scope should have | 4027 // not agree). A variable occurring in such a scope should have |
| 4028 // slot type LOOKUP and not CONTEXT. | 4028 // slot type LOOKUP and not CONTEXT. |
| 4029 if (emit_debug_code()) { | 4029 if (emit_debug_code()) { |
| 4030 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), | 4030 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), |
| 4031 Heap::kWithContextMapRootIndex); | 4031 Heap::kWithContextMapRootIndex); |
| 4032 Check(not_equal, "Variable resolved to with context."); | 4032 Check(not_equal, "Variable resolved to with context."); |
| 4033 } | 4033 } |
| 4034 } | 4034 } |
| 4035 | 4035 |
| 4036 |
| 4037 void MacroAssembler::LoadGlobalInitialConstructedArrayMap( |
| 4038 Register function_in, Register scratch, Register map_out) { |
| 4039 ASSERT(!function_in.is(map_out)); |
| 4040 Label done; |
| 4041 movq(map_out, FieldOperand(function_in, |
| 4042 JSFunction::kPrototypeOrInitialMapOffset)); |
| 4043 if (!FLAG_smi_only_arrays) { |
| 4044 // Load the global or builtins object from the current context. |
| 4045 movq(scratch, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 4046 movq(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset)); |
| 4047 |
| 4048 // Check that the function's map is same as the cached map. |
| 4049 cmpq(map_out, |
| 4050 Operand(scratch, |
| 4051 Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX))); |
| 4052 j(not_equal, &done); |
| 4053 |
| 4054 // Use the cached transitioned map. |
| 4055 movq(map_out, |
| 4056 Operand(scratch, |
| 4057 Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX))); |
| 4058 } |
| 4059 bind(&done); |
| 4060 } |
| 4061 |
| 4036 #ifdef _WIN64 | 4062 #ifdef _WIN64 |
| 4037 static const int kRegisterPassedArguments = 4; | 4063 static const int kRegisterPassedArguments = 4; |
| 4038 #else | 4064 #else |
| 4039 static const int kRegisterPassedArguments = 6; | 4065 static const int kRegisterPassedArguments = 6; |
| 4040 #endif | 4066 #endif |
| 4041 | 4067 |
| 4042 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 4068 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
| 4043 // Load the global or builtins object from the current context. | 4069 // Load the global or builtins object from the current context. |
| 4044 movq(function, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 4070 movq(function, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 4045 // Load the global context from the global or builtins object. | 4071 // Load the global context from the global or builtins object. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4338 | 4364 |
| 4339 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); | 4365 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); |
| 4340 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); | 4366 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); |
| 4341 | 4367 |
| 4342 bind(&done); | 4368 bind(&done); |
| 4343 } | 4369 } |
| 4344 | 4370 |
| 4345 } } // namespace v8::internal | 4371 } } // namespace v8::internal |
| 4346 | 4372 |
| 4347 #endif // V8_TARGET_ARCH_X64 | 4373 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |