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 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 InLoopFlag in_loop, | 1494 InLoopFlag in_loop, |
1495 Code::Kind kind, | 1495 Code::Kind kind, |
1496 InlineCacheHolderFlag cache_holder) | 1496 InlineCacheHolderFlag cache_holder) |
1497 : arguments_(argc) | 1497 : arguments_(argc) |
1498 , in_loop_(in_loop) | 1498 , in_loop_(in_loop) |
1499 , kind_(kind) | 1499 , kind_(kind) |
1500 , cache_holder_(cache_holder) { | 1500 , cache_holder_(cache_holder) { |
1501 } | 1501 } |
1502 | 1502 |
1503 | 1503 |
1504 MaybeObject* CallStubCompiler::CompileCustomCall(int generator_id, | 1504 bool CallStubCompiler::HasCustomCallGenerator(BuiltinFunctionId id) { |
| 1505 #define CALL_GENERATOR_CASE(name) if (id == k##name) return true; |
| 1506 CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE) |
| 1507 #undef CALL_GENERATOR_CASE |
| 1508 return false; |
| 1509 } |
| 1510 |
| 1511 |
| 1512 MaybeObject* CallStubCompiler::CompileCustomCall(BuiltinFunctionId id, |
1505 Object* object, | 1513 Object* object, |
1506 JSObject* holder, | 1514 JSObject* holder, |
1507 JSGlobalPropertyCell* cell, | 1515 JSGlobalPropertyCell* cell, |
1508 JSFunction* function, | 1516 JSFunction* function, |
1509 String* fname) { | 1517 String* fname) { |
1510 ASSERT(generator_id >= 0 && generator_id < kNumCallGenerators); | 1518 #define CALL_GENERATOR_CASE(name) \ |
1511 switch (generator_id) { | 1519 if (id == k##name) { \ |
1512 #define CALL_GENERATOR_CASE(ignored1, ignored2, name) \ | 1520 return CallStubCompiler::Compile##name##Call(object, \ |
1513 case k##name##CallGenerator: \ | 1521 holder, \ |
1514 return CallStubCompiler::Compile##name##Call(object, \ | 1522 cell, \ |
1515 holder, \ | 1523 function, \ |
1516 cell, \ | 1524 fname); \ |
1517 function, \ | 1525 } |
1518 fname); | 1526 CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE) |
1519 CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE) | |
1520 #undef CALL_GENERATOR_CASE | 1527 #undef CALL_GENERATOR_CASE |
1521 } | 1528 ASSERT(!HasCustomCallGenerator(id)); |
1522 UNREACHABLE(); | |
1523 return Heap::undefined_value(); | 1529 return Heap::undefined_value(); |
1524 } | 1530 } |
1525 | 1531 |
1526 | 1532 |
1527 MaybeObject* CallStubCompiler::GetCode(PropertyType type, String* name) { | 1533 MaybeObject* CallStubCompiler::GetCode(PropertyType type, String* name) { |
1528 int argc = arguments_.immediate(); | 1534 int argc = arguments_.immediate(); |
1529 Code::Flags flags = Code::ComputeMonomorphicFlags(kind_, | 1535 Code::Flags flags = Code::ComputeMonomorphicFlags(kind_, |
1530 type, | 1536 type, |
1531 cache_holder_, | 1537 cache_holder_, |
1532 in_loop_, | 1538 in_loop_, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 expected_receiver_type_ = | 1624 expected_receiver_type_ = |
1619 FunctionTemplateInfo::cast(signature->receiver()); | 1625 FunctionTemplateInfo::cast(signature->receiver()); |
1620 } | 1626 } |
1621 } | 1627 } |
1622 | 1628 |
1623 is_simple_api_call_ = true; | 1629 is_simple_api_call_ = true; |
1624 } | 1630 } |
1625 | 1631 |
1626 | 1632 |
1627 } } // namespace v8::internal | 1633 } } // namespace v8::internal |
OLD | NEW |