Revision: 16463
Author: [email protected]
Date: Mon Sep 2 09:27:27 2013 UTC
Log: remove Isolate::Current from most files starting with 'a'
[email protected]
BUG=
Review URL: https://codereview.chromium.org/23859002
http://code.google.com/p/v8/source/detail?r=16463
Modified:
/branches/bleeding_edge/src/accessors.cc
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/api.h
/branches/bleeding_edge/src/arm/codegen-arm.h
/branches/bleeding_edge/src/assembler.h
/branches/bleeding_edge/src/ast.cc
/branches/bleeding_edge/src/ast.h
/branches/bleeding_edge/src/codegen.cc
/branches/bleeding_edge/src/full-codegen.cc
/branches/bleeding_edge/src/full-codegen.h
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/mips/codegen-mips.h
/branches/bleeding_edge/src/prettyprinter.cc
/branches/bleeding_edge/src/prettyprinter.h
/branches/bleeding_edge/src/rewriter.cc
/branches/bleeding_edge/src/typing.cc
/branches/bleeding_edge/src/x64/codegen-x64.h
=======================================
--- /branches/bleeding_edge/src/accessors.cc Mon Sep 2 09:25:20 2013 UTC
+++ /branches/bleeding_edge/src/accessors.cc Mon Sep 2 09:27:27 2013 UTC
@@ -896,15 +896,16 @@
Handle<String> name,
int index,
PropertyAttributes attributes) {
- Factory* factory = name->GetIsolate()->factory();
+ Isolate* isolate = name->GetIsolate();
+ Factory* factory = isolate->factory();
Handle<ExecutableAccessorInfo> info =
factory->NewExecutableAccessorInfo();
info->set_property_attributes(attributes);
info->set_all_can_read(true);
info->set_all_can_write(true);
info->set_name(*name);
info->set_data(Smi::FromInt(index));
- Handle<Object> getter = v8::FromCData(&ModuleGetExport);
- Handle<Object> setter = v8::FromCData(&ModuleSetExport);
+ Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
+ Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
info->set_getter(*getter);
if (!(attributes & ReadOnly)) info->set_setter(*setter);
return info;
=======================================
--- /branches/bleeding_edge/src/api.cc Fri Aug 30 14:54:59 2013 UTC
+++ /branches/bleeding_edge/src/api.cc Mon Sep 2 09:27:27 2013 UTC
@@ -1264,7 +1264,7 @@
#define SET_FIELD_WRAPPED(obj, setter, cdata) do { \
- i::Handle<i::Object> foreign = FromCData(cdata); \
+ i::Handle<i::Object> foreign = FromCData(obj->GetIsolate(), cdata); \
(obj)->setter(*foreign); \
} while (false)
=======================================
--- /branches/bleeding_edge/src/api.h Tue Aug 27 11:47:52 2013 UTC
+++ /branches/bleeding_edge/src/api.h Mon Sep 2 09:27:27 2013 UTC
@@ -125,8 +125,8 @@
template <typename T>
-inline v8::internal::Handle<v8::internal::Object> FromCData(T obj) {
- v8::internal::Isolate* isolate = v8::internal::Isolate::Current();
+inline v8::internal::Handle<v8::internal::Object> FromCData(
+ v8::internal::Isolate* isolate, T obj) {
STATIC_ASSERT(sizeof(T) == sizeof(v8::internal::Address));
return isolate->factory()->NewForeign(
reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(obj)));
=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.h Fri May 24 10:57:59 2013
UTC
+++ /branches/bleeding_edge/src/arm/codegen-arm.h Mon Sep 2 09:27:27 2013
UTC
@@ -44,8 +44,8 @@
class CodeGenerator: public AstVisitor {
public:
- CodeGenerator() {
- InitializeAstVisitor();
+ explicit CodeGenerator(Isolate* isolate) {
+ InitializeAstVisitor(isolate);
}
static bool MakeCode(CompilationInfo* info);
=======================================
--- /branches/bleeding_edge/src/assembler.h Tue Aug 27 13:41:44 2013 UTC
+++ /branches/bleeding_edge/src/assembler.h Mon Sep 2 09:27:27 2013 UTC
@@ -691,7 +691,7 @@
explicit ExternalReference(const SCTableReference& table_ref);
- // Isolate::Current() as an external reference.
+ // Isolate as an external reference.
static ExternalReference isolate_address(Isolate* isolate);
// One-of-a-kind references. These references are not part of a general
=======================================
--- /branches/bleeding_edge/src/ast.cc Fri Aug 30 10:51:37 2013 UTC
+++ /branches/bleeding_edge/src/ast.cc Mon Sep 2 09:27:27 2013 UTC
@@ -1183,7 +1183,6 @@
Handle<String> Literal::ToString() {
if (value_->IsString()) return Handle<String>::cast(value_);
- Factory* factory = Isolate::Current()->factory();
ASSERT(value_->IsNumber());
char arr[100];
Vector<char> buffer(arr, ARRAY_SIZE(arr));
@@ -1195,7 +1194,7 @@
} else {
str = DoubleToCString(value_->Number(), buffer);
}
- return factory->NewStringFromAscii(CStrVector(str));
+ return isolate_->factory()->NewStringFromAscii(CStrVector(str));
}
=======================================
--- /branches/bleeding_edge/src/ast.h Wed Aug 28 08:35:04 2013 UTC
+++ /branches/bleeding_edge/src/ast.h Mon Sep 2 09:27:27 2013 UTC
@@ -1381,12 +1381,15 @@
protected:
Literal(Isolate* isolate, Handle<Object> value)
: Expression(isolate),
- value_(value) { }
+ value_(value),
+ isolate_(isolate) { }
private:
Handle<String> ToString();
Handle<Object> value_;
+ // TODO(dcarney): remove. this is only needed for Match and Hash.
+ Isolate* isolate_;
};
@@ -2811,8 +2814,8 @@
} \
\
private: \
- void InitializeAstVisitor() { \
- isolate_ = Isolate::Current(); \
+ void InitializeAstVisitor(Isolate* isolate) { \
+ isolate_ = isolate; \
stack_overflow_ = false; \
} \
Isolate* isolate() { return isolate_; } \
=======================================
--- /branches/bleeding_edge/src/codegen.cc Fri Aug 16 19:52:29 2013 UTC
+++ /branches/bleeding_edge/src/codegen.cc Mon Sep 2 09:27:27 2013 UTC
@@ -89,12 +89,12 @@
#ifdef DEBUG
if (!info->IsStub() && print_source) {
PrintF("--- Source from AST ---\n%s\n",
- PrettyPrinter().PrintProgram(info->function()));
+ PrettyPrinter(info->isolate()).PrintProgram(info->function()));
}
if (!info->IsStub() && print_ast) {
PrintF("--- AST ---\n%s\n",
- AstPrinter().PrintProgram(info->function()));
+ AstPrinter(info->isolate()).PrintProgram(info->function()));
}
#endif // DEBUG
}
=======================================
--- /branches/bleeding_edge/src/full-codegen.cc Fri Aug 16 19:52:29 2013 UTC
+++ /branches/bleeding_edge/src/full-codegen.cc Mon Sep 2 09:27:27 2013 UTC
@@ -415,7 +415,7 @@
!Snapshot::HaveASnapshotToStartFrom();
masm_->set_emit_debug_code(generate_debug_code_);
masm_->set_predictable_code_size(true);
- InitializeAstVisitor();
+ InitializeAstVisitor(info_->isolate());
}
@@ -830,7 +830,7 @@
} else {
// Check if the statement will be breakable without adding a debug
break
// slot.
- BreakableStatementChecker checker;
+ BreakableStatementChecker checker(isolate());
checker.Check(stmt);
// Record the statement position right here if the statement is not
// breakable. For breakable statements the actual recording of the
@@ -856,7 +856,7 @@
} else {
// Check if the expression will be breakable without adding a debug
break
// slot.
- BreakableStatementChecker checker;
+ BreakableStatementChecker checker(isolate());
checker.Check(expr);
// Record a statement position right here if the expression is not
// breakable. For breakable expressions the actual recording of the
=======================================
--- /branches/bleeding_edge/src/full-codegen.h Tue Aug 6 14:38:30 2013 UTC
+++ /branches/bleeding_edge/src/full-codegen.h Mon Sep 2 09:27:27 2013 UTC
@@ -52,8 +52,8 @@
// debugger to piggybag on.
class BreakableStatementChecker: public AstVisitor {
public:
- BreakableStatementChecker() : is_breakable_(false) {
- InitializeAstVisitor();
+ explicit BreakableStatementChecker(Isolate* isolate) :
is_breakable_(false) {
+ InitializeAstVisitor(isolate);
}
void Check(Statement* stmt);
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri Aug 30 10:51:37 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Sep 2 09:27:27 2013 UTC
@@ -2040,7 +2040,7 @@
// constructor for the initial state relies on function_state_ == NULL
// to know it's the initial state.
function_state_= &initial_function_state_;
- InitializeAstVisitor();
+ InitializeAstVisitor(info->isolate());
}
=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.h Fri May 24 10:57:59
2013 UTC
+++ /branches/bleeding_edge/src/mips/codegen-mips.h Mon Sep 2 09:27:27
2013 UTC
@@ -46,8 +46,8 @@
class CodeGenerator: public AstVisitor {
public:
- CodeGenerator() {
- InitializeAstVisitor();
+ explicit CodeGenerator(Isolate* isolate) {
+ InitializeAstVisitor(isolate);
}
static bool MakeCode(CompilationInfo* info);
=======================================
--- /branches/bleeding_edge/src/prettyprinter.cc Mon Jun 24 10:37:59 2013
UTC
+++ /branches/bleeding_edge/src/prettyprinter.cc Mon Sep 2 09:27:27 2013
UTC
@@ -38,11 +38,11 @@
#ifdef DEBUG
-PrettyPrinter::PrettyPrinter() {
+PrettyPrinter::PrettyPrinter(Isolate* isolate) {
output_ = NULL;
size_ = 0;
pos_ = 0;
- InitializeAstVisitor();
+ InitializeAstVisitor(isolate);
}
@@ -480,8 +480,8 @@
}
-void PrettyPrinter::PrintOut(AstNode* node) {
- PrettyPrinter printer;
+void PrettyPrinter::PrintOut(Isolate* isolate, AstNode* node) {
+ PrettyPrinter printer(isolate);
PrintF("%s", printer.Print(node));
}
@@ -658,7 +658,7 @@
//-----------------------------------------------------------------------------
-AstPrinter::AstPrinter() : indent_(0) {
+AstPrinter::AstPrinter(Isolate* isolate) : PrettyPrinter(isolate),
indent_(0) {
}
=======================================
--- /branches/bleeding_edge/src/prettyprinter.h Wed May 8 13:24:45 2013 UTC
+++ /branches/bleeding_edge/src/prettyprinter.h Mon Sep 2 09:27:27 2013 UTC
@@ -38,7 +38,7 @@
class PrettyPrinter: public AstVisitor {
public:
- PrettyPrinter();
+ explicit PrettyPrinter(Isolate* isolate);
virtual ~PrettyPrinter();
// The following routines print a node into a string.
@@ -50,7 +50,7 @@
void Print(const char* format, ...);
// Print a node to stdout.
- static void PrintOut(AstNode* node);
+ static void PrintOut(Isolate* isolate, AstNode* node);
// Individual nodes
#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
@@ -82,7 +82,7 @@
// Prints the AST structure
class AstPrinter: public PrettyPrinter {
public:
- AstPrinter();
+ explicit AstPrinter(Isolate* isolate);
virtual ~AstPrinter();
const char* PrintProgram(FunctionLiteral* program);
=======================================
--- /branches/bleeding_edge/src/rewriter.cc Thu Jun 6 14:38:26 2013 UTC
+++ /branches/bleeding_edge/src/rewriter.cc Mon Sep 2 09:27:27 2013 UTC
@@ -43,8 +43,8 @@
result_assigned_(false),
is_set_(false),
in_try_(false),
- factory_(Isolate::Current(), zone) {
- InitializeAstVisitor();
+ factory_(zone->isolate(), zone) {
+ InitializeAstVisitor(zone->isolate());
}
virtual ~Processor() { }
=======================================
--- /branches/bleeding_edge/src/typing.cc Wed Aug 7 18:45:41 2013 UTC
+++ /branches/bleeding_edge/src/typing.cc Mon Sep 2 09:27:27 2013 UTC
@@ -42,7 +42,7 @@
info->isolate(),
info->zone()),
store_(info->zone()) {
- InitializeAstVisitor();
+ InitializeAstVisitor(info->isolate());
}
=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.h Tue Aug 27 01:21:39 2013
UTC
+++ /branches/bleeding_edge/src/x64/codegen-x64.h Mon Sep 2 09:27:27 2013
UTC
@@ -44,8 +44,8 @@
class CodeGenerator: public AstVisitor {
public:
- CodeGenerator() {
- InitializeAstVisitor();
+ explicit CodeGenerator(Isolate* isolate) {
+ InitializeAstVisitor(isolate);
}
static bool MakeCode(CompilationInfo* info);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.