| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // Return the generated code. | 772 // Return the generated code. |
| 776 return GetCode(kind(), Code::NORMAL, name); | 773 return GetCode(kind(), Code::NORMAL, name); |
| 777 } | 774 } |
| 778 | 775 |
| 779 | 776 |
| 780 #undef __ | 777 #undef __ |
| 781 } | 778 } |
| 782 } // namespace v8::internal | 779 } // namespace v8::internal |
| 783 | 780 |
| 784 #endif // V8_TARGET_ARCH_IA32 | 781 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |