| 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 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 break; | 1936 break; |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 } else if (var->mode() != Variable::CONST) { | 1939 } else if (var->mode() != Variable::CONST) { |
| 1940 // Perform the assignment for non-const variables. Const assignments | 1940 // Perform the assignment for non-const variables. Const assignments |
| 1941 // are simply skipped. | 1941 // are simply skipped. |
| 1942 Slot* slot = var->rewrite(); | 1942 Slot* slot = var->rewrite(); |
| 1943 switch (slot->type()) { | 1943 switch (slot->type()) { |
| 1944 case Slot::PARAMETER: | 1944 case Slot::PARAMETER: |
| 1945 case Slot::LOCAL: | 1945 case Slot::LOCAL: |
| 1946 if (FLAG_debug_code && op == Token::INIT_LET) { |
| 1947 // Check for an uninitialized let binding. |
| 1948 __ lw(a1, MemOperand(fp, SlotOffset(slot))); |
| 1949 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); |
| 1950 __ Check(eq, "Let binding re-initialization.", a1, Operand(t0)); |
| 1951 } |
| 1946 // Perform the assignment. | 1952 // Perform the assignment. |
| 1947 __ sw(result_register(), MemOperand(fp, SlotOffset(slot))); | 1953 __ sw(result_register(), MemOperand(fp, SlotOffset(slot))); |
| 1948 break; | 1954 break; |
| 1949 | 1955 |
| 1950 case Slot::CONTEXT: { | 1956 case Slot::CONTEXT: { |
| 1951 MemOperand target = EmitSlotSearch(slot, a1); | 1957 MemOperand target = EmitSlotSearch(slot, a1); |
| 1958 if (FLAG_debug_code && op == Token::INIT_LET) { |
| 1959 // Check for an uninitialized let binding. |
| 1960 __ lw(a3, target); |
| 1961 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); |
| 1962 __ Check(eq, "Let binding re-initialization.", a3, Operand(t0)); |
| 1963 } |
| 1952 // Perform the assignment and issue the write barrier. | 1964 // Perform the assignment and issue the write barrier. |
| 1953 __ sw(result_register(), target); | 1965 __ sw(result_register(), target); |
| 1954 // RecordWrite may destroy all its register arguments. | 1966 // RecordWrite may destroy all its register arguments. |
| 1955 __ mov(a3, result_register()); | 1967 __ mov(a3, result_register()); |
| 1956 int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize; | 1968 int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize; |
| 1957 __ RecordWrite(a1, Operand(offset), a2, a3); | 1969 __ RecordWrite(a1, Operand(offset), a2, a3); |
| 1958 break; | 1970 break; |
| 1959 } | 1971 } |
| 1960 | 1972 |
| 1961 case Slot::LOOKUP: | 1973 case Slot::LOOKUP: |
| 1974 ASSERT(op != Token::INIT_LET); |
| 1962 // Call the runtime for the assignment. | 1975 // Call the runtime for the assignment. |
| 1963 __ push(v0); // Value. | 1976 __ push(v0); // Value. |
| 1964 __ li(a1, Operand(slot->var()->name())); | 1977 __ li(a1, Operand(slot->var()->name())); |
| 1965 __ li(a0, Operand(Smi::FromInt(strict_mode_flag()))); | 1978 __ li(a0, Operand(Smi::FromInt(strict_mode_flag()))); |
| 1966 __ Push(cp, a1, a0); // Context, name, strict mode. | 1979 __ Push(cp, a1, a0); // Context, name, strict mode. |
| 1967 __ CallRuntime(Runtime::kStoreContextSlot, 4); | 1980 __ CallRuntime(Runtime::kStoreContextSlot, 4); |
| 1968 break; | 1981 break; |
| 1969 | 1982 |
| 1970 case Slot::GLOBAL: | 1983 case Slot::GLOBAL: |
| 1971 UNREACHABLE(); | 1984 UNREACHABLE(); |
| (...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4326 *context_length = 0; | 4339 *context_length = 0; |
| 4327 return previous_; | 4340 return previous_; |
| 4328 } | 4341 } |
| 4329 | 4342 |
| 4330 | 4343 |
| 4331 #undef __ | 4344 #undef __ |
| 4332 | 4345 |
| 4333 } } // namespace v8::internal | 4346 } } // namespace v8::internal |
| 4334 | 4347 |
| 4335 #endif // V8_TARGET_ARCH_MIPS | 4348 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |