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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 allow_stub_calls_(true), | 49 allow_stub_calls_(true), |
50 has_frame_(false) { | 50 has_frame_(false) { |
51 if (isolate() != NULL) { | 51 if (isolate() != NULL) { |
52 // TODO(titzer): should we just use a null handle here instead? | 52 // TODO(titzer): should we just use a null handle here instead? |
53 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), | 53 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), |
54 isolate()); | 54 isolate()); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 | 58 |
| 59 void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { |
| 60 ASSERT(!r.IsDouble()); |
| 61 if (r.IsInteger8()) { |
| 62 movsx_b(dst, src); |
| 63 } else if (r.IsUInteger8()) { |
| 64 movzx_b(dst, src); |
| 65 } else if (r.IsInteger16()) { |
| 66 movsx_w(dst, src); |
| 67 } else if (r.IsUInteger16()) { |
| 68 movzx_w(dst, src); |
| 69 } else { |
| 70 mov(dst, src); |
| 71 } |
| 72 } |
| 73 |
| 74 |
| 75 void MacroAssembler::Store(Register src, const Operand& dst, Representation r) { |
| 76 ASSERT(!r.IsDouble()); |
| 77 if (r.IsInteger8() || r.IsUInteger8()) { |
| 78 mov_b(dst, src); |
| 79 } else if (r.IsInteger16() || r.IsUInteger16()) { |
| 80 mov_w(dst, src); |
| 81 } else { |
| 82 mov(dst, src); |
| 83 } |
| 84 } |
| 85 |
| 86 |
59 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { | 87 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { |
60 if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) { | 88 if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) { |
61 Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); | 89 Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
62 mov(destination, value); | 90 mov(destination, value); |
63 return; | 91 return; |
64 } | 92 } |
65 ExternalReference roots_array_start = | 93 ExternalReference roots_array_start = |
66 ExternalReference::roots_array_start(isolate()); | 94 ExternalReference::roots_array_start(isolate()); |
67 mov(destination, Immediate(index)); | 95 mov(destination, Immediate(index)); |
68 mov(destination, Operand::StaticArray(destination, | 96 mov(destination, Operand::StaticArray(destination, |
(...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3569 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3597 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3570 j(equal, found); | 3598 j(equal, found); |
3571 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3599 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3572 cmp(current, Immediate(factory->null_value())); | 3600 cmp(current, Immediate(factory->null_value())); |
3573 j(not_equal, &loop_again); | 3601 j(not_equal, &loop_again); |
3574 } | 3602 } |
3575 | 3603 |
3576 } } // namespace v8::internal | 3604 } } // namespace v8::internal |
3577 | 3605 |
3578 #endif // V8_TARGET_ARCH_IA32 | 3606 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |