OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // Return the value (register r0). | 360 // Return the value (register r0). |
361 __ bind(&exit); | 361 __ bind(&exit); |
362 __ Ret(); | 362 __ Ret(); |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) { | 366 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) { |
367 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC); | 367 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC); |
368 Code* code = NULL; | 368 Code* code = NULL; |
369 if (kind == Code::LOAD_IC) { | 369 if (kind == Code::LOAD_IC) { |
370 code = Builtins::builtin(Builtins::LoadIC_Miss); | 370 code = Isolate::Current()->builtins()->builtin(Builtins::LoadIC_Miss); |
371 } else { | 371 } else { |
372 code = Builtins::builtin(Builtins::KeyedLoadIC_Miss); | 372 code = Isolate::Current()->builtins()->builtin(Builtins::KeyedLoadIC_Miss); |
373 } | 373 } |
374 | 374 |
375 Handle<Code> ic(code); | 375 Handle<Code> ic(code); |
376 __ Jump(ic, RelocInfo::CODE_TARGET); | 376 __ Jump(ic, RelocInfo::CODE_TARGET); |
377 } | 377 } |
378 | 378 |
379 | 379 |
380 static void GenerateCallFunction(MacroAssembler* masm, | 380 static void GenerateCallFunction(MacroAssembler* masm, |
381 Object* object, | 381 Object* object, |
382 const ParameterCount& arguments, | 382 const ParameterCount& arguments, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 __ add(sp, sp, Operand(1 * kPointerSize)); | 490 __ add(sp, sp, Operand(1 * kPointerSize)); |
491 __ stm(ia, sp, r5.bit() | r6.bit() | r7.bit()); | 491 __ stm(ia, sp, r5.bit() | r6.bit() | r7.bit()); |
492 __ sub(sp, sp, Operand(1 * kPointerSize)); | 492 __ sub(sp, sp, Operand(1 * kPointerSize)); |
493 | 493 |
494 // Set the number of arguments. | 494 // Set the number of arguments. |
495 __ mov(r0, Operand(argc + 4)); | 495 __ mov(r0, Operand(argc + 4)); |
496 | 496 |
497 // Jump to the fast api call builtin (tail call). | 497 // Jump to the fast api call builtin (tail call). |
498 Handle<Code> code = Handle<Code>( | 498 Handle<Code> code = Handle<Code>( |
499 Builtins::builtin(Builtins::FastHandleApiCall)); | 499 Isolate::Current()->builtins()->builtin(Builtins::FastHandleApiCall)); |
500 ParameterCount expected(0); | 500 ParameterCount expected(0); |
501 __ InvokeCode(code, expected, expected, | 501 __ InvokeCode(code, expected, expected, |
502 RelocInfo::CODE_TARGET, JUMP_FUNCTION); | 502 RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
503 } | 503 } |
504 | 504 |
505 | 505 |
506 class CallInterceptorCompiler BASE_EMBEDDED { | 506 class CallInterceptorCompiler BASE_EMBEDDED { |
507 public: | 507 public: |
508 CallInterceptorCompiler(StubCompiler* stub_compiler, | 508 CallInterceptorCompiler(StubCompiler* stub_compiler, |
509 const ParameterCount& arguments, | 509 const ParameterCount& arguments, |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 // ----------------------------------- | 1488 // ----------------------------------- |
1489 Label miss; | 1489 Label miss; |
1490 | 1490 |
1491 GenerateStoreField(masm(), | 1491 GenerateStoreField(masm(), |
1492 object, | 1492 object, |
1493 index, | 1493 index, |
1494 transition, | 1494 transition, |
1495 r1, r2, r3, | 1495 r1, r2, r3, |
1496 &miss); | 1496 &miss); |
1497 __ bind(&miss); | 1497 __ bind(&miss); |
1498 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1498 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 1499 Builtins::StoreIC_Miss)); |
1499 __ Jump(ic, RelocInfo::CODE_TARGET); | 1500 __ Jump(ic, RelocInfo::CODE_TARGET); |
1500 | 1501 |
1501 // Return the generated code. | 1502 // Return the generated code. |
1502 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 1503 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
1503 } | 1504 } |
1504 | 1505 |
1505 | 1506 |
1506 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, | 1507 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, |
1507 AccessorInfo* callback, | 1508 AccessorInfo* callback, |
1508 String* name) { | 1509 String* name) { |
(...skipping 27 matching lines...) Expand all Loading... |
1536 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback info | 1537 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback info |
1537 __ Push(ip, r2, r0); | 1538 __ Push(ip, r2, r0); |
1538 | 1539 |
1539 // Do tail-call to the runtime system. | 1540 // Do tail-call to the runtime system. |
1540 ExternalReference store_callback_property = | 1541 ExternalReference store_callback_property = |
1541 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 1542 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
1542 __ TailCallExternalReference(store_callback_property, 4, 1); | 1543 __ TailCallExternalReference(store_callback_property, 4, 1); |
1543 | 1544 |
1544 // Handle store cache miss. | 1545 // Handle store cache miss. |
1545 __ bind(&miss); | 1546 __ bind(&miss); |
1546 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1547 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 1548 Builtins::StoreIC_Miss)); |
1547 __ Jump(ic, RelocInfo::CODE_TARGET); | 1549 __ Jump(ic, RelocInfo::CODE_TARGET); |
1548 | 1550 |
1549 // Return the generated code. | 1551 // Return the generated code. |
1550 return GetCode(CALLBACKS, name); | 1552 return GetCode(CALLBACKS, name); |
1551 } | 1553 } |
1552 | 1554 |
1553 | 1555 |
1554 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, | 1556 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, |
1555 String* name) { | 1557 String* name) { |
1556 // ----------- S t a t e ------------- | 1558 // ----------- S t a t e ------------- |
(...skipping 24 matching lines...) Expand all Loading... |
1581 | 1583 |
1582 __ Push(r1, r2, r0); // Receiver, name, value. | 1584 __ Push(r1, r2, r0); // Receiver, name, value. |
1583 | 1585 |
1584 // Do tail-call to the runtime system. | 1586 // Do tail-call to the runtime system. |
1585 ExternalReference store_ic_property = | 1587 ExternalReference store_ic_property = |
1586 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 1588 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
1587 __ TailCallExternalReference(store_ic_property, 3, 1); | 1589 __ TailCallExternalReference(store_ic_property, 3, 1); |
1588 | 1590 |
1589 // Handle store cache miss. | 1591 // Handle store cache miss. |
1590 __ bind(&miss); | 1592 __ bind(&miss); |
1591 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1593 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 1594 Builtins::StoreIC_Miss)); |
1592 __ Jump(ic, RelocInfo::CODE_TARGET); | 1595 __ Jump(ic, RelocInfo::CODE_TARGET); |
1593 | 1596 |
1594 // Return the generated code. | 1597 // Return the generated code. |
1595 return GetCode(INTERCEPTOR, name); | 1598 return GetCode(INTERCEPTOR, name); |
1596 } | 1599 } |
1597 | 1600 |
1598 | 1601 |
1599 Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, | 1602 Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, |
1600 JSGlobalPropertyCell* cell, | 1603 JSGlobalPropertyCell* cell, |
1601 String* name) { | 1604 String* name) { |
(...skipping 13 matching lines...) Expand all Loading... |
1615 // Store the value in the cell. | 1618 // Store the value in the cell. |
1616 __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell))); | 1619 __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell))); |
1617 __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); | 1620 __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); |
1618 | 1621 |
1619 __ IncrementCounter(&Counters::named_store_global_inline, 1, r4, r3); | 1622 __ IncrementCounter(&Counters::named_store_global_inline, 1, r4, r3); |
1620 __ Ret(); | 1623 __ Ret(); |
1621 | 1624 |
1622 // Handle store cache miss. | 1625 // Handle store cache miss. |
1623 __ bind(&miss); | 1626 __ bind(&miss); |
1624 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r4, r3); | 1627 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r4, r3); |
1625 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1628 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 1629 Builtins::StoreIC_Miss)); |
1626 __ Jump(ic, RelocInfo::CODE_TARGET); | 1630 __ Jump(ic, RelocInfo::CODE_TARGET); |
1627 | 1631 |
1628 // Return the generated code. | 1632 // Return the generated code. |
1629 return GetCode(NORMAL, name); | 1633 return GetCode(NORMAL, name); |
1630 } | 1634 } |
1631 | 1635 |
1632 | 1636 |
1633 Object* LoadStubCompiler::CompileLoadNonexistent(String* name, | 1637 Object* LoadStubCompiler::CompileLoadNonexistent(String* name, |
1634 JSObject* object, | 1638 JSObject* object, |
1635 JSObject* last) { | 1639 JSObject* last) { |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1994 // the miss label is generated. | 1998 // the miss label is generated. |
1995 GenerateStoreField(masm(), | 1999 GenerateStoreField(masm(), |
1996 object, | 2000 object, |
1997 index, | 2001 index, |
1998 transition, | 2002 transition, |
1999 r2, r1, r3, | 2003 r2, r1, r3, |
2000 &miss); | 2004 &miss); |
2001 __ bind(&miss); | 2005 __ bind(&miss); |
2002 | 2006 |
2003 __ DecrementCounter(&Counters::keyed_store_field, 1, r3, r4); | 2007 __ DecrementCounter(&Counters::keyed_store_field, 1, r3, r4); |
2004 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); | 2008 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 2009 Builtins::KeyedStoreIC_Miss)); |
2005 | 2010 |
2006 __ Jump(ic, RelocInfo::CODE_TARGET); | 2011 __ Jump(ic, RelocInfo::CODE_TARGET); |
2007 | 2012 |
2008 // Return the generated code. | 2013 // Return the generated code. |
2009 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 2014 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
2010 } | 2015 } |
2011 | 2016 |
2012 | 2017 |
2013 Object* ConstructStubCompiler::CompileConstructStub( | 2018 Object* ConstructStubCompiler::CompileConstructStub( |
2014 SharedFunctionInfo* shared) { | 2019 SharedFunctionInfo* shared) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 // Remove caller arguments and receiver from the stack and return. | 2142 // Remove caller arguments and receiver from the stack and return. |
2138 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2)); | 2143 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2)); |
2139 __ add(sp, sp, Operand(kPointerSize)); | 2144 __ add(sp, sp, Operand(kPointerSize)); |
2140 __ IncrementCounter(&Counters::constructed_objects, 1, r1, r2); | 2145 __ IncrementCounter(&Counters::constructed_objects, 1, r1, r2); |
2141 __ IncrementCounter(&Counters::constructed_objects_stub, 1, r1, r2); | 2146 __ IncrementCounter(&Counters::constructed_objects_stub, 1, r1, r2); |
2142 __ Jump(lr); | 2147 __ Jump(lr); |
2143 | 2148 |
2144 // Jump to the generic stub in case the specialized code cannot handle the | 2149 // Jump to the generic stub in case the specialized code cannot handle the |
2145 // construction. | 2150 // construction. |
2146 __ bind(&generic_stub_call); | 2151 __ bind(&generic_stub_call); |
2147 Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric); | 2152 Code* code = Isolate::Current()->builtins()->builtin( |
| 2153 Builtins::JSConstructStubGeneric); |
2148 Handle<Code> generic_construct_stub(code); | 2154 Handle<Code> generic_construct_stub(code); |
2149 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 2155 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
2150 | 2156 |
2151 // Return the generated code. | 2157 // Return the generated code. |
2152 return GetCode(); | 2158 return GetCode(); |
2153 } | 2159 } |
2154 | 2160 |
2155 | 2161 |
2156 #undef __ | 2162 #undef __ |
2157 | 2163 |
2158 } } // namespace v8::internal | 2164 } } // namespace v8::internal |
2159 | 2165 |
2160 #endif // V8_TARGET_ARCH_ARM | 2166 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |