| 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/builtins.h" | 5 #include "src/builtins.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 4409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4420 DCHECK(!masm.has_frame()); | 4420 DCHECK(!masm.has_frame()); |
| 4421 g(&masm, functions[i].name, functions[i].extra_args); | 4421 g(&masm, functions[i].name, functions[i].extra_args); |
| 4422 // Move the code into the object heap. | 4422 // Move the code into the object heap. |
| 4423 CodeDesc desc; | 4423 CodeDesc desc; |
| 4424 masm.GetCode(&desc); | 4424 masm.GetCode(&desc); |
| 4425 Code::Flags flags = functions[i].flags; | 4425 Code::Flags flags = functions[i].flags; |
| 4426 Handle<Code> code = | 4426 Handle<Code> code = |
| 4427 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); | 4427 isolate->factory()->NewCode(desc, flags, masm.CodeObject()); |
| 4428 // Log the event and add the code to the builtins array. | 4428 // Log the event and add the code to the builtins array. |
| 4429 PROFILE(isolate, | 4429 PROFILE(isolate, |
| 4430 CodeCreateEvent(Logger::BUILTIN_TAG, *code, functions[i].s_name)); | 4430 CodeCreateEvent(Logger::BUILTIN_TAG, AbstractCode::cast(*code), |
| 4431 functions[i].s_name)); |
| 4431 builtins_[i] = *code; | 4432 builtins_[i] = *code; |
| 4432 code->set_builtin_index(i); | 4433 code->set_builtin_index(i); |
| 4433 #ifdef ENABLE_DISASSEMBLER | 4434 #ifdef ENABLE_DISASSEMBLER |
| 4434 if (FLAG_print_builtin_code) { | 4435 if (FLAG_print_builtin_code) { |
| 4435 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); | 4436 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); |
| 4436 OFStream os(trace_scope.file()); | 4437 OFStream os(trace_scope.file()); |
| 4437 os << "Builtin: " << functions[i].s_name << "\n"; | 4438 os << "Builtin: " << functions[i].s_name << "\n"; |
| 4438 code->Disassemble(functions[i].s_name, os); | 4439 code->Disassemble(functions[i].s_name, os); |
| 4439 os << "\n"; | 4440 os << "\n"; |
| 4440 } | 4441 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4506 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4507 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 4507 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4508 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 4508 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4509 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 4509 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4510 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 4510 #undef DEFINE_BUILTIN_ACCESSOR_C | 4511 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 4511 #undef DEFINE_BUILTIN_ACCESSOR_A | 4512 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 4512 | 4513 |
| 4513 | 4514 |
| 4514 } // namespace internal | 4515 } // namespace internal |
| 4515 } // namespace v8 | 4516 } // namespace v8 |
| OLD | NEW |