| 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/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/code-events.h" | 6 #include "src/code-events.h" |
| 7 #include "src/compiler/code-assembler.h" | 7 #include "src/compiler/code-assembler.h" |
| 8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
| 9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate, | 82 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate, |
| 83 CodeAssemblerGenerator generator, int argc, | 83 CodeAssemblerGenerator generator, int argc, |
| 84 Code::Flags flags, const char* name) { | 84 Code::Flags flags, const char* name) { |
| 85 HandleScope scope(isolate); | 85 HandleScope scope(isolate); |
| 86 Zone zone(isolate->allocator(), ZONE_NAME); | 86 Zone zone(isolate->allocator(), ZONE_NAME); |
| 87 const int argc_with_recv = | 87 const int argc_with_recv = |
| 88 (argc == SharedFunctionInfo::kDontAdaptArgumentsSentinel) ? 0 : argc + 1; | 88 (argc == SharedFunctionInfo::kDontAdaptArgumentsSentinel) ? 0 : argc + 1; |
| 89 compiler::CodeAssemblerState state(isolate, &zone, argc_with_recv, flags, | 89 compiler::CodeAssemblerState state(isolate, &zone, argc_with_recv, flags, |
| 90 name); | 90 name); |
| 91 generator(&state); | 91 generator(&state); |
| 92 Handle<Code> code = | 92 Handle<Code> code = compiler::CodeAssembler::GenerateCode(&state); |
| 93 compiler::CodeAssembler::GenerateCode(&state, FLAG_csa_verify); | |
| 94 PostBuildProfileAndTracing(isolate, *code, name); | 93 PostBuildProfileAndTracing(isolate, *code, name); |
| 95 return *code; | 94 return *code; |
| 96 } | 95 } |
| 97 | 96 |
| 98 // Builder for builtins implemented in TurboFan with CallStub linkage. | 97 // Builder for builtins implemented in TurboFan with CallStub linkage. |
| 99 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, | 98 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, |
| 100 CodeAssemblerGenerator generator, | 99 CodeAssemblerGenerator generator, |
| 101 CallDescriptors::Key interface_descriptor, | 100 CallDescriptors::Key interface_descriptor, |
| 102 Code::Flags flags, const char* name) { | 101 Code::Flags flags, const char* name) { |
| 103 HandleScope scope(isolate); | 102 HandleScope scope(isolate); |
| 104 Zone zone(isolate->allocator(), ZONE_NAME); | 103 Zone zone(isolate->allocator(), ZONE_NAME); |
| 105 // The interface descriptor with given key must be initialized at this point | 104 // The interface descriptor with given key must be initialized at this point |
| 106 // and this construction just queries the details from the descriptors table. | 105 // and this construction just queries the details from the descriptors table. |
| 107 CallInterfaceDescriptor descriptor(isolate, interface_descriptor); | 106 CallInterfaceDescriptor descriptor(isolate, interface_descriptor); |
| 108 // Ensure descriptor is already initialized. | 107 // Ensure descriptor is already initialized. |
| 109 DCHECK_LE(0, descriptor.GetRegisterParameterCount()); | 108 DCHECK_LE(0, descriptor.GetRegisterParameterCount()); |
| 110 compiler::CodeAssemblerState state(isolate, &zone, descriptor, flags, name); | 109 compiler::CodeAssemblerState state(isolate, &zone, descriptor, flags, name); |
| 111 generator(&state); | 110 generator(&state); |
| 112 Handle<Code> code = | 111 Handle<Code> code = compiler::CodeAssembler::GenerateCode(&state); |
| 113 compiler::CodeAssembler::GenerateCode(&state, FLAG_csa_verify); | |
| 114 PostBuildProfileAndTracing(isolate, *code, name); | 112 PostBuildProfileAndTracing(isolate, *code, name); |
| 115 return *code; | 113 return *code; |
| 116 } | 114 } |
| 117 } // anonymous namespace | 115 } // anonymous namespace |
| 118 | 116 |
| 119 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { | 117 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { |
| 120 DCHECK(!initialized_); | 118 DCHECK(!initialized_); |
| 121 | 119 |
| 122 // Create a scope for the handles in the builtins. | 120 // Create a scope for the handles in the builtins. |
| 123 HandleScope scope(isolate); | 121 HandleScope scope(isolate); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // TODO(jochen): Remove this. | 289 // TODO(jochen): Remove this. |
| 292 if (responsible_context.is_null()) { | 290 if (responsible_context.is_null()) { |
| 293 return true; | 291 return true; |
| 294 } | 292 } |
| 295 if (*responsible_context == target->context()) return true; | 293 if (*responsible_context == target->context()) return true; |
| 296 return isolate->MayAccess(responsible_context, target_global_proxy); | 294 return isolate->MayAccess(responsible_context, target_global_proxy); |
| 297 } | 295 } |
| 298 | 296 |
| 299 } // namespace internal | 297 } // namespace internal |
| 300 } // namespace v8 | 298 } // namespace v8 |
| OLD | NEW |