| 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()); | |
| 170 | 167 |
| 171 Handle<Code> new_object = GenerateCode(); | 168 Handle<Code> new_object = GenerateCode(); |
| 172 new_object->set_stub_key(GetKey()); | 169 new_object->set_stub_key(GetKey()); |
| 173 FinishCode(new_object); | 170 FinishCode(new_object); |
| 174 RecordCodeGeneration(new_object); | 171 RecordCodeGeneration(new_object); |
| 175 | 172 |
| 176 #ifdef ENABLE_DISASSEMBLER | 173 #ifdef ENABLE_DISASSEMBLER |
| 177 if (FLAG_print_code_stubs) { | 174 if (FLAG_print_code_stubs) { |
| 178 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); | 175 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); |
| 179 OFStream os(trace_scope.file()); | 176 OFStream os(trace_scope.file()); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 } | 1158 } |
| 1162 | 1159 |
| 1163 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) | 1160 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
| 1164 : PlatformCodeStub(isolate) {} | 1161 : PlatformCodeStub(isolate) {} |
| 1165 | 1162 |
| 1166 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) | 1163 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) |
| 1167 : PlatformCodeStub(isolate) {} | 1164 : PlatformCodeStub(isolate) {} |
| 1168 | 1165 |
| 1169 } // namespace internal | 1166 } // namespace internal |
| 1170 } // namespace v8 | 1167 } // namespace v8 |
| OLD | NEW |