OLD | NEW |
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 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 DeoptimizeIf(ne, instr->environment()); | 2503 DeoptimizeIf(ne, instr->environment()); |
2504 } | 2504 } |
2505 | 2505 |
2506 | 2506 |
2507 void LCodeGen::LoadPrototype(Register result, | 2507 void LCodeGen::LoadPrototype(Register result, |
2508 Handle<JSObject> prototype) { | 2508 Handle<JSObject> prototype) { |
2509 if (Heap::InNewSpace(*prototype)) { | 2509 if (Heap::InNewSpace(*prototype)) { |
2510 Handle<JSGlobalPropertyCell> cell = | 2510 Handle<JSGlobalPropertyCell> cell = |
2511 Factory::NewJSGlobalPropertyCell(prototype); | 2511 Factory::NewJSGlobalPropertyCell(prototype); |
2512 __ mov(result, Operand(cell)); | 2512 __ mov(result, Operand(cell)); |
| 2513 __ ldr(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset)); |
2513 } else { | 2514 } else { |
2514 __ mov(result, Operand(prototype)); | 2515 __ mov(result, Operand(prototype)); |
2515 } | 2516 } |
2516 } | 2517 } |
2517 | 2518 |
2518 | 2519 |
2519 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 2520 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
2520 Register temp1 = ToRegister(instr->temp1()); | 2521 Register temp1 = ToRegister(instr->temp1()); |
2521 Register temp2 = ToRegister(instr->temp2()); | 2522 Register temp2 = ToRegister(instr->temp2()); |
2522 | 2523 |
2523 Handle<JSObject> holder = instr->holder(); | 2524 Handle<JSObject> holder = instr->holder(); |
2524 Handle<Map> receiver_map = instr->receiver_map(); | 2525 Handle<JSObject> current_prototype = instr->prototype(); |
2525 Handle<JSObject> current_prototype(JSObject::cast(receiver_map->prototype())); | |
2526 | 2526 |
2527 // Load prototype object. | 2527 // Load prototype object. |
2528 LoadPrototype(temp1, current_prototype); | 2528 LoadPrototype(temp1, current_prototype); |
2529 | 2529 |
2530 // Check prototype maps up to the holder. | 2530 // Check prototype maps up to the holder. |
2531 while (!current_prototype.is_identical_to(holder)) { | 2531 while (!current_prototype.is_identical_to(holder)) { |
2532 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); | 2532 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); |
2533 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); | 2533 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); |
2534 DeoptimizeIf(ne, instr->environment()); | 2534 DeoptimizeIf(ne, instr->environment()); |
2535 current_prototype = | 2535 current_prototype = |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2830 | 2830 |
2831 | 2831 |
2832 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2832 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2833 Abort("DoOsrEntry unimplemented."); | 2833 Abort("DoOsrEntry unimplemented."); |
2834 } | 2834 } |
2835 | 2835 |
2836 | 2836 |
2837 #undef __ | 2837 #undef __ |
2838 | 2838 |
2839 } } // namespace v8::internal | 2839 } } // namespace v8::internal |
OLD | NEW |