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 3883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3894 | 3894 |
3895 Load(args->at(0)); | 3895 Load(args->at(0)); |
3896 Load(args->at(1)); | 3896 Load(args->at(1)); |
3897 | 3897 |
3898 StringAddStub stub(NO_STRING_ADD_FLAGS); | 3898 StringAddStub stub(NO_STRING_ADD_FLAGS); |
3899 Result answer = frame_->CallStub(&stub, 2); | 3899 Result answer = frame_->CallStub(&stub, 2); |
3900 frame_->Push(&answer); | 3900 frame_->Push(&answer); |
3901 } | 3901 } |
3902 | 3902 |
3903 | 3903 |
| 3904 void CodeGenerator::GenerateSubString(ZoneList<Expression*>* args) { |
| 3905 ASSERT_EQ(2, args->length()); |
| 3906 |
| 3907 Load(args->at(0)); |
| 3908 Load(args->at(1)); |
| 3909 Load(args->at(2)); |
| 3910 |
| 3911 Result answer = frame_->CallRuntime(Runtime::kSubString, 3); |
| 3912 frame_->Push(&answer); |
| 3913 } |
| 3914 |
| 3915 |
3904 void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) { | 3916 void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) { |
3905 ASSERT(args->length() == 1); | 3917 ASSERT(args->length() == 1); |
3906 JumpTarget leave, null, function, non_function_constructor; | 3918 JumpTarget leave, null, function, non_function_constructor; |
3907 Load(args->at(0)); // Load the object. | 3919 Load(args->at(0)); // Load the object. |
3908 Result obj = frame_->Pop(); | 3920 Result obj = frame_->Pop(); |
3909 obj.ToRegister(); | 3921 obj.ToRegister(); |
3910 frame_->Spill(obj.reg()); | 3922 frame_->Spill(obj.reg()); |
3911 | 3923 |
3912 // If the object is a smi, we return null. | 3924 // If the object is a smi, we return null. |
3913 Condition is_smi = masm_->CheckSmi(obj.reg()); | 3925 Condition is_smi = masm_->CheckSmi(obj.reg()); |
(...skipping 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8050 masm.GetCode(&desc); | 8062 masm.GetCode(&desc); |
8051 // Call the function from C++. | 8063 // Call the function from C++. |
8052 return FUNCTION_CAST<ModuloFunction>(buffer); | 8064 return FUNCTION_CAST<ModuloFunction>(buffer); |
8053 } | 8065 } |
8054 | 8066 |
8055 #endif | 8067 #endif |
8056 | 8068 |
8057 #undef __ | 8069 #undef __ |
8058 | 8070 |
8059 } } // namespace v8::internal | 8071 } } // namespace v8::internal |
OLD | NEW |