Chromium Code Reviews| 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/wasm/wasm-objects.h" | 5 #include "src/wasm/wasm-objects.h" |
| 6 #include "src/utils.h" | 6 #include "src/utils.h" |
| 7 | 7 |
| 8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
| 9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 #endif // DEBUG | 215 #endif // DEBUG |
| 216 | 216 |
| 217 } // namespace | 217 } // namespace |
| 218 | 218 |
| 219 Handle<WasmModuleObject> WasmModuleObject::New( | 219 Handle<WasmModuleObject> WasmModuleObject::New( |
| 220 Isolate* isolate, Handle<WasmCompiledModule> compiled_module) { | 220 Isolate* isolate, Handle<WasmCompiledModule> compiled_module) { |
| 221 ModuleOrigin origin = compiled_module->module()->origin; | 221 ModuleOrigin origin = compiled_module->module()->origin; |
| 222 | 222 |
| 223 Handle<JSObject> module_object; | 223 Handle<JSObject> module_object; |
| 224 if (origin == ModuleOrigin::kWasmOrigin) { | 224 if (origin == ModuleOrigin::kWasmOrigin) { |
| 225 Handle<JSFunction> module_cons( | 225 Handle<Context> ctx = isolate->native_context(); |
|
jbroman
2017/03/13 18:53:38
remove separate change (I assume debugging code)?
Mircea Trofin
2017/03/15 18:02:28
Done.
| |
| 226 isolate->native_context()->wasm_module_constructor()); | 226 Handle<JSFunction> module_cons(ctx->wasm_module_constructor()); |
| 227 module_object = isolate->factory()->NewJSObject(module_cons); | 227 module_object = isolate->factory()->NewJSObject(module_cons); |
| 228 Handle<Symbol> module_sym(isolate->native_context()->wasm_module_sym()); | 228 Handle<Symbol> module_sym(isolate->native_context()->wasm_module_sym()); |
| 229 Object::SetProperty(module_object, module_sym, module_object, STRICT) | 229 Object::SetProperty(module_object, module_sym, module_object, STRICT) |
| 230 .Check(); | 230 .Check(); |
| 231 } else { | 231 } else { |
| 232 DCHECK(origin == ModuleOrigin::kAsmJsOrigin); | 232 DCHECK(origin == ModuleOrigin::kAsmJsOrigin); |
| 233 Handle<Map> map = isolate->factory()->NewMap( | 233 Handle<Map> map = isolate->factory()->NewMap( |
| 234 JS_OBJECT_TYPE, | 234 JS_OBJECT_TYPE, |
| 235 JSObject::kHeaderSize + WasmModuleObject::kFieldCount * kPointerSize); | 235 JSObject::kHeaderSize + WasmModuleObject::kFieldCount * kPointerSize); |
| 236 module_object = isolate->factory()->NewJSObjectFromMap(map, TENURED); | 236 module_object = isolate->factory()->NewJSObjectFromMap(map, TENURED); |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1188 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; | 1188 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; |
| 1189 Isolate* isolate = array->GetIsolate(); | 1189 Isolate* isolate = array->GetIsolate(); |
| 1190 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && | 1190 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && |
| 1191 !array->get(kNextInstanceWrapper)->IsFixedArray()) | 1191 !array->get(kNextInstanceWrapper)->IsFixedArray()) |
| 1192 return false; | 1192 return false; |
| 1193 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && | 1193 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && |
| 1194 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1194 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
| 1195 return false; | 1195 return false; |
| 1196 return true; | 1196 return true; |
| 1197 } | 1197 } |
| OLD | NEW |