| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/base/atomic-utils.h" | 5 #include "src/base/atomic-utils.h" |
| 6 #include "src/macro-assembler.h" | 6 #include "src/macro-assembler.h" |
| 7 #include "src/objects.h" | 7 #include "src/objects.h" |
| 8 #include "src/property-descriptor.h" | 8 #include "src/property-descriptor.h" |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 258 } |
| 259 return true; | 259 return true; |
| 260 } | 260 } |
| 261 | 261 |
| 262 Handle<Code> CreatePlaceholder(Factory* factory, uint32_t index, | 262 Handle<Code> CreatePlaceholder(Factory* factory, uint32_t index, |
| 263 Code::Kind kind) { | 263 Code::Kind kind) { |
| 264 // Create a placeholder code object and encode the corresponding index in | 264 // Create a placeholder code object and encode the corresponding index in |
| 265 // the {constant_pool_offset} field of the code object. | 265 // the {constant_pool_offset} field of the code object. |
| 266 // TODO(titzer): placeholder code objects are somewhat dangerous. | 266 // TODO(titzer): placeholder code objects are somewhat dangerous. |
| 267 static byte buffer[] = {0, 0, 0, 0, 0, 0, 0, 0}; // fake instructions. | 267 static byte buffer[] = {0, 0, 0, 0, 0, 0, 0, 0}; // fake instructions. |
| 268 static CodeDesc desc = {buffer, 8, 8, 0, 0, nullptr}; | 268 static CodeDesc desc = {buffer, 8, 8, 0, 0, nullptr, 0, nullptr}; |
| 269 Handle<Code> code = factory->NewCode(desc, Code::KindField::encode(kind), | 269 Handle<Code> code = factory->NewCode(desc, Code::KindField::encode(kind), |
| 270 Handle<Object>::null()); | 270 Handle<Object>::null()); |
| 271 code->set_constant_pool_offset(static_cast<int>(index) + kPlaceholderMarker); | 271 code->set_constant_pool_offset(static_cast<int>(index) + kPlaceholderMarker); |
| 272 return code; | 272 return code; |
| 273 } | 273 } |
| 274 | 274 |
| 275 // TODO(mtrofin): remove when we stop relying on placeholders. | 275 // TODO(mtrofin): remove when we stop relying on placeholders. |
| 276 void InitializePlaceholders(Factory* factory, | 276 void InitializePlaceholders(Factory* factory, |
| 277 std::vector<Handle<Code>>* placeholders, | 277 std::vector<Handle<Code>>* placeholders, |
| 278 size_t size) { | 278 size_t size) { |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 Object* info = wasm->GetInternalField(kWasmDebugInfo); | 1122 Object* info = wasm->GetInternalField(kWasmDebugInfo); |
| 1123 if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); | 1123 if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); |
| 1124 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); | 1124 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); |
| 1125 wasm->SetInternalField(kWasmDebugInfo, *new_info); | 1125 wasm->SetInternalField(kWasmDebugInfo, *new_info); |
| 1126 return *new_info; | 1126 return *new_info; |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 } // namespace wasm | 1129 } // namespace wasm |
| 1130 } // namespace internal | 1130 } // namespace internal |
| 1131 } // namespace v8 | 1131 } // namespace v8 |
| OLD | NEW |