Revision: 24791
Author: [email protected]
Date: Wed Oct 22 07:27:53 2014 UTC
Log: Version 3.30.16 (based on bleeding_edge revision r24788)
Remove v8stdint.h, it doesn't serve a purpose anymore.
Performance and stability improvements on all platforms.
https://code.google.com/p/v8/source/detail?r=24791
Added:
/trunk/src/ast-numbering.cc
/trunk/src/ast-numbering.h
/trunk/src/compiler/zone-pool.cc
/trunk/src/compiler/zone-pool.h
/trunk/src/harmony-tostring.js
/trunk/test/js-perf-test/Strings
/trunk/test/js-perf-test/Strings/Strings.json
/trunk/test/js-perf-test/Strings/harmony-string.js
/trunk/test/js-perf-test/Strings/run.js
/trunk/test/mjsunit/es6/object-tostring.js
/trunk/test/mjsunit/regress/regress-423633.js
/trunk/test/mjsunit/regress/regress-crbug-425519.js
/trunk/test/unittests/compiler/zone-pool-unittest.cc
Deleted:
/trunk/include/v8stdint.h
Modified:
/trunk/BUILD.gn
/trunk/ChangeLog
/trunk/include/v8.h
/trunk/src/api.cc
/trunk/src/arm64/full-codegen-arm64.cc
/trunk/src/array.js
/trunk/src/arraybuffer.js
/trunk/src/assert-scope.h
/trunk/src/ast-value-factory.h
/trunk/src/ast.cc
/trunk/src/ast.h
/trunk/src/base/atomicops.h
/trunk/src/base/bits.h
/trunk/src/base/functional.h
/trunk/src/base/logging.h
/trunk/src/base/macros.h
/trunk/src/base/once.h
/trunk/src/base/sys-info.h
/trunk/src/bignum-dtoa.cc
/trunk/src/bootstrapper.cc
/trunk/src/cached-powers.cc
/trunk/src/collection.js
/trunk/src/compiler/arm64/code-generator-arm64.cc
/trunk/src/compiler/ast-graph-builder.cc
/trunk/src/compiler/ast-graph-builder.h
/trunk/src/compiler/code-generator.cc
/trunk/src/compiler/code-generator.h
/trunk/src/compiler/control-reducer.cc
/trunk/src/compiler/control-reducer.h
/trunk/src/compiler/graph-builder.cc
/trunk/src/compiler/graph-builder.h
/trunk/src/compiler/ia32/code-generator-ia32.cc
/trunk/src/compiler/ia32/instruction-selector-ia32.cc
/trunk/src/compiler/instruction-selector.cc
/trunk/src/compiler/instruction-selector.h
/trunk/src/compiler/instruction.cc
/trunk/src/compiler/instruction.h
/trunk/src/compiler/js-inlining.cc
/trunk/src/compiler/js-inlining.h
/trunk/src/compiler/machine-operator-reducer.cc
/trunk/src/compiler/pipeline.cc
/trunk/src/compiler/pipeline.h
/trunk/src/compiler/raw-machine-assembler.cc
/trunk/src/compiler/register-allocator.cc
/trunk/src/compiler/register-allocator.h
/trunk/src/compiler/scheduler.cc
/trunk/src/compiler/scheduler.h
/trunk/src/compiler/x64/code-generator-x64.cc
/trunk/src/compiler/x64/instruction-selector-x64.cc
/trunk/src/compiler.cc
/trunk/src/compiler.h
/trunk/src/d8.cc
/trunk/src/diy-fp.cc
/trunk/src/dtoa.cc
/trunk/src/fast-dtoa.cc
/trunk/src/fixed-dtoa.cc
/trunk/src/flag-definitions.h
/trunk/src/full-codegen.cc
/trunk/src/generator.js
/trunk/src/globals.h
/trunk/src/heap/gc-idle-time-handler.cc
/trunk/src/heap/heap.h
/trunk/src/heap/mark-compact.cc
/trunk/src/heap/objects-visiting-inl.h
/trunk/src/hydrogen.cc
/trunk/src/interface.cc
/trunk/src/interface.h
/trunk/src/isolate.cc
/trunk/src/lookup.cc
/trunk/src/messages.js
/trunk/src/objects-inl.h
/trunk/src/objects.cc
/trunk/src/objects.h
/trunk/src/parser.cc
/trunk/src/preparse-data.cc
/trunk/src/preparser.cc
/trunk/src/preparser.h
/trunk/src/promise.js
/trunk/src/rewriter.cc
/trunk/src/scanner.cc
/trunk/src/scopes.cc
/trunk/src/symbol.js
/trunk/src/token.cc
/trunk/src/v8natives.js
/trunk/src/version.cc
/trunk/src/weak-collection.js
/trunk/src/x87/code-stubs-x87.cc
/trunk/src/x87/full-codegen-x87.cc
/trunk/src/x87/lithium-codegen-x87.cc
/trunk/src/zone.cc
/trunk/test/cctest/cctest.status
/trunk/test/cctest/compiler/function-tester.h
/trunk/test/cctest/compiler/test-codegen-deopt.cc
/trunk/test/cctest/compiler/test-control-reducer.cc
/trunk/test/cctest/compiler/test-instruction.cc
/trunk/test/cctest/compiler/test-pipeline.cc
/trunk/test/cctest/compiler/test-scheduler.cc
/trunk/test/cctest/test-api.cc
/trunk/test/cctest/test-ast.cc
/trunk/test/cctest/test-heap.cc
/trunk/test/cctest/test-parsing.cc
/trunk/test/cctest/test-platform.cc
/trunk/test/mjsunit/es6/collections.js
/trunk/test/mjsunit/es6/generators-objects.js
/trunk/test/mjsunit/es6/promises.js
/trunk/test/mjsunit/es6/symbols.js
/trunk/test/mjsunit/harmony/typedarrays.js
/trunk/test/mjsunit/mjsunit.status
/trunk/test/unittests/base/division-by-constant-unittest.cc
/trunk/test/unittests/base/flags-unittest.cc
/trunk/test/unittests/compiler/instruction-selector-unittest.cc
/trunk/test/unittests/compiler/machine-operator-reducer-unittest.cc
/trunk/test/unittests/heap/gc-idle-time-handler-unittest.cc
/trunk/test/unittests/unittests.gyp
/trunk/testing/gtest-support.h
/trunk/tools/gyp/v8.gyp
/trunk/tools/whitespace.txt
=======================================
--- /dev/null
+++ /trunk/src/ast-numbering.cc Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,416 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/v8.h"
+
+#include "src/ast.h"
+#include "src/ast-numbering.h"
+#include "src/compiler.h"
+#include "src/scopes.h"
+
+namespace v8 {
+namespace internal {
+
+
+class AstNumberingVisitor FINAL : public AstVisitor {
+ public:
+ explicit AstNumberingVisitor(Zone* zone)
+ : AstVisitor(), next_id_(BailoutId::FirstUsable().ToInt()) {
+ InitializeAstVisitor(zone);
+ }
+
+ void Renumber(FunctionLiteral* node);
+
+ private:
+// AST node visitor interface.
+#define DEFINE_VISIT(type) virtual void Visit##type(type* node);
+ AST_NODE_LIST(DEFINE_VISIT)
+#undef DEFINE_VISIT
+
+ void VisitStatements(ZoneList<Statement*>* statements);
+ void VisitDeclarations(ZoneList<Declaration*>* declarations);
+ void VisitArguments(ZoneList<Expression*>* arguments);
+ void VisitObjectLiteralProperty(ObjectLiteralProperty* property);
+
+ int ReserveIdRange(int n) {
+ int tmp = next_id_;
+ next_id_ += n;
+ return tmp;
+ }
+
+ int next_id_;
+
+ DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
+ DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor);
+};
+
+
+void AstNumberingVisitor::VisitVariableDeclaration(VariableDeclaration*
node) {
+ VisitVariableProxy(node->proxy());
+}
+
+
+void AstNumberingVisitor::VisitExportDeclaration(ExportDeclaration* node) {
+ VisitVariableProxy(node->proxy());
+}
+
+
+void AstNumberingVisitor::VisitModuleUrl(ModuleUrl* node) {}
+
+
+void AstNumberingVisitor::VisitEmptyStatement(EmptyStatement* node) {}
+
+
+void AstNumberingVisitor::VisitContinueStatement(ContinueStatement* node)
{}
+
+
+void AstNumberingVisitor::VisitBreakStatement(BreakStatement* node) {}
+
+
+void AstNumberingVisitor::VisitDebuggerStatement(DebuggerStatement* node) {
+ node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitNativeFunctionLiteral(
+ NativeFunctionLiteral* node) {
+ node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitLiteral(Literal* node) {
+ node->set_base_id(ReserveIdRange(Literal::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
+ node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
+ node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) {
+ node->set_base_id(ReserveIdRange(ThisFunction::num_ids()));
+}
+
+
+void AstNumberingVisitor::VisitSuperReference(SuperReference* node) {
+ node->set_base_id(ReserveIdRange(SuperReference::num_ids()));
+ Visit(node->this_var());
+}
+
+
+void AstNumberingVisitor::VisitModuleDeclaration(ModuleDeclaration* node) {
+ VisitVariableProxy(node->proxy());
+ Visit(node->module());
+}
+
+
+void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) {
+ VisitVariableProxy(node->proxy());
+ Visit(node->module());
+}
+
+
+void AstNumberingVisitor::VisitModuleVariable(ModuleVariable* node) {
+ Visit(node->proxy());
+}
+
+
+void AstNumberingVisitor::VisitModulePath(ModulePath* node) {
+ Visit(node->module());
+}
+
+
+void AstNumberingVisitor::VisitModuleStatement(ModuleStatement* node) {
+ Visit(node->body());
+}
+
+
+void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement*
node) {
+ Visit(node->expression());
+}
+
+
+void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) {
+ Visit(node->expression());
+}
+
+
+void AstNumberingVisitor::VisitYield(Yield* node) {
+ node->set_base_id(ReserveIdRange(Yield::num_ids()));
+ Visit(node->generator_object());
+ Visit(node->expression());
+}
+
+
+void AstNumberingVisitor::VisitThrow(Throw* node) {
+ node->set_base_id(ReserveIdRange(Throw::num_ids()));
+ Visit(node->exception());
+}
+
+
+void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
+ node->set_base_id(ReserveIdRange(UnaryOperation::num_ids()));
+ Visit(node->expression());
+}
+
+
+void AstNumberingVisitor::VisitCountOperation(CountOperation* node) {
+ node->set_base_id(ReserveIdRange(CountOperation::num_ids()));
+ Visit(node->expression());
+}
+
+
+void AstNumberingVisitor::VisitBlock(Block* node) {
+ node->set_base_id(ReserveIdRange(Block::num_ids()));
+ if (node->scope() != NULL)
VisitDeclarations(node->scope()->declarations());
+ VisitStatements(node->statements());
+}
+
+
+void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration*
node) {
+ VisitVariableProxy(node->proxy());
+ VisitFunctionLiteral(node->fun());
+}
+
+
+void AstNumberingVisitor::VisitModuleLiteral(ModuleLiteral* node) {
+ VisitBlock(node->body());
+}
+
+
+void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) {
+ node->set_base_id(ReserveIdRange(CallRuntime::num_ids()));
+ VisitArguments(node->arguments());
+}
+
+
+void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
+ Visit(node->expression());
+ Visit(node->statement());
+}
+
+
+void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
+ node->set_base_id(ReserveIdRange(DoWhileStatement::num_ids()));
+ Visit(node->body());
+ Visit(node->cond());
+}
+
+
+void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
+ node->set_base_id(ReserveIdRange(WhileStatement::num_ids()));
+ Visit(node->cond());
+ Visit(node->body());
+}
+
+
+void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) {
+ Visit(node->try_block());
+ Visit(node->catch_block());
+}
+
+
+void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement*
node) {
+ Visit(node->try_block());
+ Visit(node->finally_block());
+}
+
+
+void AstNumberingVisitor::VisitProperty(Property* node) {
+ node->set_base_id(ReserveIdRange(Property::num_ids()));
+ Visit(node->key());
+ Visit(node->obj());
+}
+
+
+void AstNumberingVisitor::VisitAssignment(Assignment* node) {
+ node->set_base_id(ReserveIdRange(Assignment::num_ids()));
+ if (node->is_compound()) VisitBinaryOperation(node->binary_operation());
+ Visit(node->target());
+ Visit(node->value());
+}
+
+
+void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) {
+ node->set_base_id(ReserveIdRange(BinaryOperation::num_ids()));
+ Visit(node->left());
+ Visit(node->right());
+}
+
+
+void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) {
+ node->set_base_id(ReserveIdRange(CompareOperation::num_ids()));
+ Visit(node->left());
+ Visit(node->right());
+}
+
+
+void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
+ node->set_base_id(ReserveIdRange(ForInStatement::num_ids()));
+ Visit(node->each());
+ Visit(node->enumerable());
+ Visit(node->body());
+}
+
+
+void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
+ node->set_base_id(ReserveIdRange(ForOfStatement::num_ids()));
+ Visit(node->assign_iterator());
+ Visit(node->next_result());
+ Visit(node->result_done());
+ Visit(node->assign_each());
+ Visit(node->body());
+}
+
+
+void AstNumberingVisitor::VisitConditional(Conditional* node) {
+ node->set_base_id(ReserveIdRange(Conditional::num_ids()));
+ Visit(node->condition());
+ Visit(node->then_expression());
+ Visit(node->else_expression());
+}
+
+
+void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
+ node->set_base_id(ReserveIdRange(IfStatement::num_ids()));
+ Visit(node->condition());
+ Visit(node->then_statement());
+ if (node->HasElseStatement()) {
+ Visit(node->else_statement());
+ }
+}
+
+
+void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
+ node->set_base_id(ReserveIdRange(SwitchStatement::num_ids()));
+ Visit(node->tag());
+ ZoneList<CaseClause*>* cases = node->cases();
+ for (int i = 0; i < cases->length(); i++) {
+ VisitCaseClause(cases->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitCaseClause(CaseClause* node) {
+ node->set_base_id(ReserveIdRange(CaseClause::num_ids()));
+ if (!node->is_default()) Visit(node->label());
+ VisitStatements(node->statements());
+}
+
+
+void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
+ node->set_base_id(ReserveIdRange(ForStatement::num_ids()));
+ if (node->init() != NULL) Visit(node->init());
+ if (node->cond() != NULL) Visit(node->cond());
+ if (node->next() != NULL) Visit(node->next());
+ Visit(node->body());
+}
+
+
+void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
+ node->set_base_id(ReserveIdRange(ClassLiteral::num_ids()));
+ if (node->extends()) Visit(node->extends());
+ if (node->constructor()) Visit(node->constructor());
+ for (int i = 0; i < node->properties()->length(); i++) {
+ VisitObjectLiteralProperty(node->properties()->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
+ node->set_base_id(ReserveIdRange(ObjectLiteral::num_ids()));
+ for (int i = 0; i < node->properties()->length(); i++) {
+ VisitObjectLiteralProperty(node->properties()->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitObjectLiteralProperty(
+ ObjectLiteralProperty* node) {
+ Visit(node->key());
+ Visit(node->value());
+}
+
+
+void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) {
+ node->set_base_id(ReserveIdRange(node->num_ids()));
+ for (int i = 0; i < node->values()->length(); i++) {
+ Visit(node->values()->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitCall(Call* node) {
+ node->set_base_id(ReserveIdRange(Call::num_ids()));
+ Visit(node->expression());
+ VisitArguments(node->arguments());
+}
+
+
+void AstNumberingVisitor::VisitCallNew(CallNew* node) {
+ node->set_base_id(ReserveIdRange(CallNew::num_ids()));
+ Visit(node->expression());
+ VisitArguments(node->arguments());
+}
+
+
+void AstNumberingVisitor::VisitStatements(ZoneList<Statement*>*
statements) {
+ if (statements == NULL) return;
+ for (int i = 0; i < statements->length(); i++) {
+ Visit(statements->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitDeclarations(
+ ZoneList<Declaration*>* declarations) {
+ for (int i = 0; i < declarations->length(); i++) {
+ Visit(declarations->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments)
{
+ for (int i = 0; i < arguments->length(); i++) {
+ Visit(arguments->at(i));
+ }
+}
+
+
+void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
+ node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
+ // We don't recurse into the declarations or body of the function
literal:
+ // you have to separately Renumber() each FunctionLiteral that you
compile.
+}
+
+
+void AstNumberingVisitor::Renumber(FunctionLiteral* node) {
+ if (node->scope()->HasIllegalRedeclaration()) {
+ node->scope()->VisitIllegalRedeclaration(this);
+ return;
+ }
+
+ Scope* scope = node->scope();
+ VisitDeclarations(scope->declarations());
+ if (scope->is_function_scope() && scope->function() != NULL) {
+ // Visit the name of the named function expression.
+ Visit(scope->function());
+ }
+ VisitStatements(node->body());
+}
+
+
+bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) {
+ AstNumberingVisitor visitor(zone);
+ visitor.Renumber(function);
+ return !visitor.HasStackOverflow();
+}
+}
+} // namespace v8::internal
=======================================
--- /dev/null
+++ /trunk/src/ast-numbering.h Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,19 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_AST_NUMBERING_H_
+#define V8_AST_NUMBERING_H_
+
+namespace v8 {
+namespace internal {
+
+namespace AstNumbering {
+// Assign type feedback IDs and bailout IDs to an AST node tree.
+//
+bool Renumber(FunctionLiteral* function, Zone* zone);
+}
+}
+} // namespace v8::internal
+
+#endif // V8_AST_NUMBERING_H_
=======================================
--- /dev/null
+++ /trunk/src/compiler/zone-pool.cc Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,133 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/zone-pool.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+ZonePool::StatsScope::StatsScope(ZonePool* zone_pool)
+ : zone_pool_(zone_pool), max_allocated_bytes_(0) {
+ zone_pool_->stats_.push_back(this);
+ for (auto zone : zone_pool_->used_) {
+ size_t size = static_cast<size_t>(zone->allocation_size());
+ std::pair<InitialValues::iterator, bool> res =
+ initial_values_.insert(std::make_pair(zone, size));
+ USE(res);
+ DCHECK(res.second);
+ }
+}
+
+
+ZonePool::StatsScope::~StatsScope() {
+ DCHECK_EQ(zone_pool_->stats_.back(), this);
+ zone_pool_->stats_.pop_back();
+}
+
+
+size_t ZonePool::StatsScope::GetMaxAllocatedBytes() {
+ return std::max(max_allocated_bytes_, GetCurrentAllocatedBytes());
+}
+
+
+size_t ZonePool::StatsScope::GetCurrentAllocatedBytes() {
+ size_t total = 0;
+ for (Zone* zone : zone_pool_->used_) {
+ total += static_cast<size_t>(zone->allocation_size());
+ // Adjust for initial values.
+ InitialValues::iterator it = initial_values_.find(zone);
+ if (it != initial_values_.end()) {
+ total -= it->second;
+ }
+ }
+ return total;
+}
+
+
+void ZonePool::StatsScope::ZoneReturned(Zone* zone) {
+ size_t current_total = GetCurrentAllocatedBytes();
+ // Update max.
+ max_allocated_bytes_ = std::max(max_allocated_bytes_, current_total);
+ // Drop zone from initial value map.
+ InitialValues::iterator it = initial_values_.find(zone);
+ if (it != initial_values_.end()) {
+ initial_values_.erase(it);
+ }
+}
+
+
+ZonePool::ZonePool(Isolate* isolate)
+ : isolate_(isolate), max_allocated_bytes_(0), total_deleted_bytes_(0)
{}
+
+
+ZonePool::~ZonePool() {
+ DCHECK(used_.empty());
+ DCHECK(stats_.empty());
+ for (Zone* zone : unused_) {
+ delete zone;
+ }
+}
+
+
+size_t ZonePool::GetMaxAllocatedBytes() {
+ return std::max(max_allocated_bytes_, GetCurrentAllocatedBytes());
+}
+
+
+size_t ZonePool::GetCurrentAllocatedBytes() {
+ size_t total = 0;
+ for (Zone* zone : used_) {
+ total += static_cast<size_t>(zone->allocation_size());
+ }
+ return total;
+}
+
+
+size_t ZonePool::GetTotalAllocatedBytes() {
+ return total_deleted_bytes_ + GetCurrentAllocatedBytes();
+}
+
+
+Zone* ZonePool::NewEmptyZone() {
+ Zone* zone;
+ // Grab a zone from pool if possible.
+ if (!unused_.empty()) {
+ zone = unused_.back();
+ unused_.pop_back();
+ } else {
+ zone = new Zone(isolate_);
+ }
+ used_.push_back(zone);
+ DCHECK_EQ(0, zone->allocation_size());
+ return zone;
+}
+
+
+void ZonePool::ReturnZone(Zone* zone) {
+ size_t current_total = GetCurrentAllocatedBytes();
+ // Update max.
+ max_allocated_bytes_ = std::max(max_allocated_bytes_, current_total);
+ // Update stats.
+ for (auto stat_scope : stats_) {
+ stat_scope->ZoneReturned(zone);
+ }
+ // Remove from used.
+ Used::iterator it = std::find(used_.begin(), used_.end(), zone);
+ DCHECK(it != used_.end());
+ used_.erase(it);
+ total_deleted_bytes_ += static_cast<size_t>(zone->allocation_size());
+ // Delete zone or clear and stash on unused_.
+ if (unused_.size() >= kMaxUnusedSize) {
+ delete zone;
+ } else {
+ zone->DeleteAll();
+ DCHECK_EQ(0, zone->allocation_size());
+ unused_.push_back(zone);
+ }
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
=======================================
--- /dev/null
+++ /trunk/src/compiler/zone-pool.h Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,91 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_ZONE_POOL_H_
+#define V8_COMPILER_ZONE_POOL_H_
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "src/v8.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+class ZonePool FINAL {
+ public:
+ class Scope FINAL {
+ public:
+ explicit Scope(ZonePool* zone_pool) : zone_pool_(zone_pool),
zone_(NULL) {}
+ ~Scope() { Destroy(); }
+
+ Zone* zone() {
+ if (zone_ == NULL) zone_ = zone_pool_->NewEmptyZone();
+ return zone_;
+ }
+ void Destroy() {
+ if (zone_ != NULL) zone_pool_->ReturnZone(zone_);
+ zone_ = NULL;
+ }
+
+ private:
+ ZonePool* const zone_pool_;
+ Zone* zone_;
+ DISALLOW_COPY_AND_ASSIGN(Scope);
+ };
+
+ class StatsScope FINAL {
+ public:
+ explicit StatsScope(ZonePool* zone_pool);
+ ~StatsScope();
+
+ size_t GetMaxAllocatedBytes();
+ size_t GetCurrentAllocatedBytes();
+
+ private:
+ friend class ZonePool;
+ void ZoneReturned(Zone* zone);
+
+ typedef std::map<Zone*, size_t> InitialValues;
+
+ ZonePool* const zone_pool_;
+ InitialValues initial_values_;
+ size_t max_allocated_bytes_;
+
+ DISALLOW_COPY_AND_ASSIGN(StatsScope);
+ };
+
+ explicit ZonePool(Isolate* isolate);
+ ~ZonePool();
+
+ size_t GetMaxAllocatedBytes();
+ size_t GetTotalAllocatedBytes();
+ size_t GetCurrentAllocatedBytes();
+
+ private:
+ Zone* NewEmptyZone();
+ void ReturnZone(Zone* zone);
+
+ static const size_t kMaxUnusedSize = 3;
+ typedef std::vector<Zone*> Unused;
+ typedef std::vector<Zone*> Used;
+ typedef std::vector<StatsScope*> Stats;
+
+ Isolate* const isolate_;
+ Unused unused_;
+ Used used_;
+ Stats stats_;
+ size_t max_allocated_bytes_;
+ size_t total_deleted_bytes_;
+
+ DISALLOW_COPY_AND_ASSIGN(ZonePool);
+};
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif
=======================================
--- /dev/null
+++ /trunk/src/harmony-tostring.js Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,66 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+// This file relies on the fact that the following declaration has been
made
+// in runtime.js and symbol.js:
+// var $Object = global.Object;
+// var $Symbol = global.Symbol;
+
+var symbolToStringTag = InternalSymbol("Symbol.toStringTag");
+
+var kBuiltinStringTags = {
+ "__proto__": null,
+ "Arguments": true,
+ "Array": true,
+ "Boolean": true,
+ "Date": true,
+ "Error": true,
+ "Function": true,
+ "Number": true,
+ "RegExp": true,
+ "String": true
+};
+
+DefaultObjectToString = ObjectToStringHarmony;
+// ES6 draft 08-24-14, section 19.1.3.6
+function ObjectToStringHarmony() {
+ if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) return "[object
Undefined]";
+ if (IS_NULL(this)) return "[object Null]";
+ var O = ToObject(this);
+ var builtinTag = %_ClassOf(O);
+ var tag = O[symbolToStringTag];
+ if (IS_UNDEFINED(tag)) {
+ tag = builtinTag;
+ } else if (!IS_STRING(tag)) {
+ return "[object ???]"
+ } else if (tag !== builtinTag && kBuiltinStringTags[tag]) {
+ return "[object ~" + tag + "]";
+ }
+ return "[object " + tag + "]";
+}
+
+function HarmonyToStringExtendSymbolPrototype() {
+ %CheckIsBootstrapping();
+
+ InstallConstants($Symbol, $Array(
+ // TODO(dslomov, caitp): Move to symbol.js when shipping
+ "toStringTag", symbolToStringTag
+ ));
+}
+
+HarmonyToStringExtendSymbolPrototype();
+
+function HarmonyToStringExtendObjectPrototype() {
+ %CheckIsBootstrapping();
+
+ // Set up the non-enumerable functions on the Array prototype object.
+ var desc = ToPropertyDescriptor({
+ value: ObjectToStringHarmony
+ });
+ DefineOwnProperty($Object.prototype, "toString", desc, false);
+}
+
+HarmonyToStringExtendObjectPrototype();
=======================================
--- /dev/null
+++ /trunk/test/js-perf-test/Strings/Strings.json Wed Oct 22 07:27:53 2014
UTC
@@ -0,0 +1,12 @@
+{
+ "path": ["."],
+ "main": "run.js",
+ "flags": ["--harmony-strings"],
+ "run_count": 5,
+ "units": "score",
+ "results_regexp": "^%s\\-Strings\\(Score\\): (.+)$",
+ "total": true,
+ "tests": [
+ {"name": "StringFunctions"}
+ ]
+}
=======================================
--- /dev/null
+++ /trunk/test/js-perf-test/Strings/harmony-string.js Wed Oct 22 07:27:53
2014 UTC
@@ -0,0 +1,66 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+new BenchmarkSuite('StringFunctions', [1000], [
+ new Benchmark('StringRepeat', false, false, 0,
+ StringRepeat, StringRepeatSetup, StringRepeatTearDown),
+ new Benchmark('StringStartsWith', false, false, 0,
+ StringStartsWith, StringWithSetup, StringWithTearDown),
+ new Benchmark('StringEndsWith', false, false, 0,
+ StringEndsWith, StringWithSetup, StringWithTearDown),
+ new Benchmark('StringContains', false, false, 0,
+ StringContains, StringContainsSetup, StringWithTearDown),
+]);
+
+
+var result;
+
+var stringRepeatSource = "abc";
+
+function StringRepeatSetup() {
+ result = undefined;
+}
+
+function StringRepeat() {
+ result = stringRepeatSource.repeat(500);
+}
+
+function StringRepeatTearDown() {
+ var expected = "";
+ for(var i = 0; i < 1000; i++) {
+ expected += stringRepeatSource;
+ }
+ return result === expected;
+}
+
+
+var str;
+var substr;
+
+function StringWithSetup() {
+ str = "abc".repeat(500);
+ substr = "abc".repeat(200);
+ result = undefined;
+}
+
+function StringWithTearDown() {
+ return !!result;
+}
+
+function StringStartsWith() {
+ result = str.startsWith(substr);
+}
+
+function StringEndsWith() {
+ result = str.endsWith(substr);
+}
+
+function StringContainsSetup() {
+ str = "def".repeat(100) + "abc".repeat(100) + "qqq".repeat(100);
+ substr = "abc".repeat(100);
+}
+
+function StringContains() {
+ result = str.contains(substr);
+}
=======================================
--- /dev/null
+++ /trunk/test/js-perf-test/Strings/run.js Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,27 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+load('../base.js');
+load('harmony-string.js');
+
+
+var success = true;
+
+function PrintResult(name, result) {
+ print(name + '-Strings(Score): ' + result);
+}
+
+
+function PrintError(name, error) {
+ PrintResult(name, error);
+ success = false;
+}
+
+
+BenchmarkSuite.config.doWarmup = undefined;
+BenchmarkSuite.config.doDeterministic = undefined;
+
+BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
+ NotifyError: PrintError });
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/es6/object-tostring.js Wed Oct 22 07:27:53 2014 UTC
@@ -0,0 +1,133 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-tostring
+
+var global = this;
+
+var funs = {
+ Object: [ Object ],
+ Function: [ Function ],
+ Array: [ Array ],
+ String: [ String ],
+ Boolean: [ Boolean ],
+ Number: [ Number ],
+ Date: [ Date ],
+ RegExp: [ RegExp ],
+ Error: [ Error, TypeError, RangeError, SyntaxError, ReferenceError,
+ EvalError, URIError ]
+}
+for (f in funs) {
+ for (i in funs[f]) {
+ assertEquals("[object " + f + "]",
+ Object.prototype.toString.call(new funs[f][i]),
+ funs[f][i]);
+ assertEquals("[object Function]",
+ Object.prototype.toString.call(funs[f][i]),
+ funs[f][i]);
+ }
+}
+
+function testToStringTag(className) {
+ // Using builtin toStringTags
+ var obj = {};
+ obj[Symbol.toStringTag] = className;
+ assertEquals("[object ~" + className + "]",
+ Object.prototype.toString.call(obj));
+
+ // Getter throws
+ obj = {};
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ get: function() { throw className; }
+ });
+ assertThrows(function() {
+ Object.prototype.toString.call(obj);
+ }, className);
+
+ // Getter does not throw
+ obj = {};
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ get: function() { return className; }
+ });
+ assertEquals("[object ~" + className + "]",
+ Object.prototype.toString.call(obj));
+
+ // Custom, non-builtin toStringTags
+ obj = {};
+ obj[Symbol.toStringTag] = "X" + className;
+ assertEquals("[object X" + className + "]",
+ Object.prototype.toString.call(obj));
+
+ // With getter
+ obj = {};
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ get: function() { return "X" + className; }
+ });
+ assertEquals("[object X" + className + "]",
+ Object.prototype.toString.call(obj));
+
+ // Undefined toStringTag should return [object className]
+ var obj = className === "Arguments" ?
+ (function() { return arguments; })() : new global[className];
+ obj[Symbol.toStringTag] = undefined;
+ assertEquals("[object " + className + "]",
+ Object.prototype.toString.call(obj));
+
+ // With getter
+ var obj = className === "Arguments" ?
+ (function() { return arguments; })() : new global[className];
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ get: function() { return undefined; }
+ });
+ assertEquals("[object " + className + "]",
+ Object.prototype.toString.call(obj));
+}
+
+[
+ "Arguments",
+ "Array",
+ "Boolean",
+ "Date",
+ "Error",
+ "Function",
+ "Number",
+ "RegExp",
+ "String"
+].forEach(testToStringTag);
+
+function testToStringTagNonString(value) {
+ var obj = {};
+ obj[Symbol.toStringTag] = value;
+ assertEquals("[object ???]", Object.prototype.toString.call(obj));
+
+ // With getter
+ obj = {};
+ Object.defineProperty(obj, Symbol.toStringTag, {
+ get: function() { return value; }
+ });
+ assertEquals("[object ???]", Object.prototype.toString.call(obj));
+}
+
+[
+ null,
+ function() {},
+ [],
+ {},
+ /regexp/,
+ 42,
+ Symbol("sym"),
+ new Date(),
+ (function() { return arguments; })(),
+ true,
+ new Error("oops"),
+ new String("str")
+].forEach(testToStringTagNonString);
+
+function testObjectToStringPropertyDesc() {
+ var desc = Object.getOwnPropertyDescriptor(Object.prototype, "toString");
+ assertTrue(desc.writable);
+ assertFalse(desc.enumerable);
+ assertTrue(desc.configurable);
+}
+testObjectToStringPropertyDesc();
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-423633.js Wed Oct 22 07:27:53 2014
UTC
@@ -0,0 +1,10 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Object.defineProperty(Array.prototype, '0', {
+ get: function() { return false; },
+});
+var a = [1, 2, 3];
+assertEquals(a, a.slice());
+assertEquals([3], a.splice(2, 1));
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-crbug-425519.js Wed Oct 22 07:27:53
2014 UTC
@@ -0,0 +1,15 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function load(a, i) {
+ return a[i];
+}
+
+load([]);
+load(0);
+load("x", 0);
+%OptimizeFunctionOnNextCall(load);
+load([], 0);
=======================================
--- /dev/null
+++ /trunk/test/unittests/compiler/zone-pool-unittest.cc Wed Oct 22
07:27:53 2014 UTC
@@ -0,0 +1,157 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/base/utils/random-number-generator.h"
+#include "src/compiler/zone-pool.h"
+#include "test/unittests/test-utils.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+class ZonePoolTest : public TestWithIsolate {
+ public:
+ ZonePoolTest() : zone_pool_(isolate()) {}
+
+ protected:
+ ZonePool* zone_pool() { return &zone_pool_; }
+
+ void ExpectForPool(size_t current, size_t max, size_t total) {
+ ASSERT_EQ(current, zone_pool()->GetCurrentAllocatedBytes());
+ ASSERT_EQ(max, zone_pool()->GetMaxAllocatedBytes());
+ ASSERT_EQ(total, zone_pool()->GetTotalAllocatedBytes());
+ }
+
+ void Expect(ZonePool::StatsScope* stats, size_t current, size_t max) {
+ ASSERT_EQ(current, stats->GetCurrentAllocatedBytes());
+ ASSERT_EQ(max, stats->GetMaxAllocatedBytes());
+ }
+
+ size_t Allocate(Zone* zone) {
+ size_t bytes = rng.NextInt(25) + 7;
+ int size_before = zone->allocation_size();
+ zone->New(static_cast<int>(bytes));
+ return static_cast<size_t>(zone->allocation_size() - size_before);
+ }
+
+ private:
+ ZonePool zone_pool_;
+ base::RandomNumberGenerator rng;
+};
+
+
+TEST_F(ZonePoolTest, Empty) {
+ ExpectForPool(0, 0, 0);
+ {
+ ZonePool::StatsScope stats(zone_pool());
+ Expect(&stats, 0, 0);
+ }
+ ExpectForPool(0, 0, 0);
+ {
+ ZonePool::Scope scope(zone_pool());
+ scope.zone();
+ }
+ ExpectForPool(0, 0, 0);
+}
+
+
+TEST_F(ZonePoolTest, MultipleZonesWithDeletion) {
+ static const size_t kArraySize = 10;
+
+ ZonePool::Scope* scopes[kArraySize];
+
+ // Initialize.
+ size_t before_stats = 0;
+ for (size_t i = 0; i < kArraySize; ++i) {
+ scopes[i] = new ZonePool::Scope(zone_pool());
+ before_stats += Allocate(scopes[i]->zone()); // Add some stuff.
+ }
+
+ ExpectForPool(before_stats, before_stats, before_stats);
+
+ ZonePool::StatsScope stats(zone_pool());
+
+ size_t before_deletion = 0;
+ for (size_t i = 0; i < kArraySize; ++i) {
+ before_deletion += Allocate(scopes[i]->zone()); // Add some stuff.
+ }
+
+ Expect(&stats, before_deletion, before_deletion);
+ ExpectForPool(before_stats + before_deletion, before_stats +
before_deletion,
+ before_stats + before_deletion);
+
+ // Delete the scopes and create new ones.
+ for (size_t i = 0; i < kArraySize; ++i) {
+ delete scopes[i];
+ scopes[i] = new ZonePool::Scope(zone_pool());
+ }
+
+ Expect(&stats, 0, before_deletion);
+ ExpectForPool(0, before_stats + before_deletion,
+ before_stats + before_deletion);
+
+ size_t after_deletion = 0;
+ for (size_t i = 0; i < kArraySize; ++i) {
+ after_deletion += Allocate(scopes[i]->zone()); // Add some stuff.
+ }
+
+ Expect(&stats, after_deletion, std::max(after_deletion,
before_deletion));
+ ExpectForPool(after_deletion,
+ std::max(after_deletion, before_stats + before_deletion),
+ before_stats + before_deletion + after_deletion);
+
+ // Cleanup.
+ for (size_t i = 0; i < kArraySize; ++i) {
+ delete scopes[i];
+ }
+
+ Expect(&stats, 0, std::max(after_deletion, before_deletion));
+ ExpectForPool(0, std::max(after_deletion, before_stats +
before_deletion),
+ before_stats + before_deletion + after_deletion);
+}
+
+
+TEST_F(ZonePoolTest, SimpleAllocationLoop) {
+ int runs = 20;
+ size_t total_allocated = 0;
+ size_t max_loop_allocation = 0;
+ ZonePool::StatsScope outer_stats(zone_pool());
+ {
+ ZonePool::Scope outer_scope(zone_pool());
+ size_t outer_allocated = 0;
+ for (int i = 0; i < runs; ++i) {
+ {
+ size_t bytes = Allocate(outer_scope.zone());
+ outer_allocated += bytes;
+ total_allocated += bytes;
+ }
+ ZonePool::StatsScope inner_stats(zone_pool());
+ size_t allocated = 0;
+ {
+ ZonePool::Scope inner_scope(zone_pool());
+ for (int j = 0; j < 20; ++j) {
+ size_t bytes = Allocate(inner_scope.zone());
+ allocated += bytes;
+ total_allocated += bytes;
+ max_loop_allocation =
+ std::max(max_loop_allocation, outer_allocated + allocated);
+ Expect(&inner_stats, allocated, allocated);
+ Expect(&outer_stats, outer_allocated + allocated,
+ max_loop_allocation);
+ ExpectForPool(outer_allocated + allocated, max_loop_allocation,
+ total_allocated);
+ }
+ }
+ Expect(&inner_stats, 0, allocated);
+ Expect(&outer_stats, outer_allocated, max_loop_allocation);
+ ExpectForPool(outer_allocated, max_loop_allocation, total_allocated);
+ }
+ }
+ Expect(&outer_stats, 0, max_loop_allocation);
+ ExpectForPool(0, max_loop_allocation, total_allocated);
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
=======================================
--- /trunk/include/v8stdint.h Tue Oct 21 12:48:28 2014 UTC
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Load definitions of standard types.
-
-#ifndef V8STDINT_H_
-#define V8STDINT_H_
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#include "v8config.h"
-
-#endif // V8STDINT_H_
=======================================
--- /trunk/BUILD.gn Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/BUILD.gn Wed Oct 22 07:27:53 2014 UTC
@@ -245,6 +245,7 @@
"src/harmony-array.js",
"src/harmony-typedarray.js",
"src/harmony-classes.js",
+ "src/harmony-tostring.js"
]
outputs = [
@@ -433,6 +434,8 @@
"src/assembler.h",
"src/assert-scope.h",
"src/assert-scope.cc",
+ "src/ast-numbering.cc",
+ "src/ast-numbering.h",
"src/ast-value-factory.cc",
"src/ast-value-factory.h",
"src/ast.cc",
@@ -580,6 +583,8 @@
"src/compiler/value-numbering-reducer.h",
"src/compiler/verifier.cc",
"src/compiler/verifier.h",
+ "src/compiler/zone-pool.cc",
+ "src/compiler/zone-pool.h",
"src/compiler.cc",
"src/compiler.h",
"src/contexts.cc",
=======================================
--- /trunk/ChangeLog Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/ChangeLog Wed Oct 22 07:27:53 2014 UTC
@@ -1,3 +1,10 @@
+2014-10-22: Version 3.30.16
+
+ Remove v8stdint.h, it doesn't serve a purpose anymore.
+
+ Performance and stability improvements on all platforms.
+
+
2014-10-21: Version 3.30.15
Avoid the Marsaglia effect in 3D (Chromium issue 423311).
=======================================
--- /trunk/include/v8.h Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/include/v8.h Wed Oct 22 07:27:53 2014 UTC
@@ -15,7 +15,11 @@
#ifndef V8_H_
#define V8_H_
-#include "v8stdint.h"
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "v8config.h"
// We reserve the V8_* prefix for macros defined in V8 public API and
// assume there are no name conflicts with the embedder's code.
@@ -2126,6 +2130,7 @@
// Well-known symbols
static Local<Symbol> GetIterator(Isolate* isolate);
static Local<Symbol> GetUnscopables(Isolate* isolate);
+ static Local<Symbol> GetToStringTag(Isolate* isolate);
V8_INLINE static Symbol* Cast(v8::Value* obj);
@@ -2502,15 +2507,6 @@
Local<Value> GetHiddenValue(Handle<String> key);
bool DeleteHiddenValue(Handle<String> key);
- /**
- * Returns true if this is an instance of an api function (one
- * created from a function created from a function template) and has
- * been modified since it was created. Note that this method is
- * conservative and may return true for objects that haven't actually
- * been modified.
- */
- bool IsDirty();
-
/**
* Clone this object with a fast but shallow copy. Values will point
* to the same values as the original object.
=======================================
--- /trunk/src/api.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/api.cc Wed Oct 22 07:27:53 2014 UTC
@@ -3407,6 +3407,37 @@
isolate->factory()->NewJSArrayWithElements(elms);
return Utils::ToLocal(scope.CloseAndEscape(result));
}
+
+
+static bool GetPredefinedToString(i::Handle<i::String> tag,
+ Local<String>* result) {
+ i::Isolate* i_isolate = tag->GetIsolate();
+ Isolate* isolate = reinterpret_cast<Isolate*>(i_isolate);
+ i::Factory* factory = i_isolate->factory();
+
+ if (i::String::Equals(tag, factory->Arguments_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Arguments]");
+ } else if (i::String::Equals(tag, factory->Array_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Array]");
+ } else if (i::String::Equals(tag, factory->Boolean_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Boolean]");
+ } else if (i::String::Equals(tag, factory->Date_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Date]");
+ } else if (i::String::Equals(tag, factory->Error_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Error]");
+ } else if (i::String::Equals(tag, factory->Function_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Function]");
+ } else if (i::String::Equals(tag, factory->Number_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~Number]");
+ } else if (i::String::Equals(tag, factory->RegExp_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~RegExp]");
+ } else if (i::String::Equals(tag, factory->String_string())) {
+ *result = v8::String::NewFromUtf8(isolate, "[object ~String]");
+ } else {
+ return false;
+ }
+ return true;
+}
Local<String> v8::Object::ObjectProtoToString() {
@@ -3418,6 +3449,7 @@
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
i::Handle<i::Object> name(self->class_name(), i_isolate);
+ i::Handle<i::Object> tag;
// Native implementation of Object.prototype.toString (v8natives.js):
// var c = %_ClassOf(this);
@@ -3432,6 +3464,27 @@
i_isolate->factory()->Arguments_string())) {
return v8::String::NewFromUtf8(isolate, "[object Object]");
} else {
+ if (internal::FLAG_harmony_tostring) {
+ i::Handle<i::Symbol> toStringTag =
+ Utils::OpenHandle(*Symbol::GetToStringTag(isolate));
+ EXCEPTION_PREAMBLE(i_isolate);
+ has_pending_exception =
+ !i::Runtime::GetObjectProperty(i_isolate, self, toStringTag)
+ .ToHandle(&tag);
+ EXCEPTION_BAILOUT_CHECK(i_isolate, Local<v8::String>());
+
+ if (!tag->IsUndefined()) {
+ if (!tag->IsString())
+ return v8::String::NewFromUtf8(isolate, "[object ???]");
+ i::Handle<i::String> tag_name = i::Handle<i::String>::cast(tag);
+ if (!i::String::Equals(class_name, tag_name)) {
+ Local<String> result;
+ if (GetPredefinedToString(tag_name, &result)) return result;
+
+ class_name = tag_name;
+ }
+ }
+ }
const char* prefix = "[object ";
Local<String> str = Utils::ToLocal(class_name);
const char* postfix = "]";
@@ -3772,11 +3825,6 @@
new_map->set_is_access_check_needed(true);
i::JSObject::MigrateToMap(obj, new_map);
}
-
-
-bool v8::Object::IsDirty() {
- return Utils::OpenHandle(this)->IsDirty();
-}
Local<v8::Object> v8::Object::Clone() {
@@ -6248,6 +6296,11 @@
Local<Symbol> v8::Symbol::GetUnscopables(Isolate* isolate) {
return GetWellKnownSymbol(isolate, "Symbol.unscopables");
}
+
+
+Local<Symbol> v8::Symbol::GetToStringTag(Isolate* isolate) {
+ return GetWellKnownSymbol(isolate, "Symbol.toStringTag");
+}
Local<Private> v8::Private::New(Isolate* isolate, Local<String> name) {
=======================================
--- /trunk/src/arm64/full-codegen-arm64.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/arm64/full-codegen-arm64.cc Wed Oct 22 07:27:53 2014 UTC
@@ -299,24 +299,24 @@
}
VisitDeclarations(scope()->declarations());
}
- }
- { Comment cmnt(masm_, "[ Stack check");
- PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
- Label ok;
- DCHECK(jssp.Is(__ StackPointer()));
- __ CompareRoot(jssp, Heap::kStackLimitRootIndex);
- __ B(hs, &ok);
- PredictableCodeSizeScope predictable(masm_,
-
Assembler::kCallSizeWithRelocation);
- __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
- __ Bind(&ok);
- }
+ { Comment cmnt(masm_, "[ Stack check");
+ PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
+ Label ok;
+ DCHECK(jssp.Is(__ StackPointer()));
+ __ CompareRoot(jssp, Heap::kStackLimitRootIndex);
+ __ B(hs, &ok);
+ PredictableCodeSizeScope predictable(masm_,
+
Assembler::kCallSizeWithRelocation);
+ __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
+ __ Bind(&ok);
+ }
- { Comment cmnt(masm_, "[ Body");
- DCHECK(loop_depth() == 0);
- VisitStatements(function()->body());
- DCHECK(loop_depth() == 0);
+ { Comment cmnt(masm_, "[ Body");
+ DCHECK(loop_depth() == 0);
+ VisitStatements(function()->body());
+ DCHECK(loop_depth() == 0);
+ }
}
// Always emit a 'return undefined' in case control fell off the end of
=======================================
--- /trunk/src/array.js Fri Oct 17 20:38:26 2014 UTC
+++ /trunk/src/array.js Wed Oct 22 07:27:53 2014 UTC
@@ -286,7 +286,9 @@
// prototype.
var current = array[index];
if (!IS_UNDEFINED(current) || index in array) {
- deleted_elements[i] = current;
+ // The spec requires [[DefineOwnProperty]] here, %AddElement is close
+ // enough (in that it ignores the prototype).
+ %AddElement(deleted_elements, i, current, NONE);
}
}
}
@@ -349,7 +351,7 @@
func = array.join;
}
if (!IS_SPEC_FUNCTION(func)) {
- return %_CallFunction(array, ObjectToString);
+ return %_CallFunction(array, NoSideEffectsObjectToString);
}
return %_CallFunction(array, func);
}
=======================================
--- /trunk/src/arraybuffer.js Tue Jul 15 00:04:47 2014 UTC
+++ /trunk/src/arraybuffer.js Wed Oct 22 07:27:53 2014 UTC
@@ -77,6 +77,9 @@
%AddNamedProperty(
$ArrayBuffer.prototype, "constructor", $ArrayBuffer, DONT_ENUM);
+ %AddNamedProperty($ArrayBuffer.prototype,
+ symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY);
+
InstallGetter($ArrayBuffer.prototype, "byteLength",
ArrayBufferGetByteLen);
InstallFunctions($ArrayBuffer, DONT_ENUM, $Array(
=======================================
--- /trunk/src/assert-scope.h Tue Sep 30 00:05:10 2014 UTC
+++ /trunk/src/assert-scope.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,7 +5,7 @@
#ifndef V8_ASSERT_SCOPE_H_
#define V8_ASSERT_SCOPE_H_
-#include "include/v8stdint.h"
+#include <stdint.h>
#include "src/base/macros.h"
namespace v8 {
=======================================
--- /trunk/src/ast-value-factory.h Fri Oct 17 11:41:30 2014 UTC
+++ /trunk/src/ast-value-factory.h Wed Oct 22 07:27:53 2014 UTC
@@ -281,6 +281,8 @@
STRING_CONSTANTS(F)
#undef F
}
+
+ Zone* zone() const { return zone_; }
const AstRawString* GetOneByteString(Vector<const uint8_t> literal);
const AstRawString* GetOneByteString(const char* string) {
=======================================
--- /trunk/src/ast.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/ast.cc Wed Oct 22 07:27:53 2014 UTC
@@ -59,9 +59,8 @@
}
-VariableProxy::VariableProxy(Zone* zone, Variable* var, int position,
- IdGen* id_gen)
- : Expression(zone, position, 0, id_gen),
+VariableProxy::VariableProxy(Zone* zone, Variable* var, int position)
+ : Expression(zone, position),
is_this_(var->is_this()),
is_assigned_(false),
is_resolved_(false),
@@ -73,8 +72,8 @@
VariableProxy::VariableProxy(Zone* zone, const AstRawString* name, bool
is_this,
- Interface* interface, int position, IdGen*
id_gen)
- : Expression(zone, position, 0, id_gen),
+ Interface* interface, int position)
+ : Expression(zone, position),
is_this_(is_this),
is_assigned_(false),
is_resolved_(false),
@@ -98,8 +97,8 @@
Assignment::Assignment(Zone* zone, Token::Value op, Expression* target,
- Expression* value, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Expression* value, int pos)
+ : Expression(zone, pos),
is_uninitialized_(false),
key_type_(ELEMENT),
store_mode_(STANDARD_STORE),
@@ -990,8 +989,8 @@
CaseClause::CaseClause(Zone* zone, Expression* label,
- ZoneList<Statement*>* statements, int pos, IdGen*
id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ ZoneList<Statement*>* statements, int pos)
+ : Expression(zone, pos),
label_(label),
statements_(statements),
compare_type_(Type::None(zone)) {}
=======================================
--- /trunk/src/ast.h Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/ast.h Wed Oct 22 07:27:53 2014 UTC
@@ -199,23 +199,6 @@
class AstNode: public ZoneObject {
public:
- // For generating IDs for AstNodes.
- class IdGen {
- public:
- IdGen() : id_(BailoutId::FirstUsable().ToInt()) {}
-
- int ReserveIdRange(int n) {
- int tmp = id_;
- id_ += n;
- return tmp;
- }
-
- private:
- int id_;
-
- DISALLOW_COPY_AND_ASSIGN(IdGen);
- };
-
#define DECLARE_TYPE_ENUM(type) k##type,
enum NodeType {
AST_NODE_LIST(DECLARE_TYPE_ENUM)
@@ -405,24 +388,30 @@
virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
byte to_boolean_types() const { return to_boolean_types_; }
- BailoutId id() const { return BailoutId(base_id() + 0); }
- TypeFeedbackId test_id() const { return TypeFeedbackId(base_id() + 1); }
+ void set_base_id(int id) { base_id_ = id; }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId id() const { return BailoutId(local_id(0)); }
+ TypeFeedbackId test_id() const { return TypeFeedbackId(local_id(1)); }
protected:
- Expression(Zone* zone, int pos, int num_ids_needed_by_subclass, IdGen*
id_gen)
+ Expression(Zone* zone, int pos)
: AstNode(pos),
- base_id_(
- id_gen->ReserveIdRange(num_ids_needed_by_subclass +
num_ids())),
+ base_id_(BailoutId::None().ToInt()),
bounds_(Bounds::Unbounded(zone)),
is_parenthesized_(false),
is_multi_parenthesized_(false) {}
+ static int parent_num_ids() { return 0; }
void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
- static int num_ids() { return 2; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
private:
- const int base_id_;
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
+ int base_id_;
Bounds bounds_;
byte to_boolean_types_;
bool is_parenthesized_ : 1;
@@ -454,29 +443,34 @@
return breakable_type_ == TARGET_FOR_ANONYMOUS;
}
- BailoutId EntryId() const { return BailoutId(base_id() + 0); }
- BailoutId ExitId() const { return BailoutId(base_id() + 1); }
+ void set_base_id(int id) { base_id_ = id; }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId EntryId() const { return BailoutId(local_id(0)); }
+ BailoutId ExitId() const { return BailoutId(local_id(1)); }
protected:
BreakableStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
- BreakableType breakable_type, int position,
- int num_ids_needed_by_subclass, IdGen* id_gen)
+ BreakableType breakable_type, int position)
: Statement(zone, position),
labels_(labels),
breakable_type_(breakable_type),
- base_id_(
- id_gen->ReserveIdRange(num_ids_needed_by_subclass +
num_ids())) {
+ base_id_(BailoutId::None().ToInt()) {
DCHECK(labels == NULL || labels->length() > 0);
}
+ static int parent_num_ids() { return 0; }
- static int num_ids() { return 2; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
ZoneList<const AstRawString*>* labels_;
BreakableType breakable_type_;
Label break_target_;
- const int base_id_;
+ int base_id_;
};
@@ -491,7 +485,8 @@
ZoneList<Statement*>* statements() { return &statements_; }
bool is_initializer_block() const { return is_initializer_block_; }
- BailoutId DeclsId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 1; }
+ BailoutId DeclsId() const { return BailoutId(local_id(0)); }
virtual bool IsJump() const OVERRIDE {
return !statements_.is_empty() && statements_.last()->IsJump()
@@ -503,19 +498,16 @@
protected:
Block(Zone* zone, ZoneList<const AstRawString*>* labels, int capacity,
- bool is_initializer_block, int pos, IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos,
num_ids(),
- id_gen),
+ bool is_initializer_block, int pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos),
statements_(capacity, zone),
is_initializer_block_(is_initializer_block),
scope_(NULL) {}
-
- static int num_ids() { return 1; }
- int base_id() const {
- return BreakableStatement::base_id() + BreakableStatement::num_ids();
- }
+ static int parent_num_ids() { return BreakableStatement::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
ZoneList<Statement*> statements_;
bool is_initializer_block_;
Scope* scope_;
@@ -763,7 +755,8 @@
Statement* body() const { return body_; }
- BailoutId OsrEntryId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 1; }
+ BailoutId OsrEntryId() const { return BailoutId(local_id(0)); }
virtual BailoutId ContinueId() const = 0;
virtual BailoutId StackCheckId() const = 0;
@@ -771,22 +764,15 @@
Label* continue_target() { return &continue_target_; }
protected:
- IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
int pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos,
- num_ids_needed_by_subclass + num_ids(), id_gen),
+ IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels,
int pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
body_(NULL) {}
+ static int parent_num_ids() { return BreakableStatement::num_ids(); }
+ void Initialize(Statement* body) { body_ = body; }
- void Initialize(Statement* body) {
- body_ = body;
- }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- static int num_ids() { return 1; }
- int base_id() const {
- return BreakableStatement::base_id() + BreakableStatement::num_ids();
- }
-
- private:
Statement* body_;
Label continue_target_;
};
@@ -803,23 +789,21 @@
Expression* cond() const { return cond_; }
+ static int num_ids() { return parent_num_ids() + 2; }
virtual BailoutId ContinueId() const OVERRIDE {
- return BailoutId(base_id() + 0);
+ return BailoutId(local_id(0));
}
virtual BailoutId StackCheckId() const OVERRIDE { return BackEdgeId(); }
- BailoutId BackEdgeId() const { return BailoutId(base_id() + 1); }
+ BailoutId BackEdgeId() const { return BailoutId(local_id(1)); }
protected:
- DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen),
cond_(NULL) {}
-
- static int num_ids() { return 2; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ DoWhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : IterationStatement(zone, labels, pos), cond_(NULL) {}
+ static int parent_num_ids() { return IterationStatement::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Expression* cond_;
};
@@ -841,23 +825,21 @@
may_have_function_literal_ = value;
}
+ static int num_ids() { return parent_num_ids() + 1; }
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
- BailoutId BodyId() const { return BailoutId(base_id() + 0); }
+ BailoutId BodyId() const { return BailoutId(local_id(0)); }
protected:
- WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen),
+ WhileStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : IterationStatement(zone, labels, pos),
cond_(NULL),
may_have_function_literal_(true) {}
-
- static int num_ids() { return 1; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ static int parent_num_ids() { return IterationStatement::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Expression* cond_;
// True if there is a function literal subexpression in the condition.
@@ -890,32 +872,30 @@
may_have_function_literal_ = value;
}
+ static int num_ids() { return parent_num_ids() + 2; }
virtual BailoutId ContinueId() const OVERRIDE {
- return BailoutId(base_id() + 0);
+ return BailoutId(local_id(0));
}
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
- BailoutId BodyId() const { return BailoutId(base_id() + 1); }
+ BailoutId BodyId() const { return BailoutId(local_id(1)); }
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
Variable* loop_variable() { return loop_variable_; }
void set_loop_variable(Variable* var) { loop_variable_ = var; }
protected:
- ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos,
- IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids(), id_gen),
+ ForStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
+ : IterationStatement(zone, labels, pos),
init_(NULL),
cond_(NULL),
next_(NULL),
may_have_function_literal_(true),
loop_variable_(NULL) {}
-
- static int num_ids() { return 2; }
- int base_id() const {
- return IterationStatement::base_id() + IterationStatement::num_ids();
- }
+ static int parent_num_ids() { return IterationStatement::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Statement* init_;
Expression* cond_;
Statement* next_;
@@ -943,12 +923,8 @@
Expression* subject() const { return subject_; }
protected:
- ForEachStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : IterationStatement(zone, labels, pos, num_ids_needed_by_subclass,
- id_gen),
- each_(NULL),
- subject_(NULL) {}
+ ForEachStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : IterationStatement(zone, labels, pos), each_(NULL), subject_(NULL)
{}
private:
Expression* each_;
@@ -981,24 +957,22 @@
ForInType for_in_type() const { return for_in_type_; }
void set_for_in_type(ForInType type) { for_in_type_ = type; }
- BailoutId BodyId() const { return BailoutId(base_id() + 0); }
- BailoutId PrepareId() const { return BailoutId(base_id() + 1); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId BodyId() const { return BailoutId(local_id(0)); }
+ BailoutId PrepareId() const { return BailoutId(local_id(1)); }
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BodyId(); }
protected:
- ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- IdGen* id_gen)
- : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
+ ForInStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : ForEachStatement(zone, labels, pos),
for_in_type_(SLOW_FOR_IN),
for_in_feedback_slot_(FeedbackVectorSlot::Invalid()) {}
+ static int parent_num_ids() { return ForEachStatement::num_ids(); }
- static int num_ids() { return 2; }
- int base_id() const {
- return ForEachStatement::base_id() + ForEachStatement::num_ids();
- }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
ForInType for_in_type_;
FeedbackVectorSlot for_in_feedback_slot_;
};
@@ -1049,23 +1023,21 @@
virtual BailoutId ContinueId() const OVERRIDE { return EntryId(); }
virtual BailoutId StackCheckId() const OVERRIDE { return BackEdgeId(); }
- BailoutId BackEdgeId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 1; }
+ BailoutId BackEdgeId() const { return BailoutId(local_id(0)); }
protected:
- ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- IdGen* id_gen)
- : ForEachStatement(zone, labels, pos, num_ids(), id_gen),
+ ForOfStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : ForEachStatement(zone, labels, pos),
assign_iterator_(NULL),
next_result_(NULL),
result_done_(NULL),
assign_each_(NULL) {}
+ static int parent_num_ids() { return ForEachStatement::num_ids(); }
- static int num_ids() { return 1; }
- int base_id() const {
- return ForEachStatement::base_id() + ForEachStatement::num_ids();
- }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
Expression* assign_iterator_;
Expression* next_result_;
Expression* result_done_;
@@ -1180,18 +1152,20 @@
Label* body_target() { return &body_target_; }
ZoneList<Statement*>* statements() const { return statements_; }
- BailoutId EntryId() const { return BailoutId(base_id() + 0); }
- TypeFeedbackId CompareId() { return TypeFeedbackId(base_id() + 1); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId EntryId() const { return BailoutId(local_id(0)); }
+ TypeFeedbackId CompareId() { return TypeFeedbackId(local_id(1)); }
Type* compare_type() { return compare_type_; }
void set_compare_type(Type* type) { compare_type_ = type; }
+
+ protected:
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
CaseClause(Zone* zone, Expression* label, ZoneList<Statement*>*
statements,
- int pos, IdGen* id_gen);
-
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ int pos);
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
Expression* label_;
Label body_target_;
@@ -1213,9 +1187,8 @@
ZoneList<CaseClause*>* cases() const { return cases_; }
protected:
- SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos,
- IdGen* id_gen)
- : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos, 0,
id_gen),
+ SwitchStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int
pos)
+ : BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
tag_(NULL),
cases_(NULL) {}
@@ -1246,27 +1219,34 @@
&& HasElseStatement() && else_statement()->IsJump();
}
- BailoutId IfId() const { return BailoutId(base_id() + 0); }
- BailoutId ThenId() const { return BailoutId(base_id() + 1); }
- BailoutId ElseId() const { return BailoutId(base_id() + 2); }
+ void set_base_id(int id) { base_id_ = id; }
+ static int num_ids() { return parent_num_ids() + 3; }
+ BailoutId IfId() const { return BailoutId(local_id(0)); }
+ BailoutId ThenId() const { return BailoutId(local_id(1)); }
+ BailoutId ElseId() const { return BailoutId(local_id(2)); }
protected:
IfStatement(Zone* zone, Expression* condition, Statement* then_statement,
- Statement* else_statement, int pos, IdGen* id_gen)
+ Statement* else_statement, int pos)
: Statement(zone, pos),
condition_(condition),
then_statement_(then_statement),
else_statement_(else_statement),
- base_id_(id_gen->ReserveIdRange(num_ids())) {}
+ base_id_(BailoutId::None().ToInt()) {}
+ static int parent_num_ids() { return 0; }
- static int num_ids() { return 3; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Expression* condition_;
Statement* then_statement_;
Statement* else_statement_;
- const int base_id_;
+ int base_id_;
};
@@ -1370,17 +1350,24 @@
public:
DECLARE_NODE_TYPE(DebuggerStatement)
- BailoutId DebugBreakId() const { return BailoutId(base_id() + 0); }
+ void set_base_id(int id) { base_id_ = id; }
+ static int num_ids() { return parent_num_ids() + 1; }
+ BailoutId DebugBreakId() const { return BailoutId(local_id(0)); }
protected:
- explicit DebuggerStatement(Zone* zone, int pos, IdGen* id_gen)
- : Statement(zone, pos), base_id_(id_gen->ReserveIdRange(num_ids()))
{}
+ explicit DebuggerStatement(Zone* zone, int pos)
+ : Statement(zone, pos), base_id_(BailoutId::None().ToInt()) {}
+ static int parent_num_ids() { return 0; }
- static int num_ids() { return 1; }
- int base_id() const { return base_id_; }
+ int base_id() const {
+ DCHECK(!BailoutId(base_id_).IsNone());
+ return base_id_;
+ }
private:
- const int base_id_;
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
+ int base_id_;
};
@@ -1426,18 +1413,19 @@
uint32_t Hash();
static bool Match(void* literal1, void* literal2);
+ static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId LiteralFeedbackId() const {
- return TypeFeedbackId(base_id() + 0);
+ return TypeFeedbackId(local_id(0));
}
protected:
- Literal(Zone* zone, const AstValue* value, int position, IdGen* id_gen)
- : Expression(zone, position, num_ids(), id_gen), value_(value) {}
+ Literal(Zone* zone, const AstValue* value, int position)
+ : Expression(zone, position), value_(value) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
const AstValue* value_;
};
@@ -1456,9 +1444,8 @@
}
protected:
- MaterializedLiteral(Zone* zone, int literal_index, int pos,
- int num_ids_needed_by_subclass, IdGen* id_gen)
- : Expression(zone, pos, num_ids_needed_by_subclass, id_gen),
+ MaterializedLiteral(Zone* zone, int literal_index, int pos)
+ : Expression(zone, pos),
literal_index_(literal_index),
is_simple_(false),
depth_(0) {}
@@ -1588,9 +1575,8 @@
protected:
ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int
literal_index,
- int boilerplate_properties, bool has_function, int pos,
- IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
+ int boilerplate_properties, bool has_function, int pos)
+ : MaterializedLiteral(zone, literal_index, pos),
properties_(properties),
boilerplate_properties_(boilerplate_properties),
fast_elements_(false),
@@ -1617,9 +1603,8 @@
protected:
RegExpLiteral(Zone* zone, const AstRawString* pattern,
- const AstRawString* flags, int literal_index, int pos,
- IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, 0, id_gen),
+ const AstRawString* flags, int literal_index, int pos)
+ : MaterializedLiteral(zone, literal_index, pos),
pattern_(pattern),
flags_(flags) {
set_depth(1);
@@ -1639,9 +1624,13 @@
Handle<FixedArray> constant_elements() const { return
constant_elements_; }
ZoneList<Expression*>* values() const { return values_; }
+
+ // Unlike other AST nodes, this number of bailout IDs allocated for an
+ // ArrayLiteral can vary, so num_ids() is not a static method.
+ int num_ids() const { return parent_num_ids() + values()->length(); }
// Return an AST id for an element that is used in simulate instructions.
- BailoutId GetIdForElement(int i) { return BailoutId(base_id() + i); }
+ BailoutId GetIdForElement(int i) { return BailoutId(local_id(i)); }
// Populate the constant elements fixed array.
void BuildConstantElements(Isolate* isolate);
@@ -1661,16 +1650,13 @@
protected:
ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, int
literal_index,
- int pos, IdGen* id_gen)
- : MaterializedLiteral(zone, literal_index, pos, num_ids(values),
id_gen),
- values_(values) {}
-
- static int num_ids(ZoneList<Expression*>* values) { return
values->length(); }
- int base_id() const {
- return MaterializedLiteral::base_id() + MaterializedLiteral::num_ids();
- }
+ int pos)
+ : MaterializedLiteral(zone, literal_index, pos), values_(values) {}
+ static int parent_num_ids() { return MaterializedLiteral::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Handle<FixedArray> constant_elements_;
ZoneList<Expression*>* values_;
};
@@ -1726,10 +1712,10 @@
}
protected:
- VariableProxy(Zone* zone, Variable* var, int position, IdGen* id_gen);
+ VariableProxy(Zone* zone, Variable* var, int position);
VariableProxy(Zone* zone, const AstRawString* name, bool is_this,
- Interface* interface, int position, IdGen* id_gen);
+ Interface* interface, int position);
bool is_this_ : 1;
bool is_assigned_ : 1;
@@ -1752,9 +1738,9 @@
Expression* obj() const { return obj_; }
Expression* key() const { return key_; }
- BailoutId LoadId() const { return BailoutId(base_id() + 0); }
- TypeFeedbackId PropertyFeedbackId() { return TypeFeedbackId(base_id() +
1); }
-
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId LoadId() const { return BailoutId(local_id(0)); }
+ TypeFeedbackId PropertyFeedbackId() { return
TypeFeedbackId(local_id(1)); }
bool IsStringAccess() const { return is_string_access_; }
@@ -1797,19 +1783,19 @@
}
protected:
- Property(Zone* zone, Expression* obj, Expression* key, int pos, IdGen*
id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Property(Zone* zone, Expression* obj, Expression* key, int pos)
+ : Expression(zone, pos),
is_for_call_(false),
is_uninitialized_(false),
is_string_access_(false),
property_feedback_slot_(FeedbackVectorICSlot::Invalid()),
obj_(obj),
key_(key) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
bool is_for_call_ : 1;
bool is_uninitialized_ : 1;
bool is_string_access_ : 1;
@@ -1873,8 +1859,9 @@
}
bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator*
it);
- BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
- BailoutId EvalOrLookupId() const { return BailoutId(base_id() + 1); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId ReturnId() const { return BailoutId(local_id(0)); }
+ BailoutId EvalOrLookupId() const { return BailoutId(local_id(1)); }
enum CallType {
POSSIBLY_EVAL_CALL,
@@ -1896,8 +1883,8 @@
protected:
Call(Zone* zone, Expression* expression, ZoneList<Expression*>*
arguments,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
call_feedback_slot_(FeedbackVectorICSlot::Invalid()),
expression_(expression),
arguments_(arguments) {
@@ -1905,11 +1892,11 @@
expression->AsProperty()->mark_for_call();
}
}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
FeedbackVectorICSlot call_feedback_slot_;
Expression* expression_;
ZoneList<Expression*>* arguments_;
@@ -1947,23 +1934,24 @@
return allocation_site_;
}
+ static int num_ids() { return parent_num_ids() + 1; }
static int feedback_slots() { return 1; }
-
- BailoutId ReturnId() const { return BailoutId(base_id() + 0); }
+ BailoutId ReturnId() const { return BailoutId(local_id(0)); }
protected:
CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>*
arguments,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
expression_(expression),
arguments_(arguments),
is_monomorphic_(false),
callnew_feedback_slot_(FeedbackVectorSlot::Invalid()) {}
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Expression* expression_;
ZoneList<Expression*>* arguments_;
bool is_monomorphic_;
@@ -2000,24 +1988,25 @@
return callruntime_feedback_slot_;
}
+ static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId CallRuntimeFeedbackId() const {
- return TypeFeedbackId(base_id() + 0);
+ return TypeFeedbackId(local_id(0));
}
protected:
CallRuntime(Zone* zone, const AstRawString* name,
const Runtime::Function* function,
- ZoneList<Expression*>* arguments, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ ZoneList<Expression*>* arguments, int pos)
+ : Expression(zone, pos),
raw_name_(name),
function_(function),
arguments_(arguments),
callruntime_feedback_slot_(FeedbackVectorICSlot::Invalid()) {}
-
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
const AstRawString* raw_name_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_;
@@ -2034,25 +2023,23 @@
// For unary not (Token::NOT), the AST ids where true and false will
// actually be materialized, respectively.
- BailoutId MaterializeTrueId() const { return BailoutId(base_id() + 0); }
- BailoutId MaterializeFalseId() const { return BailoutId(base_id() + 1); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId MaterializeTrueId() const { return BailoutId(local_id(0)); }
+ BailoutId MaterializeFalseId() const { return BailoutId(local_id(1)); }
virtual void RecordToBooleanTypeFeedback(
TypeFeedbackOracle* oracle) OVERRIDE;
protected:
- UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int
pos,
- IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
- op_(op),
- expression_(expression) {
+ UnaryOperation(Zone* zone, Token::Value op, Expression* expression, int
pos)
+ : Expression(zone, pos), op_(op), expression_(expression) {
DCHECK(Token::IsUnaryOp(op));
}
-
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Token::Value op_;
Expression* expression_;
};
@@ -2074,10 +2061,11 @@
// The short-circuit logical operations need an AST ID for their
// right-hand subexpression.
- BailoutId RightId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId RightId() const { return BailoutId(local_id(0)); }
TypeFeedbackId BinaryOperationFeedbackId() const {
- return TypeFeedbackId(base_id() + 1);
+ return TypeFeedbackId(local_id(1));
}
Maybe<int> fixed_right_arg() const {
return has_fixed_right_arg_ ? Maybe<int>(fixed_right_arg_value_)
@@ -2093,18 +2081,18 @@
protected:
BinaryOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Expression* right, int pos)
+ : Expression(zone, pos),
op_(static_cast<byte>(op)),
left_(left),
right_(right) {
DCHECK(Token::IsBinaryOp(op));
}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
const byte op_; // actually Token::Value
// TODO(rossberg): the fixed arg should probably be represented as a
Constant
// type for the RHS. Currenty it's actually a Maybe<int>
@@ -2145,28 +2133,29 @@
void set_store_mode(KeyedAccessStoreMode mode) { store_mode_ = mode; }
void set_type(Type* type) { type_ = type; }
- BailoutId AssignmentId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 3; }
+ BailoutId AssignmentId() const { return BailoutId(local_id(0)); }
TypeFeedbackId CountBinOpFeedbackId() const {
- return TypeFeedbackId(base_id() + 1);
+ return TypeFeedbackId(local_id(1));
}
TypeFeedbackId CountStoreFeedbackId() const {
- return TypeFeedbackId(base_id() + 2);
+ return TypeFeedbackId(local_id(2));
}
protected:
CountOperation(Zone* zone, Token::Value op, bool is_prefix, Expression*
expr,
- int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ int pos)
+ : Expression(zone, pos),
op_(op),
is_prefix_(is_prefix),
key_type_(ELEMENT),
store_mode_(STANDARD_STORE),
expression_(expr) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 3; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
Token::Value op_;
bool is_prefix_ : 1;
IcCheckType key_type_ : 1;
@@ -2187,8 +2176,9 @@
Expression* right() const { return right_; }
// Type feedback information.
+ static int num_ids() { return parent_num_ids() + 1; }
TypeFeedbackId CompareOperationFeedbackId() const {
- return TypeFeedbackId(base_id() + 0);
+ return TypeFeedbackId(local_id(0));
}
Type* combined_type() const { return combined_type_; }
void set_combined_type(Type* type) { combined_type_ = type; }
@@ -2200,19 +2190,19 @@
protected:
CompareOperation(Zone* zone, Token::Value op, Expression* left,
- Expression* right, int pos, IdGen* id_gen)
- : Expression(zone, pos, num_ids(), id_gen),
+ Expression* right, int pos)
+ : Expression(zone, pos),
op_(op),
left_(left),
right_(right),
combined_type_(Type::None(zone)) {
DCHECK(Token::IsCompareOp(op));
}
+ static int parent_num_ids() { return Expression::num_ids(); }
- static int num_ids() { return 1; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
- private:
Token::Value op_;
Expression* left_;
Expression* right_;
@@ -2229,21 +2219,22 @@
Expression* then_expression() const { return then_expression_; }
Expression* else_expression() const { return else_expression_; }
- BailoutId ThenId() const { return BailoutId(base_id() + 0); }
- BailoutId ElseId() const { return BailoutId(base_id() + 1); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId ThenId() const { return BailoutId(local_id(0)); }
+ BailoutId ElseId() const { return BailoutId(local_id(1)); }
protected:
Conditional(Zone* zone, Expression* condition, Expression*
then_expression,
- Expression* else_expression, int position, IdGen* id_gen)
- : Expression(zone, position, num_ids(), id_gen),
+ Expression* else_expression, int position)
+ : Expression(zone, position),
condition_(condition),
then_expression_(then_expression),
else_expression_(else_expression) {}
-
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
Expression* condition_;
Expression* then_expression_;
Expression* else_expression_;
@@ -2266,12 +2257,11 @@
// This check relies on the definition order of token in token.h.
bool is_compound() const { return op() > Token::ASSIGN; }
- BailoutId AssignmentId() const { return BailoutId(base_id() + 0); }
+ static int num_ids() { return parent_num_ids() + 2; }
+ BailoutId AssignmentId() const { return BailoutId(local_id(0)); }
// Type feedback information.
- TypeFeedbackId AssignmentFeedbackId() {
- return TypeFeedbackId(base_id() + 1);
- }
+ TypeFeedbackId AssignmentFeedbackId() { return
TypeFeedbackId(local_id(1)); }
virtual bool IsMonomorphic() OVERRIDE {
return receiver_types_.length() == 1;
}
@@ -2292,13 +2282,11 @@
protected:
Assignment(Zone* zone, Token::Value op, Expression* target, Expression*
value,
- int pos, IdGen* id_gen);
-
- static int num_ids() { return 2; }
- int base_id() const { return Expression::base_id() +
Expression::num_ids(); }
+ int pos);
+ static int parent_num_ids() { return Expression::num_ids(); }
- template<class Visitor>
- void Init(Zone* zone, AstNodeFactory<Visitor>* factory) {
+ template <class Visitor>
+ void Init(AstNodeFactory<Visitor>* factory) {
DCHECK(Token::IsAssignmentOp(op_));
if (is_compound()) {
binary_operation_ = factory->NewBinaryOperation(
@@ -2307,6 +2295,8 @@
}
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
bool is_uninitialized_ : 1;
IcCheckType key_type_ : 1;
KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed,
@@ -2367,8 +2357,8 @@
protected:
Yield(Zone* zone, Expression* generator_object, Expression* expression,
- Kind yield_kind, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen),
+ Kind yield_kind, int pos)
+ : Expression(zone, pos),
generator_object_(generator_object),
expression_(expression),
yield_kind_(yield_kind),
@@ -2391,8 +2381,8 @@
Expression* exception() const { return exception_; }
protected:
- Throw(Zone* zone, Expression* exception, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen), exception_(exception) {}
+ Throw(Zone* zone, Expression* exception, int pos)
+ : Expression(zone, pos), exception_(exception) {}
private:
Expression* exception_;
@@ -2546,8 +2536,8 @@
ParameterFlag has_duplicate_parameters,
IsFunctionFlag is_function,
IsParenthesizedFlag is_parenthesized, FunctionKind kind,
- int position, IdGen* id_gen)
- : Expression(zone, position, 0, id_gen),
+ int position)
+ : Expression(zone, position),
raw_name_(name),
scope_(scope),
body_(body),
@@ -2613,8 +2603,8 @@
protected:
ClassLiteral(Zone* zone, const AstRawString* name, Expression* extends,
Expression* constructor, ZoneList<Property*>* properties,
- int start_position, int end_position, IdGen* id_gen)
- : Expression(zone, start_position, 0, id_gen),
+ int start_position, int end_position)
+ : Expression(zone, start_position),
raw_name_(name),
extends_(extends),
constructor_(constructor),
@@ -2639,8 +2629,8 @@
protected:
NativeFunctionLiteral(Zone* zone, const AstRawString* name,
- v8::Extension* extension, int pos, IdGen* id_gen)
- : Expression(zone, pos, 0, id_gen), name_(name),
extension_(extension) {}
+ v8::Extension* extension, int pos)
+ : Expression(zone, pos), name_(name), extension_(extension) {}
***The diff for this file has been truncated for email.***
=======================================
--- /trunk/src/base/atomicops.h Wed Oct 8 00:05:11 2014 UTC
+++ /trunk/src/base/atomicops.h Wed Oct 22 07:27:53 2014 UTC
@@ -25,7 +25,7 @@
#ifndef V8_BASE_ATOMICOPS_H_
#define V8_BASE_ATOMICOPS_H_
-#include "include/v8stdint.h"
+#include <stdint.h>
#include "src/base/build_config.h"
#if defined(_WIN32) && defined(V8_HOST_ARCH_64_BIT)
=======================================
--- /trunk/src/base/bits.h Wed Oct 15 00:05:09 2014 UTC
+++ /trunk/src/base/bits.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,7 +5,7 @@
#ifndef V8_BASE_BITS_H_
#define V8_BASE_BITS_H_
-#include "include/v8stdint.h"
+#include <stdint.h>
#include "src/base/macros.h"
#if V8_CC_MSVC
#include <intrin.h>
=======================================
--- /trunk/src/base/functional.h Wed Oct 8 13:44:16 2014 UTC
+++ /trunk/src/base/functional.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,12 +5,14 @@
#ifndef V8_BASE_FUNCTIONAL_H_
#define V8_BASE_FUNCTIONAL_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstddef>
#include <cstring>
#include <functional>
#include <utility>
-#include "include/v8stdint.h"
#include "src/base/macros.h"
namespace v8 {
=======================================
--- /trunk/src/base/logging.h Tue Aug 5 00:05:55 2014 UTC
+++ /trunk/src/base/logging.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,9 +5,9 @@
#ifndef V8_BASE_LOGGING_H_
#define V8_BASE_LOGGING_H_
+#include <stdint.h>
#include <string.h>
-#include "include/v8stdint.h"
#include "src/base/build_config.h"
extern "C" void V8_Fatal(const char* file, int line, const char*
format, ...);
=======================================
--- /trunk/src/base/macros.h Thu Oct 2 00:05:29 2014 UTC
+++ /trunk/src/base/macros.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,9 +5,11 @@
#ifndef V8_BASE_MACROS_H_
#define V8_BASE_MACROS_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstring>
-#include "include/v8stdint.h"
#include "src/base/build_config.h"
#include "src/base/compiler-specific.h"
#include "src/base/logging.h"
=======================================
--- /trunk/src/base/once.h Fri Jun 6 00:04:56 2014 UTC
+++ /trunk/src/base/once.h Wed Oct 22 07:27:53 2014 UTC
@@ -52,6 +52,8 @@
#ifndef V8_BASE_ONCE_H_
#define V8_BASE_ONCE_H_
+#include <stddef.h>
+
#include "src/base/atomicops.h"
namespace v8 {
=======================================
--- /trunk/src/base/sys-info.h Tue Sep 2 12:59:15 2014 UTC
+++ /trunk/src/base/sys-info.h Wed Oct 22 07:27:53 2014 UTC
@@ -5,7 +5,7 @@
#ifndef V8_BASE_SYS_INFO_H_
#define V8_BASE_SYS_INFO_H_
-#include "include/v8stdint.h"
+#include <stdint.h>
#include "src/base/compiler-specific.h"
namespace v8 {
=======================================
--- /trunk/src/bignum-dtoa.cc Tue Aug 5 00:05:55 2014 UTC
+++ /trunk/src/bignum-dtoa.cc Wed Oct 22 07:27:53 2014 UTC
@@ -4,7 +4,6 @@
#include <cmath>
-#include "include/v8stdint.h"
#include "src/base/logging.h"
#include "src/utils.h"
=======================================
--- /trunk/src/bootstrapper.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/bootstrapper.cc Wed Oct 22 07:27:53 2014 UTC
@@ -1600,6 +1600,7 @@
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions)
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_numeric_literals)
+EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring)
void Genesis::InstallNativeFunctions_harmony_proxies() {
@@ -1624,6 +1625,7 @@
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_literals)
+EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring)
void Genesis::InitializeGlobal_harmony_regexps() {
Handle<JSObject> builtins(native_context()->builtins());
@@ -2164,6 +2166,8 @@
static const char* harmony_regexps_natives[] = {NULL};
static const char* harmony_arrow_functions_natives[] = {NULL};
static const char* harmony_numeric_literals_natives[] = {NULL};
+ static const char* harmony_tostring_natives[] = {"native
harmony-tostring.js",
+ NULL};
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount(); i++) {
=======================================
--- /trunk/src/cached-powers.cc Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/cached-powers.cc Wed Oct 22 07:27:53 2014 UTC
@@ -4,9 +4,9 @@
#include <limits.h>
#include <stdarg.h>
+#include <stdint.h>
#include <cmath>
-#include "include/v8stdint.h"
#include "src/base/logging.h"
#include "src/cached-powers.h"
#include "src/globals.h"
=======================================
--- /trunk/src/collection.js Wed Oct 15 13:35:30 2014 UTC
+++ /trunk/src/collection.js Wed Oct 22 07:27:53 2014 UTC
@@ -133,6 +133,8 @@
%SetCode($Set, SetConstructor);
%FunctionSetPrototype($Set, new $Object());
%AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM);
+ %AddNamedProperty(
+ $Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_ONLY);
%FunctionSetLength(SetForEach, 1);
@@ -282,6 +284,8 @@
%SetCode($Map, MapConstructor);
%FunctionSetPrototype($Map, new $Object());
%AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM);
+ %AddNamedProperty(
+ $Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY);
%FunctionSetLength(MapForEach, 1);
=======================================
--- /trunk/src/compiler/arm64/code-generator-arm64.cc Wed Oct 15 13:35:30
2014 UTC
+++ /trunk/src/compiler/arm64/code-generator-arm64.cc Wed Oct 22 07:27:53
2014 UTC
@@ -545,9 +545,8 @@
Register value = i.InputRegister(2);
__ Add(index, object, Operand(index, SXTW));
__ Str(value, MemOperand(index));
- SaveFPRegsMode mode = code_->frame()->DidAllocateDoubleRegisters()
- ? kSaveFPRegs
- : kDontSaveFPRegs;
+ SaveFPRegsMode mode =
+ frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs :
kDontSaveFPRegs;
// TODO(dcarney): we shouldn't test write barriers from c calls.
LinkRegisterStatus lr_status = kLRHasNotBeenSaved;
UseScratchRegisterScope scope(masm());
=======================================
--- /trunk/src/compiler/ast-graph-builder.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/ast-graph-builder.cc Wed Oct 22 07:27:53 2014 UTC
@@ -17,8 +17,9 @@
namespace internal {
namespace compiler {
-AstGraphBuilder::AstGraphBuilder(CompilationInfo* info, JSGraph* jsgraph)
- : StructuredGraphBuilder(jsgraph->graph(), jsgraph->common()),
+AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
+ JSGraph* jsgraph)
+ : StructuredGraphBuilder(local_zone, jsgraph->graph(),
jsgraph->common()),
info_(info),
jsgraph_(jsgraph),
globals_(0, info->zone()),
@@ -610,6 +611,8 @@
VisitForTest(stmt->cond());
Node* condition = environment()->Pop();
for_loop.BreakUnless(condition);
+ } else {
+ for_loop.BreakUnless(jsgraph()->TrueConstant());
}
VisitIterationBody(stmt, &for_loop, 0);
for_loop.EndBody();
=======================================
--- /trunk/src/compiler/ast-graph-builder.h Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/ast-graph-builder.h Wed Oct 22 07:27:53 2014 UTC
@@ -25,7 +25,7 @@
// of function inlining.
class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
public:
- AstGraphBuilder(CompilationInfo* info, JSGraph* jsgraph);
+ AstGraphBuilder(Zone* local_zone, CompilationInfo* info, JSGraph*
jsgraph);
// Creates a graph by visiting the entire AST.
bool CreateGraph();
=======================================
--- /trunk/src/compiler/code-generator.cc Wed Oct 15 13:35:30 2014 UTC
+++ /trunk/src/compiler/code-generator.cc Wed Oct 22 07:27:53 2014 UTC
@@ -12,8 +12,11 @@
namespace internal {
namespace compiler {
-CodeGenerator::CodeGenerator(InstructionSequence* code)
- : code_(code),
+CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
+ InstructionSequence* code)
+ : frame_(frame),
+ linkage_(linkage),
+ code_(code),
current_block_(BasicBlock::RpoNumber::Invalid()),
current_source_position_(SourcePosition::Invalid()),
masm_(code->zone()->isolate(), NULL, 0),
=======================================
--- /trunk/src/compiler/code-generator.h Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/code-generator.h Wed Oct 22 07:27:53 2014 UTC
@@ -20,15 +20,16 @@
// Generates native code for a sequence of instructions.
class CodeGenerator FINAL : public GapResolver::Assembler {
public:
- explicit CodeGenerator(InstructionSequence* code);
+ explicit CodeGenerator(Frame* frame, Linkage* linkage,
+ InstructionSequence* code);
// Generate native code.
Handle<Code> GenerateCode();
InstructionSequence* code() const { return code_; }
- Frame* frame() const { return code()->frame(); }
+ Frame* frame() const { return frame_; }
Isolate* isolate() const { return zone()->isolate(); }
- Linkage* linkage() const { return code()->linkage(); }
+ Linkage* linkage() const { return linkage_; }
private:
MacroAssembler* masm() { return &masm_; }
@@ -116,7 +117,9 @@
int pc_offset_;
};
- InstructionSequence* code_;
+ Frame* const frame_;
+ Linkage* const linkage_;
+ InstructionSequence* const code_;
BasicBlock::RpoNumber current_block_;
SourcePosition current_source_position_;
MacroAssembler masm_;
=======================================
--- /trunk/src/compiler/control-reducer.cc Fri Oct 17 20:38:26 2014 UTC
+++ /trunk/src/compiler/control-reducer.cc Wed Oct 22 07:27:53 2014 UTC
@@ -21,16 +21,17 @@
class ControlReducerImpl {
public:
- ControlReducerImpl(JSGraph* jsgraph, CommonOperatorBuilder* common)
- : zone_(jsgraph->zone()->isolate()),
+ ControlReducerImpl(Zone* zone, JSGraph* jsgraph,
+ CommonOperatorBuilder* common)
+ : zone_(zone),
jsgraph_(jsgraph),
common_(common),
- state_(jsgraph->graph()->NodeCount(), kUnvisited, &zone_),
- stack_(&zone_),
- revisit_(&zone_),
+ state_(jsgraph->graph()->NodeCount(), kUnvisited, zone_),
+ stack_(zone_),
+ revisit_(zone_),
dead_(NULL) {}
- Zone zone_;
+ Zone* zone_;
JSGraph* jsgraph_;
CommonOperatorBuilder* common_;
ZoneVector<VisitState> state_;
@@ -40,7 +41,7 @@
void Trim() {
// Mark all nodes reachable from end.
- NodeVector nodes(&zone_);
+ NodeVector nodes(zone_);
state_.assign(jsgraph_->graph()->NodeCount(), kUnvisited);
Push(jsgraph_->graph()->end());
while (!stack_.empty()) {
@@ -104,17 +105,17 @@
}
};
-void ControlReducer::ReduceGraph(JSGraph* jsgraph,
+void ControlReducer::ReduceGraph(Zone* zone, JSGraph* jsgraph,
CommonOperatorBuilder* common) {
- ControlReducerImpl impl(jsgraph, NULL);
+ ControlReducerImpl impl(zone, jsgraph, NULL);
// Only trim the graph for now. Control reduction can reduce
non-terminating
// loops to graphs that are unschedulable at the moment.
impl.Trim();
}
-void ControlReducer::TrimGraph(JSGraph* jsgraph) {
- ControlReducerImpl impl(jsgraph, NULL);
+void ControlReducer::TrimGraph(Zone* zone, JSGraph* jsgraph) {
+ ControlReducerImpl impl(zone, jsgraph, NULL);
impl.Trim();
}
}
=======================================
--- /trunk/src/compiler/control-reducer.h Fri Oct 17 20:38:26 2014 UTC
+++ /trunk/src/compiler/control-reducer.h Wed Oct 22 07:27:53 2014 UTC
@@ -15,10 +15,11 @@
class ControlReducer {
public:
// Perform branch folding and dead code elimination on the graph.
- static void ReduceGraph(JSGraph* graph, CommonOperatorBuilder* builder);
+ static void ReduceGraph(Zone* zone, JSGraph* graph,
+ CommonOperatorBuilder* builder);
// Trim nodes in the graph that are not reachable from end.
- static void TrimGraph(JSGraph* graph);
+ static void TrimGraph(Zone* zone, JSGraph* graph);
};
}
}
=======================================
--- /trunk/src/compiler/graph-builder.cc Fri Oct 17 11:41:30 2014 UTC
+++ /trunk/src/compiler/graph-builder.cc Wed Oct 22 07:27:53 2014 UTC
@@ -19,12 +19,12 @@
namespace compiler {
-StructuredGraphBuilder::StructuredGraphBuilder(Graph* graph,
+StructuredGraphBuilder::StructuredGraphBuilder(Zone* local_zone, Graph*
graph,
CommonOperatorBuilder*
common)
: GraphBuilder(graph),
common_(common),
environment_(NULL),
- local_zone_(isolate()),
+ local_zone_(local_zone),
current_context_(NULL),
exit_control_(NULL) {}
=======================================
--- /trunk/src/compiler/graph-builder.h Mon Oct 13 00:05:20 2014 UTC
+++ /trunk/src/compiler/graph-builder.h Wed Oct 22 07:27:53 2014 UTC
@@ -79,7 +79,8 @@
// StubGraphBuilder).
class StructuredGraphBuilder : public GraphBuilder {
public:
- StructuredGraphBuilder(Graph* graph, CommonOperatorBuilder* common);
+ StructuredGraphBuilder(Zone* zone, Graph* graph,
+ CommonOperatorBuilder* common);
virtual ~StructuredGraphBuilder() {}
// Creates a new Phi node having {count} input values.
@@ -123,7 +124,7 @@
Node* dead_control();
Zone* graph_zone() const { return graph()->zone(); }
- Zone* local_zone() { return &local_zone_; }
+ Zone* local_zone() const { return local_zone_; }
Isolate* isolate() const { return graph_zone()->isolate(); }
CommonOperatorBuilder* common() const { return common_; }
@@ -145,7 +146,7 @@
Environment* environment_;
// Zone local to the builder for data not leaking into the graph.
- Zone local_zone_;
+ Zone* local_zone_;
// Node representing the control dependency for dead code.
SetOncePointer<Node> dead_control_;
=======================================
--- /trunk/src/compiler/ia32/code-generator-ia32.cc Wed Oct 15 13:35:30
2014 UTC
+++ /trunk/src/compiler/ia32/code-generator-ia32.cc Wed Oct 22 07:27:53
2014 UTC
@@ -455,9 +455,8 @@
Register value = i.InputRegister(2);
__ mov(Operand(object, index, times_1, 0), value);
__ lea(index, Operand(object, index, times_1, 0));
- SaveFPRegsMode mode = code_->frame()->DidAllocateDoubleRegisters()
- ? kSaveFPRegs
- : kDontSaveFPRegs;
+ SaveFPRegsMode mode =
+ frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs :
kDontSaveFPRegs;
__ RecordWrite(object, index, value, mode);
break;
}
@@ -777,7 +776,7 @@
void CodeGenerator::AssemblePrologue() {
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
- Frame* frame = code_->frame();
+ Frame* frame = this->frame();
int stack_slots = frame->GetSpillSlotCount();
if (descriptor->kind() == CallDescriptor::kCallAddress) {
// Assemble a prologue similar the to cdecl calling convention.
=======================================
--- /trunk/src/compiler/ia32/instruction-selector-ia32.cc Fri Oct 17
20:38:26 2014 UTC
+++ /trunk/src/compiler/ia32/instruction-selector-ia32.cc Wed Oct 22
07:27:53 2014 UTC
@@ -648,11 +648,9 @@
// Shared routine for multiple compare operations.
-static inline void VisitCompare(InstructionSelector* selector,
- InstructionCode opcode,
- InstructionOperand* left,
- InstructionOperand* right,
- FlagsContinuation* cont) {
+static void VisitCompare(InstructionSelector* selector, InstructionCode
opcode,
+ InstructionOperand* left, InstructionOperand*
right,
+ FlagsContinuation* cont) {
IA32OperandGenerator g(selector);
if (cont->IsBranch()) {
selector->Emit(cont->Encode(opcode), NULL, left, right,
@@ -665,24 +663,36 @@
left, right);
}
}
+
+
+// Shared routine for multiple compare operations.
+static void VisitCompare(InstructionSelector* selector, InstructionCode
opcode,
+ Node* left, Node* right, FlagsContinuation* cont,
+ bool commutative) {
+ IA32OperandGenerator g(selector);
+ if (commutative && g.CanBeBetterLeftOperand(right)) {
+ std::swap(left, right);
+ }
+ VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right), cont);
+}
// Shared routine for multiple word compare operations.
-static inline void VisitWordCompare(InstructionSelector* selector, Node*
node,
- InstructionCode opcode,
- FlagsContinuation* cont, bool
commutative) {
+static void VisitWordCompare(InstructionSelector* selector, Node* node,
+ InstructionCode opcode, FlagsContinuation*
cont) {
IA32OperandGenerator g(selector);
- Node* left = node->InputAt(0);
- Node* right = node->InputAt(1);
+ Node* const left = node->InputAt(0);
+ Node* const right = node->InputAt(1);
// Match immediates on left or right side of comparison.
if (g.CanBeImmediate(right)) {
VisitCompare(selector, opcode, g.Use(left), g.UseImmediate(right),
cont);
} else if (g.CanBeImmediate(left)) {
- if (!commutative) cont->Commute();
+ if (!node->op()->HasProperty(Operator::kCommutative)) cont->Commute();
VisitCompare(selector, opcode, g.Use(right), g.UseImmediate(left),
cont);
} else {
- VisitCompare(selector, opcode, g.UseRegister(left), g.Use(right),
cont);
+ VisitCompare(selector, opcode, left, right, cont,
+ node->op()->HasProperty(Operator::kCommutative));
}
}
@@ -690,11 +700,8 @@
// Shared routine for multiple float compare operations.
static void VisitFloat64Compare(InstructionSelector* selector, Node* node,
FlagsContinuation* cont) {
- IA32OperandGenerator g(selector);
- Node* left = node->InputAt(0);
- Node* right = node->InputAt(1);
- VisitCompare(selector, kSSEFloat64Cmp, g.UseRegister(left), g.Use(right),
- cont);
+ VisitCompare(selector, kSSEFloat64Cmp, node->InputAt(0),
node->InputAt(1),
+ cont, node->op()->HasProperty(Operator::kCommutative));
}
@@ -729,19 +736,19 @@
switch (value->opcode()) {
case IrOpcode::kWord32Equal:
cont.OverwriteAndNegateIfEqual(kEqual);
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kInt32LessThan:
cont.OverwriteAndNegateIfEqual(kSignedLessThan);
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kInt32LessThanOrEqual:
cont.OverwriteAndNegateIfEqual(kSignedLessThanOrEqual);
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kUint32LessThan:
cont.OverwriteAndNegateIfEqual(kUnsignedLessThan);
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kUint32LessThanOrEqual:
cont.OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kFloat64Equal:
cont.OverwriteAndNegateIfEqual(kUnorderedEqual);
return VisitFloat64Compare(this, value, &cont);
@@ -777,9 +784,9 @@
}
break;
case IrOpcode::kInt32Sub:
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kWord32And:
- return VisitWordCompare(this, value, kIA32Test, &cont, true);
+ return VisitWordCompare(this, value, kIA32Test, &cont);
default:
break;
}
@@ -799,39 +806,39 @@
if (CanCover(user, value)) {
switch (value->opcode()) {
case IrOpcode::kInt32Sub:
- return VisitWordCompare(this, value, kIA32Cmp, &cont, false);
+ return VisitWordCompare(this, value, kIA32Cmp, &cont);
case IrOpcode::kWord32And:
- return VisitWordCompare(this, value, kIA32Test, &cont, true);
+ return VisitWordCompare(this, value, kIA32Test, &cont);
default:
break;
}
}
}
- return VisitWordCompare(this, node, kIA32Cmp, &cont, false);
+ VisitWordCompare(this, node, kIA32Cmp, &cont);
}
void InstructionSelector::VisitInt32LessThan(Node* node) {
FlagsContinuation cont(kSignedLessThan, node);
- return VisitWordCompare(this, node, kIA32Cmp, &cont, false);
+ VisitWordCompare(this, node, kIA32Cmp, &cont);
}
void InstructionSelector::VisitInt32LessThanOrEqual(Node* node) {
FlagsContinuation cont(kSignedLessThanOrEqual, node);
- return VisitWordCompare(this, node, kIA32Cmp, &cont, false);
+ VisitWordCompare(this, node, kIA32Cmp, &cont);
}
void InstructionSelector::VisitUint32LessThan(Node* node) {
FlagsContinuation cont(kUnsignedLessThan, node);
- return VisitWordCompare(this, node, kIA32Cmp, &cont, false);
+ VisitWordCompare(this, node, kIA32Cmp, &cont);
}
void InstructionSelector::VisitUint32LessThanOrEqual(Node* node) {
FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
- return VisitWordCompare(this, node, kIA32Cmp, &cont, false);
+ VisitWordCompare(this, node, kIA32Cmp, &cont);
}
=======================================
--- /trunk/src/compiler/instruction-selector.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/instruction-selector.cc Wed Oct 22 07:27:53 2014 UTC
@@ -13,11 +13,13 @@
namespace internal {
namespace compiler {
-InstructionSelector::InstructionSelector(InstructionSequence* sequence,
+InstructionSelector::InstructionSelector(Zone* local_zone, Linkage*
linkage,
+ InstructionSequence* sequence,
Schedule* schedule,
SourcePositionTable*
source_positions,
Features features)
- : zone_(sequence->isolate()),
+ : zone_(local_zone),
+ linkage_(linkage),
sequence_(sequence),
source_positions_(source_positions),
features_(features),
=======================================
--- /trunk/src/compiler/instruction-selector.h Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/instruction-selector.h Wed Oct 22 07:27:53 2014 UTC
@@ -25,7 +25,8 @@
// Forward declarations.
class Features;
- InstructionSelector(InstructionSequence* sequence, Schedule* schedule,
+ InstructionSelector(Zone* local_zone, Linkage* linkage,
+ InstructionSequence* sequence, Schedule* schedule,
SourcePositionTable* source_positions,
Features features = SupportedFeatures());
@@ -183,19 +184,20 @@
//
===========================================================================
- Linkage* linkage() const { return sequence()->linkage(); }
Schedule* schedule() const { return schedule_; }
+ Linkage* linkage() const { return linkage_; }
InstructionSequence* sequence() const { return sequence_; }
Zone* instruction_zone() const { return sequence()->zone(); }
- Zone* zone() { return &zone_; }
+ Zone* zone() const { return zone_; }
//
===========================================================================
- Zone zone_;
- InstructionSequence* sequence_;
- SourcePositionTable* source_positions_;
+ Zone* const zone_;
+ Linkage* const linkage_;
+ InstructionSequence* const sequence_;
+ SourcePositionTable* const source_positions_;
Features features_;
- Schedule* schedule_;
+ Schedule* const schedule_;
BasicBlock* current_block_;
ZoneDeque<Instruction*> instructions_;
BoolVector defined_;
=======================================
--- /trunk/src/compiler/instruction.cc Tue Oct 21 12:48:28 2014 UTC
+++ /trunk/src/compiler/instruction.cc Wed Oct 22 07:27:53 2014 UTC
@@ -381,14 +381,12 @@
InstructionSequence::InstructionSequence(Zone* instruction_zone,
- Linkage* linkage, const Graph*
graph,
+ const Graph* graph,
const Schedule* schedule)
: zone_(instruction_zone),
- node_count_(graph->NodeCount()),
- node_map_(zone()->NewArray<int>(node_count_)),
+ node_map_(graph->NodeCount(), kNodeUnmapped, zone()),
instruction_blocks_(static_cast<int>(schedule->rpo_order()->size()),
NULL,
zone()),
- linkage_(linkage),
constants_(ConstantMap::key_compare(),
ConstantMap::allocator_type(zone())),
immediates_(zone()),
@@ -398,15 +396,12 @@
doubles_(std::less<int>(),
VirtualRegisterSet::allocator_type(zone())),
references_(std::less<int>(),
VirtualRegisterSet::allocator_type(zone())),
deoptimization_entries_(zone()) {
- for (int i = 0; i < node_count_; ++i) {
- node_map_[i] = -1;
- }
InitializeInstructionBlocks(zone(), schedule, &instruction_blocks_);
}
int InstructionSequence::GetVirtualRegister(const Node* node) {
- if (node_map_[node->id()] == -1) {
+ if (node_map_[node->id()] == kNodeUnmapped) {
node_map_[node->id()] = NextVirtualRegister();
}
return node_map_[node->id()];
@@ -604,7 +599,7 @@
it != code.constants_.end(); ++i, ++it) {
os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n";
}
- for (int i = 0; i < code.BasicBlockCount(); i++) {
+ for (int i = 0; i < code.InstructionBlockCount(); i++) {
BasicBlock::RpoNumber rpo = BasicBlock::RpoNumber::FromInt(i);
const InstructionBlock* block = code.InstructionBlockAt(rpo);
CHECK(block->rpo_number() == rpo);
=======================================
***Additional files exist in this changeset.***
--
--
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/d/optout.