OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 case Slot::LOCAL: | 64 case Slot::LOCAL: |
65 offset += JavaScriptFrameConstants::kLocal0Offset; | 65 offset += JavaScriptFrameConstants::kLocal0Offset; |
66 break; | 66 break; |
67 default: | 67 default: |
68 UNREACHABLE(); | 68 UNREACHABLE(); |
69 } | 69 } |
70 return offset; | 70 return offset; |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 void FastCodeGenerator::Move(Location destination, Location source) { | |
75 switch (destination.type()) { | |
76 case Location::UNINITIALIZED: | |
77 UNREACHABLE(); | |
78 | |
79 case Location::EFFECT: | |
80 break; | |
81 | |
82 case Location::VALUE: | |
83 switch (source.type()) { | |
84 case Location::UNINITIALIZED: // Fall through. | |
85 case Location::EFFECT: | |
86 UNREACHABLE(); | |
87 case Location::VALUE: | |
88 break; | |
89 } | |
90 break; | |
91 } | |
92 } | |
93 | |
94 | |
95 // All platform macro assemblers in {ia32,x64,arm} have a push(Register) | 74 // All platform macro assemblers in {ia32,x64,arm} have a push(Register) |
96 // function. | 75 // function. |
97 void FastCodeGenerator::Move(Location destination, Register source) { | 76 void FastCodeGenerator::Move(Location destination, Register source) { |
98 switch (destination.type()) { | 77 switch (destination.type()) { |
99 case Location::UNINITIALIZED: | 78 case Location::kUninitialized: |
100 UNREACHABLE(); | 79 UNREACHABLE(); |
101 case Location::EFFECT: | 80 case Location::kEffect: |
102 break; | 81 break; |
103 case Location::VALUE: | 82 case Location::kValue: |
104 masm_->push(source); | 83 masm_->push(source); |
105 break; | 84 break; |
106 } | 85 } |
107 } | 86 } |
108 | 87 |
109 | 88 |
110 // All platform macro assemblers in {ia32,x64,arm} have a pop(Register) | 89 // All platform macro assemblers in {ia32,x64,arm} have a pop(Register) |
111 // function. | 90 // function. |
112 void FastCodeGenerator::Move(Register destination, Location source) { | 91 void FastCodeGenerator::Move(Register destination, Location source) { |
113 switch (source.type()) { | 92 switch (source.type()) { |
114 case Location::UNINITIALIZED: // Fall through. | 93 case Location::kUninitialized: // Fall through. |
115 case Location::EFFECT: | 94 case Location::kEffect: |
116 UNREACHABLE(); | 95 UNREACHABLE(); |
117 case Location::VALUE: | 96 case Location::kValue: |
118 masm_->pop(destination); | 97 masm_->pop(destination); |
119 } | 98 } |
120 } | 99 } |
121 | 100 |
122 | 101 |
123 void FastCodeGenerator::VisitDeclarations( | 102 void FastCodeGenerator::VisitDeclarations( |
124 ZoneList<Declaration*>* declarations) { | 103 ZoneList<Declaration*>* declarations) { |
125 int length = declarations->length(); | 104 int length = declarations->length(); |
126 int globals = 0; | 105 int globals = 0; |
127 for (int i = 0; i < length; i++) { | 106 for (int i = 0; i < length; i++) { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 UNREACHABLE(); | 351 UNREACHABLE(); |
373 } | 352 } |
374 | 353 |
375 | 354 |
376 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 355 void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
377 UNREACHABLE(); | 356 UNREACHABLE(); |
378 } | 357 } |
379 | 358 |
380 | 359 |
381 } } // namespace v8::internal | 360 } } // namespace v8::internal |
OLD | NEW |