| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler-inl.h" | 10 #include "src/assembler-inl.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 Heap* heap = isolate()->heap(); | 157 Heap* heap = isolate()->heap(); |
| 158 Code* code; | 158 Code* code; |
| 159 if (UseSpecialCache() ? FindCodeInSpecialCache(&code) | 159 if (UseSpecialCache() ? FindCodeInSpecialCache(&code) |
| 160 : FindCodeInCache(&code)) { | 160 : FindCodeInCache(&code)) { |
| 161 DCHECK(GetCodeKind() == code->kind()); | 161 DCHECK(GetCodeKind() == code->kind()); |
| 162 return Handle<Code>(code); | 162 return Handle<Code>(code); |
| 163 } | 163 } |
| 164 | 164 |
| 165 { | 165 { |
| 166 HandleScope scope(isolate()); | 166 HandleScope scope(isolate()); |
| 167 // Canonicalize handles, so that we can share constant pool entries pointing |
| 168 // to code targets without dereferencing their handles. |
| 169 CanonicalHandleScope canonical(isolate()); |
| 167 | 170 |
| 168 Handle<Code> new_object = GenerateCode(); | 171 Handle<Code> new_object = GenerateCode(); |
| 169 new_object->set_stub_key(GetKey()); | 172 new_object->set_stub_key(GetKey()); |
| 170 FinishCode(new_object); | 173 FinishCode(new_object); |
| 171 RecordCodeGeneration(new_object); | 174 RecordCodeGeneration(new_object); |
| 172 | 175 |
| 173 #ifdef ENABLE_DISASSEMBLER | 176 #ifdef ENABLE_DISASSEMBLER |
| 174 if (FLAG_print_code_stubs) { | 177 if (FLAG_print_code_stubs) { |
| 175 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); | 178 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); |
| 176 OFStream os(trace_scope.file()); | 179 OFStream os(trace_scope.file()); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 } | 1161 } |
| 1159 | 1162 |
| 1160 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 1163 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
| 1161 : PlatformCodeStub(isolate) {} | 1164 : PlatformCodeStub(isolate) {} |
| 1162 | 1165 |
| 1163 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 1166 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
| 1164 : PlatformCodeStub(isolate) {} | 1167 : PlatformCodeStub(isolate) {} |
| 1165 | 1168 |
| 1166 } // namespace internal | 1169 } // namespace internal |
| 1167 } // namespace v8 | 1170 } // namespace v8 |
| OLD | NEW |