From 53dc74e12f87c49515082f409c9cdc5e6e67974c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 18 Mar 2011 14:22:52 -0700 Subject: [PATCH] Upgrade V8 to 3.1.8.3 --- deps/v8/src/arm/codegen-arm.cc | 8 +++-- deps/v8/src/arm/debug-arm.cc | 2 +- deps/v8/src/parser.cc | 30 +++++++++-------- deps/v8/src/parser.h | 4 +-- deps/v8/src/scopes.cc | 51 ++++++++++++++++++----------- deps/v8/src/scopes.h | 18 +++++----- deps/v8/src/version.cc | 2 +- deps/v8/test/mjsunit/bitops-info.js | 8 ++++- 8 files changed, 74 insertions(+), 49 deletions(-) diff --git a/deps/v8/src/arm/codegen-arm.cc b/deps/v8/src/arm/codegen-arm.cc index 8bb576ded7..0fcaa0b09d 100644 --- a/deps/v8/src/arm/codegen-arm.cc +++ b/deps/v8/src/arm/codegen-arm.cc @@ -1153,7 +1153,7 @@ void DeferredInlineSmiOperation::GenerateNonSmiInput() { } // Check that the *signed* result fits in a smi. Not necessary for AND, SAR // if the shift if more than 0 or SHR if the shit is more than 1. - if (!( (op_ == Token::AND) || + if (!( (op_ == Token::AND && value_ >= 0) || ((op_ == Token::SAR) && (shift_value > 0)) || ((op_ == Token::SHR) && (shift_value > 1)))) { __ add(r3, int32, Operand(0x40000000), SetCC); @@ -1414,8 +1414,10 @@ void CodeGenerator::SmiOperation(Token::Value op, default: UNREACHABLE(); } deferred->BindExit(); - TypeInfo result_type = - (op == Token::BIT_AND) ? TypeInfo::Smi() : TypeInfo::Integer32(); + TypeInfo result_type = TypeInfo::Integer32(); + if (op == Token::BIT_AND && int_value >= 0) { + result_type = TypeInfo::Smi(); + } frame_->EmitPush(tos, result_type); } break; diff --git a/deps/v8/src/arm/debug-arm.cc b/deps/v8/src/arm/debug-arm.cc index f19e69396e..22640ca1c5 100644 --- a/deps/v8/src/arm/debug-arm.cc +++ b/deps/v8/src/arm/debug-arm.cc @@ -115,7 +115,7 @@ void BreakLocationIterator::SetDebugBreakAtSlot() { patcher.masm()->mov(v8::internal::lr, v8::internal::pc); patcher.masm()->ldr(v8::internal::pc, MemOperand(v8::internal::pc, -4)); #endif - patcher.Emit(Debug::debug_break_return()->entry()); + patcher.Emit(Debug::debug_break_slot()->entry()); } diff --git a/deps/v8/src/parser.cc b/deps/v8/src/parser.cc index 8560310702..04e2407e01 100644 --- a/deps/v8/src/parser.cc +++ b/deps/v8/src/parser.cc @@ -703,38 +703,40 @@ FunctionLiteral* Parser::DoParseProgram(Handle source, return result; } -FunctionLiteral* Parser::ParseLazy(Handle info) { +FunctionLiteral* Parser::ParseLazy(CompilationInfo* info) { CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT); HistogramTimerScope timer(&Counters::parse_lazy); Handle source(String::cast(script_->source())); Counters::total_parse_size.Increment(source->length()); + Handle shared_info = info->shared_info(); // Initialize parser state. source->TryFlatten(); if (source->IsExternalTwoByteString()) { ExternalTwoByteStringUC16CharacterStream stream( Handle::cast(source), - info->start_position(), - info->end_position()); + shared_info->start_position(), + shared_info->end_position()); FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope); return result; } else { GenericStringUC16CharacterStream stream(source, - info->start_position(), - info->end_position()); + shared_info->start_position(), + shared_info->end_position()); FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope); return result; } } -FunctionLiteral* Parser::ParseLazy(Handle info, +FunctionLiteral* Parser::ParseLazy(CompilationInfo* info, UC16CharacterStream* source, ZoneScope* zone_scope) { + Handle shared_info = info->shared_info(); scanner_.Initialize(source); ASSERT(target_stack_ == NULL); - Handle name(String::cast(info->name())); + Handle name(String::cast(shared_info->name())); fni_ = new FuncNameInferrer(); fni_->PushEnclosingName(name); @@ -746,18 +748,20 @@ FunctionLiteral* Parser::ParseLazy(Handle info, { // Parse the function literal. Handle no_name = Factory::empty_symbol(); - Scope* scope = - NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with()); + Scope* scope = NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with()); + if (!info->closure().is_null()) { + scope = Scope::DeserializeScopeChain(info, scope); + } LexicalScope lexical_scope(&this->top_scope_, &this->with_nesting_level_, scope); TemporaryScope temp_scope(&this->temp_scope_); - if (info->strict_mode()) { + if (shared_info->strict_mode()) { temp_scope.EnableStrictMode(); } FunctionLiteralType type = - info->is_expression() ? EXPRESSION : DECLARATION; + shared_info->is_expression() ? EXPRESSION : DECLARATION; bool ok = true; result = ParseFunctionLiteral(name, false, // Strict mode name already checked. @@ -775,7 +779,7 @@ FunctionLiteral* Parser::ParseLazy(Handle info, zone_scope->DeleteOnExit(); if (stack_overflow_) Top::StackOverflow(); } else { - Handle inferred_name(info->inferred_name()); + Handle inferred_name(shared_info->inferred_name()); result->set_inferred_name(inferred_name); } return result; @@ -5133,7 +5137,7 @@ bool ParserApi::Parse(CompilationInfo* info) { Handle