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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // +1 for receiver. | 282 // +1 for receiver. |
283 Forget(arg_count + 1); | 283 Forget(arg_count + 1); |
284 ASSERT(cgen()->HasValidEntryRegisters()); | 284 ASSERT(cgen()->HasValidEntryRegisters()); |
285 ParameterCount count(arg_count); | 285 ParameterCount count(arg_count); |
286 __ InvokeFunction(r1, count, CALL_FUNCTION); | 286 __ InvokeFunction(r1, count, CALL_FUNCTION); |
287 // Restore the context. | 287 // Restore the context. |
288 __ ldr(cp, Context()); | 288 __ ldr(cp, Context()); |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 void VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) { | 292 void VirtualFrame::CallRuntime(const Runtime::Function* f, int arg_count) { |
293 SpillAll(); | 293 SpillAll(); |
294 Forget(arg_count); | 294 Forget(arg_count); |
295 ASSERT(cgen()->HasValidEntryRegisters()); | 295 ASSERT(cgen()->HasValidEntryRegisters()); |
296 __ CallRuntime(f, arg_count); | 296 __ CallRuntime(f, arg_count); |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) { | 300 void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) { |
301 SpillAll(); | 301 SpillAll(); |
302 Forget(arg_count); | 302 Forget(arg_count); |
(...skipping 12 matching lines...) Expand all Loading... |
315 | 315 |
316 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 316 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
317 InvokeJSFlags flags, | 317 InvokeJSFlags flags, |
318 int arg_count) { | 318 int arg_count) { |
319 Forget(arg_count); | 319 Forget(arg_count); |
320 __ InvokeBuiltin(id, flags); | 320 __ InvokeBuiltin(id, flags); |
321 } | 321 } |
322 | 322 |
323 | 323 |
324 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { | 324 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { |
325 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 325 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 326 Builtins::LoadIC_Initialize)); |
326 PopToR0(); | 327 PopToR0(); |
327 SpillAll(); | 328 SpillAll(); |
328 __ mov(r2, Operand(name)); | 329 __ mov(r2, Operand(name)); |
329 CallCodeObject(ic, mode, 0); | 330 CallCodeObject(ic, mode, 0); |
330 } | 331 } |
331 | 332 |
332 | 333 |
333 void VirtualFrame::CallStoreIC(Handle<String> name, bool is_contextual) { | 334 void VirtualFrame::CallStoreIC(Handle<String> name, bool is_contextual) { |
334 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | 335 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 336 Builtins::StoreIC_Initialize)); |
335 PopToR0(); | 337 PopToR0(); |
336 if (is_contextual) { | 338 if (is_contextual) { |
337 SpillAll(); | 339 SpillAll(); |
338 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 340 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
339 } else { | 341 } else { |
340 EmitPop(r1); | 342 EmitPop(r1); |
341 SpillAll(); | 343 SpillAll(); |
342 } | 344 } |
343 __ mov(r2, Operand(name)); | 345 __ mov(r2, Operand(name)); |
344 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 346 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
345 } | 347 } |
346 | 348 |
347 | 349 |
348 void VirtualFrame::CallKeyedLoadIC() { | 350 void VirtualFrame::CallKeyedLoadIC() { |
349 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 351 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 352 Builtins::KeyedLoadIC_Initialize)); |
350 PopToR1R0(); | 353 PopToR1R0(); |
351 SpillAll(); | 354 SpillAll(); |
352 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 355 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
353 } | 356 } |
354 | 357 |
355 | 358 |
356 void VirtualFrame::CallKeyedStoreIC() { | 359 void VirtualFrame::CallKeyedStoreIC() { |
357 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); | 360 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 361 Builtins::KeyedStoreIC_Initialize)); |
358 PopToR1R0(); | 362 PopToR1R0(); |
359 SpillAll(); | 363 SpillAll(); |
360 EmitPop(r2); | 364 EmitPop(r2); |
361 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 365 CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
362 } | 366 } |
363 | 367 |
364 | 368 |
365 void VirtualFrame::CallCodeObject(Handle<Code> code, | 369 void VirtualFrame::CallCodeObject(Handle<Code> code, |
366 RelocInfo::Mode rmode, | 370 RelocInfo::Mode rmode, |
367 int dropped_args) { | 371 int dropped_args) { |
368 switch (code->kind()) { | 372 switch (code->kind()) { |
369 case Code::CALL_IC: | 373 case Code::CALL_IC: |
370 case Code::KEYED_CALL_IC: | 374 case Code::KEYED_CALL_IC: |
371 case Code::FUNCTION: | 375 case Code::FUNCTION: |
372 break; | 376 break; |
373 case Code::KEYED_LOAD_IC: | 377 case Code::KEYED_LOAD_IC: |
374 case Code::LOAD_IC: | 378 case Code::LOAD_IC: |
375 case Code::KEYED_STORE_IC: | 379 case Code::KEYED_STORE_IC: |
376 case Code::STORE_IC: | 380 case Code::STORE_IC: |
377 ASSERT(dropped_args == 0); | 381 ASSERT(dropped_args == 0); |
378 break; | 382 break; |
379 case Code::BUILTIN: | 383 case Code::BUILTIN: |
380 ASSERT(*code == Builtins::builtin(Builtins::JSConstructCall)); | 384 ASSERT(*code == Isolate::Current()->builtins()->builtin( |
| 385 Builtins::JSConstructCall)); |
381 break; | 386 break; |
382 default: | 387 default: |
383 UNREACHABLE(); | 388 UNREACHABLE(); |
384 break; | 389 break; |
385 } | 390 } |
386 Forget(dropped_args); | 391 Forget(dropped_args); |
387 ASSERT(cgen()->HasValidEntryRegisters()); | 392 ASSERT(cgen()->HasValidEntryRegisters()); |
388 __ Call(code, rmode); | 393 __ Call(code, rmode); |
389 } | 394 } |
390 | 395 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 break; | 783 break; |
779 } | 784 } |
780 ASSERT(register_allocation_map_ == 0); // Not yet implemented. | 785 ASSERT(register_allocation_map_ == 0); // Not yet implemented. |
781 } | 786 } |
782 | 787 |
783 #undef __ | 788 #undef __ |
784 | 789 |
785 } } // namespace v8::internal | 790 } } // namespace v8::internal |
786 | 791 |
787 #endif // V8_TARGET_ARCH_ARM | 792 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |