OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 | 221 |
222 // Generate code to check that a global property cell is empty. Create | 222 // Generate code to check that a global property cell is empty. Create |
223 // the property cell at compilation time if no cell exists for the | 223 // the property cell at compilation time if no cell exists for the |
224 // property. | 224 // property. |
225 void PropertyHandlerCompiler::GenerateCheckPropertyCell( | 225 void PropertyHandlerCompiler::GenerateCheckPropertyCell( |
226 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, | 226 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, |
227 Register scratch, Label* miss) { | 227 Register scratch, Label* miss) { |
228 Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); | 228 Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); |
229 DCHECK(cell->value()->IsTheHole()); | 229 DCHECK(cell->value()->IsTheHole()); |
230 Handle<Oddball> the_hole = masm->isolate()->factory()->the_hole_value(); | 230 Factory* factory = masm->isolate()->factory(); |
231 if (masm->serializer_enabled()) { | 231 Handle<WeakCell> weak_cell = factory->NewWeakCell(cell); |
232 __ mov(scratch, Immediate(cell)); | 232 __ LoadWeakValue(scratch, weak_cell, miss); |
233 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), | 233 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), |
234 Immediate(the_hole)); | 234 Immediate(factory->the_hole_value())); |
235 } else { | |
236 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); | |
237 } | |
238 __ j(not_equal, miss); | 235 __ j(not_equal, miss); |
239 } | 236 } |
240 | 237 |
241 | 238 |
242 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( | 239 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
243 MacroAssembler* masm, Handle<HeapType> type, Register receiver, | 240 MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
244 Register holder, int accessor_index, int expected_arguments, | 241 Register holder, int accessor_index, int expected_arguments, |
245 Register scratch) { | 242 Register scratch) { |
246 // ----------- S t a t e ------------- | 243 // ----------- S t a t e ------------- |
247 // -- esp[0] : return address | 244 // -- esp[0] : return address |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 // Return the generated code. | 773 // Return the generated code. |
777 return GetCode(kind(), Code::NORMAL, name); | 774 return GetCode(kind(), Code::NORMAL, name); |
778 } | 775 } |
779 | 776 |
780 | 777 |
781 #undef __ | 778 #undef __ |
782 } | 779 } |
783 } // namespace v8::internal | 780 } // namespace v8::internal |
784 | 781 |
785 #endif // V8_TARGET_ARCH_X87 | 782 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |