aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/module.cc')
-rw-r--r--deps/v8/src/objects/module.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/deps/v8/src/objects/module.cc b/deps/v8/src/objects/module.cc
index c4d2626e60..5ac05478b8 100644
--- a/deps/v8/src/objects/module.cc
+++ b/deps/v8/src/objects/module.cc
@@ -11,9 +11,11 @@
#include "src/api-inl.h"
#include "src/ast/modules.h"
#include "src/objects-inl.h"
+#include "src/objects/cell-inl.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-generator-inl.h"
#include "src/objects/module-inl.h"
+#include "src/ostreams.h"
namespace v8 {
namespace internal {
@@ -139,9 +141,9 @@ void Module::CreateExport(Isolate* isolate, Handle<Module> module,
module->set_exports(*exports);
}
-Cell* Module::GetCell(int cell_index) {
+Cell Module::GetCell(int cell_index) {
DisallowHeapAllocation no_gc;
- Object* cell;
+ Object cell;
switch (ModuleDescriptor::GetCellIndexKind(cell_index)) {
case ModuleDescriptor::kImport:
cell = regular_imports()->get(ImportIndex(cell_index));
@@ -247,7 +249,7 @@ void Module::Reset(Isolate* isolate, Handle<Module> module) {
void Module::RecordError(Isolate* isolate) {
DisallowHeapAllocation no_alloc;
DCHECK(exception()->IsTheHole(isolate));
- Object* the_exception = isolate->pending_exception();
+ Object the_exception = isolate->pending_exception();
DCHECK(!the_exception->IsTheHole(isolate));
set_code(info());
@@ -258,14 +260,14 @@ void Module::RecordError(Isolate* isolate) {
set_exception(the_exception);
}
-Object* Module::GetException() {
+Object Module::GetException() {
DisallowHeapAllocation no_alloc;
DCHECK_EQ(status(), Module::kErrored);
DCHECK(!exception()->IsTheHole());
return exception();
}
-SharedFunctionInfo* Module::GetSharedFunctionInfo() const {
+SharedFunctionInfo Module::GetSharedFunctionInfo() const {
DisallowHeapAllocation no_alloc;
DCHECK_NE(status(), Module::kEvaluating);
DCHECK_NE(status(), Module::kEvaluated);
@@ -745,14 +747,10 @@ MaybeHandle<Object> Module::Evaluate(Isolate* isolate, Handle<Module> module,
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result, Execution::Call(isolate, resume, generator, 0, nullptr),
Object);
- DCHECK(static_cast<JSIteratorResult*>(JSObject::cast(*result))
- ->done()
- ->BooleanValue(isolate));
+ DCHECK(JSIteratorResult::cast(*result)->done()->BooleanValue(isolate));
CHECK(MaybeTransitionComponent(isolate, module, stack, kEvaluated));
- return handle(
- static_cast<JSIteratorResult*>(JSObject::cast(*result))->value(),
- isolate);
+ return handle(JSIteratorResult::cast(*result)->value(), isolate);
}
namespace {
@@ -795,7 +793,7 @@ void FetchStarExports(Isolate* isolate, Handle<Module> module, Zone* zone,
Handle<ObjectHashTable> requested_exports(requested_module->exports(),
isolate);
for (int i = 0, n = requested_exports->Capacity(); i < n; ++i) {
- Object* key;
+ Object key;
if (!requested_exports->ToKey(roots, i, &key)) continue;
Handle<String> name(String::cast(key), isolate);
@@ -856,7 +854,7 @@ Handle<JSModuleNamespace> Module::GetModuleNamespace(Isolate* isolate,
ZoneVector<Handle<String>> names(&zone);
names.reserve(exports->NumberOfElements());
for (int i = 0, n = exports->Capacity(); i < n; ++i) {
- Object* key;
+ Object key;
if (!exports->ToKey(roots, i, &key)) continue;
names.push_back(handle(String::cast(key), isolate));
}