| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 *code_out = Code::cast(Heap::code_stubs()->ValueAt(index)); | 42 *code_out = Code::cast(Heap::code_stubs()->ValueAt(index)); |
| 43 return true; | 43 return true; |
| 44 } | 44 } |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 void CodeStub::GenerateCode(MacroAssembler* masm) { | 49 void CodeStub::GenerateCode(MacroAssembler* masm) { |
| 50 // Update the static counter each time a new code stub is generated. | 50 // Update the static counter each time a new code stub is generated. |
| 51 Counters::code_stubs.Increment(); | 51 Counters::code_stubs.Increment(); |
| 52 |
| 52 // Nested stubs are not allowed for leafs. | 53 // Nested stubs are not allowed for leafs. |
| 53 masm->set_allow_stub_calls(AllowsStubCalls()); | 54 AllowStubCallsScope allow_scope(masm, AllowsStubCalls()); |
| 55 |
| 54 // Generate the code for the stub. | 56 // Generate the code for the stub. |
| 55 masm->set_generating_stub(true); | 57 masm->set_generating_stub(true); |
| 56 Generate(masm); | 58 Generate(masm); |
| 57 } | 59 } |
| 58 | 60 |
| 59 | 61 |
| 60 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { | 62 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { |
| 61 code->set_major_key(MajorKey()); | 63 code->set_major_key(MajorKey()); |
| 62 | 64 |
| 63 OPROFILE(CreateNativeCodeRegion(GetName(), | 65 OPROFILE(CreateNativeCodeRegion(GetName(), |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), | 223 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
| 222 "InstanceofStub%s%s%s", | 224 "InstanceofStub%s%s%s", |
| 223 args, | 225 args, |
| 224 inline_check, | 226 inline_check, |
| 225 return_true_false_object); | 227 return_true_false_object); |
| 226 return name_; | 228 return name_; |
| 227 } | 229 } |
| 228 | 230 |
| 229 | 231 |
| 230 } } // namespace v8::internal | 232 } } // namespace v8::internal |
| OLD | NEW |