From 22e66d395e459ed381809fb267bf2879e8e557ea Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Tue, 28 Feb 2012 15:32:06 +0000 Subject: [PATCH] Thread isolate through Property constructor, avoiding Isolate::Current. This removes roughly 5k invocations of Isolate::Current from the string-tagcloud benchmark. Review URL: https://chromiumcodereview.appspot.com/9490009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ast.cc | 7 +++++-- src/ast.h | 2 +- src/parser.cc | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ast.cc b/src/ast.cc index 9425d6a24..9810c3450 100644 --- a/src/ast.cc +++ b/src/ast.cc @@ -168,12 +168,15 @@ LanguageMode FunctionLiteral::language_mode() const { } -ObjectLiteral::Property::Property(Literal* key, Expression* value) { +ObjectLiteral::Property::Property(Literal* key, + Expression* value, + Isolate* isolate) { emit_store_ = true; key_ = key; value_ = value; Object* k = *key->handle(); - if (k->IsSymbol() && HEAP->Proto_symbol()->Equals(String::cast(k))) { + if (k->IsSymbol() && + isolate->heap()->Proto_symbol()->Equals(String::cast(k))) { kind_ = PROTOTYPE; } else if (value_->AsMaterializedLiteral() != NULL) { kind_ = MATERIALIZED_LITERAL; diff --git a/src/ast.h b/src/ast.h index 7a46ac930..d7819c361 100644 --- a/src/ast.h +++ b/src/ast.h @@ -1257,7 +1257,7 @@ class ObjectLiteral: public MaterializedLiteral { PROTOTYPE // Property is __proto__. }; - Property(Literal* key, Expression* value); + Property(Literal* key, Expression* value, Isolate* isolate); Literal* key() { return key_; } Expression* value() { return value_; } diff --git a/src/parser.cc b/src/parser.cc index 1bab4a617..4c342f877 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -3991,7 +3991,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) { Expression* value = ParseAssignmentExpression(true, CHECK_OK); ObjectLiteral::Property* property = - new(zone()) ObjectLiteral::Property(key, value); + new(zone()) ObjectLiteral::Property(key, value, isolate()); // Mark top-level object literals that contain function literals and // pretenure the literal so it can be added as a constant function -- 2.34.1