Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 61623004: Add signed/unsigned 8-bit and 16-bit Representations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback and prepare to land Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/property-details.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after
3547 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); 3575 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top));
3548 j(greater, no_memento_found); 3576 j(greater, no_memento_found);
3549 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), 3577 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize),
3550 Immediate(isolate()->factory()->allocation_memento_map())); 3578 Immediate(isolate()->factory()->allocation_memento_map()));
3551 } 3579 }
3552 3580
3553 3581
3554 } } // namespace v8::internal 3582 } } // namespace v8::internal
3555 3583
3556 #endif // V8_TARGET_ARCH_IA32 3584 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698