Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 Register result = ToRegister(instr->result()); 1930 Register result = ToRegister(instr->result());
1931 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); 1931 __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
1932 if (instr->hydrogen()->check_hole_value()) { 1932 if (instr->hydrogen()->check_hole_value()) {
1933 __ cmp(result, Factory::the_hole_value()); 1933 __ cmp(result, Factory::the_hole_value());
1934 DeoptimizeIf(equal, instr->environment()); 1934 DeoptimizeIf(equal, instr->environment());
1935 } 1935 }
1936 } 1936 }
1937 1937
1938 1938
1939 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { 1939 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) {
1940 Register object = ToRegister(instr->temp1());
1941 Register scratch = ToRegister(instr->temp2());
1940 Register value = ToRegister(instr->InputAt(0)); 1942 Register value = ToRegister(instr->InputAt(0));
1941 Operand cell_operand = Operand::Cell(instr->hydrogen()->cell()); 1943 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell());
1942 1944
1943 // If the cell we are storing to contains the hole it could have 1945 // If the cell we are storing to contains the hole it could have
1944 // been deleted from the property dictionary. In that case, we need 1946 // been deleted from the property dictionary. In that case, we need
1945 // to update the property details in the property dictionary to mark 1947 // to update the property details in the property dictionary to mark
1946 // it as no longer deleted. We deoptimize in that case. 1948 // it as no longer deleted. We deoptimize in that case.
1947 if (instr->hydrogen()->check_hole_value()) { 1949 if (instr->hydrogen()->check_hole_value()) {
1948 __ cmp(cell_operand, Factory::the_hole_value()); 1950 __ cmp(Operand::Cell(cell_handle), Factory::the_hole_value());
1949 DeoptimizeIf(equal, instr->environment()); 1951 DeoptimizeIf(equal, instr->environment());
1950 } 1952 }
1951 1953
1952 // Store the value. 1954 // Store the value.
1953 __ mov(cell_operand, value); 1955 __ mov(object, Immediate(cell_handle));
1956 __ mov(FieldOperand(object, JSGlobalPropertyCell::kValueOffset), value);
1957
1958 NearLabel done;
1959 __ test(value, Immediate(kSmiTagMask));
1960 __ j(zero, &done);
1961 __ IncrementalMarkingRecordWrite(object, value, scratch);
Erik Corry 2011/02/22 12:27:19 This looks rather horrible in terms of some perfor
Vyacheslav Egorov (Chromium) 2011/02/23 14:31:46 Yes.
1962 __ bind(&done);
1963
1954 } 1964 }
1955 1965
1956 1966
1957 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 1967 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
1958 Register context = ToRegister(instr->context()); 1968 Register context = ToRegister(instr->context());
1959 Register result = ToRegister(instr->result()); 1969 Register result = ToRegister(instr->result());
1960 __ mov(result, ContextOperand(context, instr->slot_index())); 1970 __ mov(result, ContextOperand(context, instr->slot_index()));
1961 } 1971 }
1962 1972
1963 1973
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
3785 ASSERT(osr_pc_offset_ == -1); 3795 ASSERT(osr_pc_offset_ == -1);
3786 osr_pc_offset_ = masm()->pc_offset(); 3796 osr_pc_offset_ = masm()->pc_offset();
3787 } 3797 }
3788 3798
3789 3799
3790 #undef __ 3800 #undef __
3791 3801
3792 } } // namespace v8::internal 3802 } } // namespace v8::internal
3793 3803
3794 #endif // V8_TARGET_ARCH_IA32 3804 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698