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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 Handle<Code> CodeStub::GetCode() { | 89 Handle<Code> CodeStub::GetCode() { |
90 Isolate* isolate = Isolate::Current(); | 90 Isolate* isolate = Isolate::Current(); |
91 Factory* factory = isolate->factory(); | 91 Factory* factory = isolate->factory(); |
92 Heap* heap = isolate->heap(); | 92 Heap* heap = isolate->heap(); |
93 Code* code; | 93 Code* code; |
94 if (!FindCodeInCache(&code)) { | 94 if (!FindCodeInCache(&code)) { |
95 HandleScope scope(isolate); | 95 HandleScope scope(isolate); |
96 | 96 |
97 // Generate the new code. | 97 // Generate the new code. |
98 MacroAssembler masm(NULL, 256); | 98 MacroAssembler masm(isolate, NULL, 256); |
99 GenerateCode(&masm); | 99 GenerateCode(&masm); |
100 | 100 |
101 // Create the code object. | 101 // Create the code object. |
102 CodeDesc desc; | 102 CodeDesc desc; |
103 masm.GetCode(&desc); | 103 masm.GetCode(&desc); |
104 | 104 |
105 // Copy the generated code into a heap object. | 105 // Copy the generated code into a heap object. |
106 Code::Flags flags = Code::ComputeFlags( | 106 Code::Flags flags = Code::ComputeFlags( |
107 static_cast<Code::Kind>(GetCodeKind()), | 107 static_cast<Code::Kind>(GetCodeKind()), |
108 InLoop(), | 108 InLoop(), |
(...skipping 16 matching lines...) Expand all Loading... |
125 | 125 |
126 ASSERT(!NeedsImmovableCode() || heap->lo_space()->Contains(code)); | 126 ASSERT(!NeedsImmovableCode() || heap->lo_space()->Contains(code)); |
127 return Handle<Code>(code, isolate); | 127 return Handle<Code>(code, isolate); |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 MaybeObject* CodeStub::TryGetCode() { | 131 MaybeObject* CodeStub::TryGetCode() { |
132 Code* code; | 132 Code* code; |
133 if (!FindCodeInCache(&code)) { | 133 if (!FindCodeInCache(&code)) { |
134 // Generate the new code. | 134 // Generate the new code. |
135 MacroAssembler masm(NULL, 256); | 135 MacroAssembler masm(Isolate::Current(), NULL, 256); |
136 GenerateCode(&masm); | 136 GenerateCode(&masm); |
137 Heap* heap = masm.isolate()->heap(); | 137 Heap* heap = masm.isolate()->heap(); |
138 | 138 |
139 // Create the code object. | 139 // Create the code object. |
140 CodeDesc desc; | 140 CodeDesc desc; |
141 masm.GetCode(&desc); | 141 masm.GetCode(&desc); |
142 | 142 |
143 // Try to copy the generated code into a heap object. | 143 // Try to copy the generated code into a heap object. |
144 Code::Flags flags = Code::ComputeFlags( | 144 Code::Flags flags = Code::ComputeFlags( |
145 static_cast<Code::Kind>(GetCodeKind()), | 145 static_cast<Code::Kind>(GetCodeKind()), |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), | 231 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
232 "InstanceofStub%s%s%s", | 232 "InstanceofStub%s%s%s", |
233 args, | 233 args, |
234 inline_check, | 234 inline_check, |
235 return_true_false_object); | 235 return_true_false_object); |
236 return name_; | 236 return name_; |
237 } | 237 } |
238 | 238 |
239 | 239 |
240 } } // namespace v8::internal | 240 } } // namespace v8::internal |
OLD | NEW |