| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 __ cmp(r1, Operand(JS_ARRAY_TYPE)); | 144 __ cmp(r1, Operand(JS_ARRAY_TYPE)); |
| 145 __ b(ne, &miss); | 145 __ b(ne, &miss); |
| 146 | 146 |
| 147 // Load length directly from the JS array. | 147 // Load length directly from the JS array. |
| 148 __ ldr(r0, FieldMemOperand(r0, JSArray::kLengthOffset)); | 148 __ ldr(r0, FieldMemOperand(r0, JSArray::kLengthOffset)); |
| 149 __ Ret(); | 149 __ Ret(); |
| 150 | 150 |
| 151 // Cache miss: Jump to runtime. | 151 // Cache miss: Jump to runtime. |
| 152 __ bind(&miss); | 152 __ bind(&miss); |
| 153 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 153 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
| 154 __ Jump(ic, code_target); | 154 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 155 } | 155 } |
| 156 | 156 |
| 157 | 157 |
| 158 void LoadIC::GenerateShortStringLength(MacroAssembler* masm) { | 158 void LoadIC::GenerateShortStringLength(MacroAssembler* masm) { |
| 159 // ----------- S t a t e ------------- | 159 // ----------- S t a t e ------------- |
| 160 // -- r2 : name | 160 // -- r2 : name |
| 161 // -- lr : return address | 161 // -- lr : return address |
| 162 // -- [sp] : receiver | 162 // -- [sp] : receiver |
| 163 // ----------------------------------- | 163 // ----------------------------------- |
| 164 | 164 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 180 | 180 |
| 181 // Load length directly from the string. | 181 // Load length directly from the string. |
| 182 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); | 182 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); |
| 183 __ mov(r0, Operand(r0, LSR, String::kShortLengthShift)); | 183 __ mov(r0, Operand(r0, LSR, String::kShortLengthShift)); |
| 184 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 184 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
| 185 __ Ret(); | 185 __ Ret(); |
| 186 | 186 |
| 187 // Cache miss: Jump to runtime. | 187 // Cache miss: Jump to runtime. |
| 188 __ bind(&miss); | 188 __ bind(&miss); |
| 189 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 189 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
| 190 __ Jump(ic, code_target); | 190 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 191 } | 191 } |
| 192 | 192 |
| 193 | 193 |
| 194 void LoadIC::GenerateMediumStringLength(MacroAssembler* masm) { | 194 void LoadIC::GenerateMediumStringLength(MacroAssembler* masm) { |
| 195 // ----------- S t a t e ------------- | 195 // ----------- S t a t e ------------- |
| 196 // -- r2 : name | 196 // -- r2 : name |
| 197 // -- lr : return address | 197 // -- lr : return address |
| 198 // -- [sp] : receiver | 198 // -- [sp] : receiver |
| 199 // ----------------------------------- | 199 // ----------------------------------- |
| 200 | 200 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 215 | 215 |
| 216 // Load length directly from the string. | 216 // Load length directly from the string. |
| 217 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); | 217 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); |
| 218 __ mov(r0, Operand(r0, LSR, String::kMediumLengthShift)); | 218 __ mov(r0, Operand(r0, LSR, String::kMediumLengthShift)); |
| 219 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 219 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
| 220 __ Ret(); | 220 __ Ret(); |
| 221 | 221 |
| 222 // Cache miss: Jump to runtime. | 222 // Cache miss: Jump to runtime. |
| 223 __ bind(&miss); | 223 __ bind(&miss); |
| 224 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 224 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
| 225 __ Jump(ic, code_target); | 225 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 void LoadIC::GenerateLongStringLength(MacroAssembler* masm) { | 229 void LoadIC::GenerateLongStringLength(MacroAssembler* masm) { |
| 230 // ----------- S t a t e ------------- | 230 // ----------- S t a t e ------------- |
| 231 // -- r2 : name | 231 // -- r2 : name |
| 232 // -- lr : return address | 232 // -- lr : return address |
| 233 // -- [sp] : receiver | 233 // -- [sp] : receiver |
| 234 // ----------------------------------- | 234 // ----------------------------------- |
| 235 | 235 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 249 | 249 |
| 250 // Load length directly from the string. | 250 // Load length directly from the string. |
| 251 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); | 251 __ ldr(r0, FieldMemOperand(r0, String::kLengthOffset)); |
| 252 __ mov(r0, Operand(r0, LSR, String::kLongLengthShift)); | 252 __ mov(r0, Operand(r0, LSR, String::kLongLengthShift)); |
| 253 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 253 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
| 254 __ Ret(); | 254 __ Ret(); |
| 255 | 255 |
| 256 // Cache miss: Jump to runtime. | 256 // Cache miss: Jump to runtime. |
| 257 __ bind(&miss); | 257 __ bind(&miss); |
| 258 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 258 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
| 259 __ Jump(ic, code_target); | 259 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 260 } | 260 } |
| 261 | 261 |
| 262 | 262 |
| 263 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { | 263 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { |
| 264 // ----------- S t a t e ------------- | 264 // ----------- S t a t e ------------- |
| 265 // -- r2 : name | 265 // -- r2 : name |
| 266 // -- lr : return address | 266 // -- lr : return address |
| 267 // -- [sp] : receiver | 267 // -- [sp] : receiver |
| 268 // ----------------------------------- | 268 // ----------------------------------- |
| 269 | 269 |
| 270 // NOTE: Right now, this code always misses on ARM which is | 270 // NOTE: Right now, this code always misses on ARM which is |
| 271 // sub-optimal. We should port the fast case code from IA-32. | 271 // sub-optimal. We should port the fast case code from IA-32. |
| 272 | 272 |
| 273 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); | 273 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss)); |
| 274 __ Jump(ic, code_target); | 274 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 275 } | 275 } |
| 276 | 276 |
| 277 | 277 |
| 278 // Defined in ic.cc. | 278 // Defined in ic.cc. |
| 279 Object* CallIC_Miss(Arguments args); | 279 Object* CallIC_Miss(Arguments args); |
| 280 | 280 |
| 281 void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 281 void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { |
| 282 // ----------- S t a t e ------------- | 282 // ----------- S t a t e ------------- |
| 283 // -- lr: return address | 283 // -- lr: return address |
| 284 // ----------------------------------- | 284 // ----------------------------------- |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 | 573 |
| 574 // Perform tail call to the entry. | 574 // Perform tail call to the entry. |
| 575 __ TailCallRuntime(f, 3); | 575 __ TailCallRuntime(f, 3); |
| 576 } | 576 } |
| 577 | 577 |
| 578 | 578 |
| 579 #undef __ | 579 #undef __ |
| 580 | 580 |
| 581 | 581 |
| 582 } } // namespace v8::internal | 582 } } // namespace v8::internal |
| OLD | NEW |