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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 | 279 |
280 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { | 280 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { |
281 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 281 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
282 } | 282 } |
283 | 283 |
284 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { | 284 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { |
285 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 285 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
286 } | 286 } |
287 | 287 |
| 288 |
288 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 289 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 290 // ----------- S t a t e ------------- |
| 291 // -- rcx : name |
| 292 // -- rsp[0] : return address |
| 293 // -- rsp[8] : receiver |
| 294 // ----------------------------------- |
| 295 |
| 296 __ movq(rax, Operand(rsp, kPointerSize)); |
| 297 |
| 298 // Probe the stub cache. |
| 299 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, |
| 300 NOT_IN_LOOP, |
| 301 MONOMORPHIC); |
| 302 StubCache::GenerateProbe(masm, flags, rax, rcx, rbx, rdx); |
| 303 |
| 304 // Cache miss: Jump to runtime. |
289 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 305 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
290 } | 306 } |
291 | 307 |
| 308 |
292 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 309 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| 310 // ----------- S t a t e ------------- |
| 311 // -- rcx : name |
| 312 // -- rsp[0] : return address |
| 313 // -- rsp[8] : receiver |
| 314 // ----------------------------------- |
| 315 |
293 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 316 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
294 } | 317 } |
295 | 318 |
296 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 319 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
297 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 320 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
298 } | 321 } |
299 | 322 |
300 void LoadIC::GenerateStringLength(MacroAssembler* masm) { | 323 void LoadIC::GenerateStringLength(MacroAssembler* masm) { |
301 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 324 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
302 } | 325 } |
303 | 326 |
304 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int index) { | 327 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int index) { |
305 UNIMPLEMENTED(); | 328 // TODO(X64): Implement this function. Until then, the code is not patched. |
306 return false; | 329 return false; |
307 } | 330 } |
308 | 331 |
309 void StoreIC::Generate(MacroAssembler* masm, ExternalReference const& f) { | 332 void StoreIC::Generate(MacroAssembler* masm, ExternalReference const& f) { |
310 // ----------- S t a t e ------------- | 333 // ----------- S t a t e ------------- |
311 // -- rax : value | 334 // -- rax : value |
312 // -- rcx : name | 335 // -- rcx : name |
313 // -- rsp[0] : return address | 336 // -- rsp[0] : return address |
314 // -- rsp[8] : receiver | 337 // -- rsp[8] : receiver |
315 // ----------------------------------- | 338 // ----------------------------------- |
(...skipping 14 matching lines...) Expand all Loading... |
330 | 353 |
331 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 354 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
332 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 355 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
333 } | 356 } |
334 | 357 |
335 | 358 |
336 #undef __ | 359 #undef __ |
337 | 360 |
338 | 361 |
339 } } // namespace v8::internal | 362 } } // namespace v8::internal |
OLD | NEW |