OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2457 } else if (operand->IsRegister()) { | 2457 } else if (operand->IsRegister()) { |
2458 __ push(ToRegister(operand)); | 2458 __ push(ToRegister(operand)); |
2459 } else { | 2459 } else { |
2460 __ push(ToOperand(operand)); | 2460 __ push(ToOperand(operand)); |
2461 } | 2461 } |
2462 } | 2462 } |
2463 | 2463 |
2464 | 2464 |
2465 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the | 2465 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the |
2466 // prototype chain, which causes unbounded code generation. | 2466 // prototype chain, which causes unbounded code generation. |
2467 static bool CompactEmit( | 2467 static bool CompactEmit(SmallMapList* list, |
2468 SmallMapList* list, Handle<String> name, int i, Isolate* isolate) { | 2468 Handle<String> name, |
| 2469 int i, |
| 2470 Isolate* isolate) { |
| 2471 Handle<Map> map = list->at(i); |
| 2472 // If the map has ElementsKind transitions, we will generate map checks |
| 2473 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). |
| 2474 if (map->elements_transition_map() != NULL) return false; |
2469 LookupResult lookup(isolate); | 2475 LookupResult lookup(isolate); |
2470 Handle<Map> map = list->at(i); | |
2471 map->LookupInDescriptors(NULL, *name, &lookup); | 2476 map->LookupInDescriptors(NULL, *name, &lookup); |
2472 return lookup.IsField() || lookup.IsConstantFunction(); | 2477 return lookup.IsField() || lookup.IsConstantFunction(); |
2473 } | 2478 } |
2474 | 2479 |
2475 | 2480 |
2476 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2481 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
2477 Register object = ToRegister(instr->object()); | 2482 Register object = ToRegister(instr->object()); |
2478 Register result = ToRegister(instr->result()); | 2483 Register result = ToRegister(instr->result()); |
2479 | 2484 |
2480 int map_count = instr->hydrogen()->types()->length(); | 2485 int map_count = instr->hydrogen()->types()->length(); |
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5331 FixedArray::kHeaderSize - kPointerSize)); | 5336 FixedArray::kHeaderSize - kPointerSize)); |
5332 __ bind(&done); | 5337 __ bind(&done); |
5333 } | 5338 } |
5334 | 5339 |
5335 | 5340 |
5336 #undef __ | 5341 #undef __ |
5337 | 5342 |
5338 } } // namespace v8::internal | 5343 } } // namespace v8::internal |
5339 | 5344 |
5340 #endif // V8_TARGET_ARCH_IA32 | 5345 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |