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/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 __ mov(scratch, Immediate(cell)); | 394 __ mov(scratch, Immediate(cell)); |
395 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), | 395 __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), |
396 Immediate(the_hole)); | 396 Immediate(the_hole)); |
397 } else { | 397 } else { |
398 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); | 398 __ cmp(Operand::ForCell(cell), Immediate(the_hole)); |
399 } | 399 } |
400 __ j(not_equal, miss); | 400 __ j(not_equal, miss); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 void NamedStoreHandlerCompiler::GenerateNegativeHolderLookup( | |
405 MacroAssembler* masm, Handle<JSObject> holder, Register holder_reg, | |
406 Handle<Name> name, Label* miss) { | |
407 if (holder->IsJSGlobalObject()) { | |
408 GenerateCheckPropertyCell( | |
409 masm, Handle<JSGlobalObject>::cast(holder), name, scratch1(), miss); | |
410 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) { | |
411 GenerateDictionaryNegativeLookup( | |
412 masm, miss, holder_reg, name, scratch1(), scratch2()); | |
413 } | |
414 } | |
415 | |
416 | |
417 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if | 404 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if |
418 // store is successful. | 405 // store is successful. |
419 void NamedStoreHandlerCompiler::GenerateStoreTransition( | 406 void NamedStoreHandlerCompiler::GenerateStoreTransition( |
420 MacroAssembler* masm, LookupResult* lookup, Handle<Map> transition, | 407 MacroAssembler* masm, LookupResult* lookup, Handle<Map> transition, |
421 Handle<Name> name, Register receiver_reg, Register storage_reg, | 408 Handle<Name> name, Register receiver_reg, Register storage_reg, |
422 Register value_reg, Register scratch1, Register scratch2, Register unused, | 409 Register value_reg, Register scratch1, Register scratch2, Register unused, |
423 Label* miss_label, Label* slow) { | 410 Label* miss_label, Label* slow) { |
424 int descriptor = transition->LastAdded(); | 411 int descriptor = transition->LastAdded(); |
425 DescriptorArray* descriptors = transition->instance_descriptors(); | 412 DescriptorArray* descriptors = transition->instance_descriptors(); |
426 PropertyDetails details = descriptors->GetDetails(descriptor); | 413 PropertyDetails details = descriptors->GetDetails(descriptor); |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 } | 1148 } |
1162 } | 1149 } |
1163 __ bind(&miss); | 1150 __ bind(&miss); |
1164 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1151 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1165 | 1152 |
1166 // Return the generated code. | 1153 // Return the generated code. |
1167 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 1154 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
1168 } | 1155 } |
1169 | 1156 |
1170 | 1157 |
1171 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( | |
1172 Handle<Name> name) { | |
1173 NonexistentFrontend(name); | |
1174 | |
1175 // Return undefined if maps of the full prototype chain are still the | |
1176 // same and no global property with this name contains a value. | |
1177 __ mov(eax, isolate()->factory()->undefined_value()); | |
1178 __ ret(0); | |
1179 | |
1180 // Return the generated code. | |
1181 return GetCode(kind(), Code::FAST, name); | |
1182 } | |
1183 | |
1184 | |
1185 Register* PropertyAccessCompiler::load_calling_convention() { | 1158 Register* PropertyAccessCompiler::load_calling_convention() { |
1186 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1159 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1187 Register receiver = LoadIC::ReceiverRegister(); | 1160 Register receiver = LoadIC::ReceiverRegister(); |
1188 Register name = LoadIC::NameRegister(); | 1161 Register name = LoadIC::NameRegister(); |
1189 static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; | 1162 static Register registers[] = { receiver, name, ebx, eax, edi, no_reg }; |
1190 return registers; | 1163 return registers; |
1191 } | 1164 } |
1192 | 1165 |
1193 | 1166 |
1194 Register* PropertyAccessCompiler::store_calling_convention() { | 1167 Register* PropertyAccessCompiler::store_calling_convention() { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 // ----------------------------------- | 1354 // ----------------------------------- |
1382 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1355 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1383 } | 1356 } |
1384 | 1357 |
1385 | 1358 |
1386 #undef __ | 1359 #undef __ |
1387 | 1360 |
1388 } } // namespace v8::internal | 1361 } } // namespace v8::internal |
1389 | 1362 |
1390 #endif // V8_TARGET_ARCH_X87 | 1363 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |