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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 315 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
316 InvokeJSFlags flags, | 316 InvokeJSFlags flags, |
317 int arg_count) { | 317 int arg_count) { |
318 Forget(arg_count); | 318 Forget(arg_count); |
319 __ InvokeBuiltin(id, flags); | 319 __ InvokeBuiltin(id, flags); |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { | 323 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { |
324 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 324 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
325 Builtins::LoadIC_Initialize)); | 325 Builtins::kLoadIC_Initialize)); |
326 PopToR0(); | 326 PopToR0(); |
327 SpillAll(); | 327 SpillAll(); |
328 __ mov(r2, Operand(name)); | 328 __ mov(r2, Operand(name)); |
329 CallCodeObject(ic, mode, 0); | 329 CallCodeObject(ic, mode, 0); |
330 } | 330 } |
331 | 331 |
332 | 332 |
333 void VirtualFrame::CallStoreIC(Handle<String> name, | 333 void VirtualFrame::CallStoreIC(Handle<String> name, |
334 bool is_contextual, | 334 bool is_contextual, |
335 StrictModeFlag strict_mode) { | 335 StrictModeFlag strict_mode) { |
336 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 336 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
337 (strict_mode == kStrictMode) ? Builtins::StoreIC_Initialize_Strict | 337 (strict_mode == kStrictMode) ? Builtins::kStoreIC_Initialize_Strict |
338 : Builtins::StoreIC_Initialize)); | 338 : Builtins::kStoreIC_Initialize)); |
339 PopToR0(); | 339 PopToR0(); |
340 RelocInfo::Mode mode; | 340 RelocInfo::Mode mode; |
341 if (is_contextual) { | 341 if (is_contextual) { |
342 SpillAll(); | 342 SpillAll(); |
343 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 343 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
344 mode = RelocInfo::CODE_TARGET_CONTEXT; | 344 mode = RelocInfo::CODE_TARGET_CONTEXT; |
345 } else { | 345 } else { |
346 EmitPop(r1); | 346 EmitPop(r1); |
347 SpillAll(); | 347 SpillAll(); |
348 mode = RelocInfo::CODE_TARGET; | 348 mode = RelocInfo::CODE_TARGET; |
349 } | 349 } |
350 __ mov(r2, Operand(name)); | 350 __ mov(r2, Operand(name)); |
351 CallCodeObject(ic, mode, 0); | 351 CallCodeObject(ic, mode, 0); |
352 } | 352 } |
353 | 353 |
354 | 354 |
355 void VirtualFrame::CallKeyedLoadIC() { | 355 void VirtualFrame::CallKeyedLoadIC() { |
356 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 356 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
357 Builtins::KeyedLoadIC_Initialize)); | 357 Builtins::kKeyedLoadIC_Initialize)); |
358 PopToR1R0(); | 358 PopToR1R0(); |
359 SpillAll(); | 359 SpillAll(); |
360 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 360 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
361 } | 361 } |
362 | 362 |
363 | 363 |
364 void VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) { | 364 void VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) { |
365 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 365 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
366 (strict_mode == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict | 366 (strict_mode == kStrictMode) ? Builtins::kKeyedStoreIC_Initialize_Strict |
367 : Builtins::KeyedStoreIC_Initialize)); | 367 : Builtins::kKeyedStoreIC_Initialize)); |
368 PopToR1R0(); | 368 PopToR1R0(); |
369 SpillAll(); | 369 SpillAll(); |
370 EmitPop(r2); | 370 EmitPop(r2); |
371 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 371 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
372 } | 372 } |
373 | 373 |
374 | 374 |
375 void VirtualFrame::CallCodeObject(Handle<Code> code, | 375 void VirtualFrame::CallCodeObject(Handle<Code> code, |
376 RelocInfo::Mode rmode, | 376 RelocInfo::Mode rmode, |
377 int dropped_args) { | 377 int dropped_args) { |
378 switch (code->kind()) { | 378 switch (code->kind()) { |
379 case Code::CALL_IC: | 379 case Code::CALL_IC: |
380 case Code::KEYED_CALL_IC: | 380 case Code::KEYED_CALL_IC: |
381 case Code::FUNCTION: | 381 case Code::FUNCTION: |
382 break; | 382 break; |
383 case Code::KEYED_LOAD_IC: | 383 case Code::KEYED_LOAD_IC: |
384 case Code::LOAD_IC: | 384 case Code::LOAD_IC: |
385 case Code::KEYED_STORE_IC: | 385 case Code::KEYED_STORE_IC: |
386 case Code::STORE_IC: | 386 case Code::STORE_IC: |
387 ASSERT(dropped_args == 0); | 387 ASSERT(dropped_args == 0); |
388 break; | 388 break; |
389 case Code::BUILTIN: | 389 case Code::BUILTIN: |
390 ASSERT(*code == Isolate::Current()->builtins()->builtin( | 390 ASSERT(*code == Isolate::Current()->builtins()->builtin( |
391 Builtins::JSConstructCall)); | 391 Builtins::kJSConstructCall)); |
392 break; | 392 break; |
393 default: | 393 default: |
394 UNREACHABLE(); | 394 UNREACHABLE(); |
395 break; | 395 break; |
396 } | 396 } |
397 Forget(dropped_args); | 397 Forget(dropped_args); |
398 ASSERT(cgen()->HasValidEntryRegisters()); | 398 ASSERT(cgen()->HasValidEntryRegisters()); |
399 __ Call(code, rmode); | 399 __ Call(code, rmode); |
400 } | 400 } |
401 | 401 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 break; | 834 break; |
835 } | 835 } |
836 ASSERT(register_allocation_map_ == 0); // Not yet implemented. | 836 ASSERT(register_allocation_map_ == 0); // Not yet implemented. |
837 } | 837 } |
838 | 838 |
839 #undef __ | 839 #undef __ |
840 | 840 |
841 } } // namespace v8::internal | 841 } } // namespace v8::internal |
842 | 842 |
843 #endif // V8_TARGET_ARCH_ARM | 843 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |