Revision: 9633
Author: [email protected]
Date: Fri Oct 14 04:56:07 2011
Log: Revert r9619.
[email protected]
Review URL: http://codereview.chromium.org/8286022
http://code.google.com/p/v8/source/detail?r=9633
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
/branches/bleeding_edge/src/parser.cc
/branches/bleeding_edge/src/type-info.cc
/branches/bleeding_edge/src/type-info.h
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri Oct 14 01:43:27 2011
+++ /branches/bleeding_edge/src/hydrogen.cc Fri Oct 14 04:56:07 2011
@@ -4539,9 +4539,9 @@
return false;
}
+ CompilationInfo* outer_info = info();
#if !defined(V8_TARGET_ARCH_IA32)
// Target must be able to use caller's context.
- CompilationInfo* outer_info = info();
if (target->context() != outer_info->closure()->context() ||
outer_info->scope()->contains_with() ||
outer_info->scope()->num_heap_slots() > 0) {
@@ -4564,13 +4564,9 @@
}
// Don't inline recursive functions.
- for (FunctionState* state = function_state();
- state != NULL;
- state = state->outer()) {
- if (state->compilation_info()->closure()->shared() == *target_shared) {
- TraceInline(target, caller, "target is recursive");
- return false;
- }
+ if (*target_shared == outer_info->closure()->shared()) {
+ TraceInline(target, caller, "target is recursive");
+ return false;
}
// We don't want to add more than a certain number of nodes from
inlining.
@@ -5075,25 +5071,18 @@
// The function is lingering in the deoptimization environment.
// Handle it by case analysis on the AST context.
if (ast_context()->IsEffect()) {
- if (current_block() == NULL) return;
- ASSERT(Top() == function);
Drop(1);
} else if (ast_context()->IsValue()) {
- if (current_block() == NULL) return;
HValue* result = Pop();
- ASSERT(Top() == function);
Drop(1);
Push(result);
} else if (ast_context()->IsTest()) {
- ASSERT(current_block() == NULL);
TestContext* context = TestContext::cast(ast_context());
- if (context->if_true()->HasPredecessor() &&
- context->if_true()->last_environment()->Top() == function) {
+ if (context->if_true()->HasPredecessor()) {
context->if_true()->last_environment()->Drop(1);
}
- if (context->if_false()->HasPredecessor() &&
- context->if_false()->last_environment()->Top() == function) {
- context->if_false()->last_environment()->Drop(1);
+ if (context->if_false()->HasPredecessor()) {
+ context->if_true()->last_environment()->Drop(1);
}
} else {
UNREACHABLE();
@@ -5313,6 +5302,7 @@
void HGraphBuilder::VisitNot(UnaryOperation* expr) {
+ // TODO(svenpanne) Perhaps a switch/virtual function is nicer here.
if (ast_context()->IsTest()) {
TestContext* context = TestContext::cast(ast_context());
VisitForControl(expr->expression(),
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Fri Oct 14
01:43:27 2011
+++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Fri Oct 14
04:56:07 2011
@@ -2104,7 +2104,7 @@
flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET);
}
CallFunctionStub stub(arg_count, flags);
- __ CallStub(&stub, expr->id());
+ __ CallStub(&stub);
if (record_call_target) {
// There is a one element cache in the instruction stream.
#ifdef DEBUG
=======================================
--- /branches/bleeding_edge/src/parser.cc Wed Oct 12 05:23:06 2011
+++ /branches/bleeding_edge/src/parser.cc Fri Oct 14 04:56:07 2011
@@ -5196,7 +5196,7 @@
Handle<Script> script = info->script();
bool harmony_scoping = !info->is_native() && FLAG_harmony_scoping;
if (info->is_lazy()) {
- Parser parser(script, true, NULL, NULL);
+ Parser parser(script, info->isolate()->bootstrapper()->IsActive() ||
info->allows_natives_syntax(), NULL, NULL);
parser.SetHarmonyScoping(harmony_scoping);
result = parser.ParseLazy(info);
} else {
=======================================
--- /branches/bleeding_edge/src/type-info.cc Fri Oct 14 01:43:27 2011
+++ /branches/bleeding_edge/src/type-info.cc Fri Oct 14 04:56:07 2011
@@ -496,56 +496,61 @@
void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) {
for (int i = 0; i < infos->length(); i++) {
- RelocInfo reloc_entry = (*infos)[i];
- Address target_address = reloc_entry.target_address();
+ Address target_address = (*infos)[i].target_address();
unsigned ast_id = static_cast<unsigned>((*infos)[i].data());
- Code* target = Code::GetCodeFromTargetAddress(target_address);
- switch (target->kind()) {
- case Code::LOAD_IC:
- case Code::STORE_IC:
- case Code::CALL_IC:
- case Code::KEYED_CALL_IC:
- if (target->ic_state() == MONOMORPHIC) {
- if (target->kind() == Code::CALL_IC &&
- target->check_type() != RECEIVER_MAP_CHECK) {
- SetInfo(ast_id, Smi::FromInt(target->check_type()));
- } else {
- Object* map = target->FindFirstMap();
- SetInfo(ast_id, map == NULL ? static_cast<Object*>(target) :
map);
- }
- } else if (target->ic_state() == MEGAMORPHIC) {
- SetInfo(ast_id, target);
- }
- break;
-
- case Code::KEYED_LOAD_IC:
- case Code::KEYED_STORE_IC:
- if (target->ic_state() == MONOMORPHIC ||
- target->ic_state() == MEGAMORPHIC) {
- SetInfo(ast_id, target);
- }
- break;
-
- case Code::UNARY_OP_IC:
- case Code::BINARY_OP_IC:
- case Code::COMPARE_IC:
- case Code::TO_BOOLEAN_IC:
+ ProcessTargetAt(target_address, ast_id);
+ }
+}
+
+
+void TypeFeedbackOracle::ProcessTargetAt(Address target_address,
+ unsigned ast_id) {
+ Code* target = Code::GetCodeFromTargetAddress(target_address);
+ switch (target->kind()) {
+ case Code::LOAD_IC:
+ case Code::STORE_IC:
+ case Code::CALL_IC:
+ case Code::KEYED_CALL_IC:
+ if (target->ic_state() == MONOMORPHIC) {
+ if (target->kind() == Code::CALL_IC &&
+ target->check_type() != RECEIVER_MAP_CHECK) {
+ SetInfo(ast_id, Smi::FromInt(target->check_type()));
+ } else {
+ Object* map = target->FindFirstMap();
+ SetInfo(ast_id, map == NULL ? static_cast<Object*>(target) :
map);
+ }
+ } else if (target->ic_state() == MEGAMORPHIC) {
+ SetInfo(ast_id, target);
+ }
+ break;
+
+ case Code::KEYED_LOAD_IC:
+ case Code::KEYED_STORE_IC:
+ if (target->ic_state() == MONOMORPHIC ||
+ target->ic_state() == MEGAMORPHIC) {
SetInfo(ast_id, target);
- break;
-
- case Code::STUB:
- if (target->major_key() == CodeStub::CallFunction &&
- target->has_function_cache()) {
- Object* value =
CallFunctionStub::GetCachedValue(reloc_entry.pc());
- if (value->IsJSFunction()) {
- SetInfo(ast_id, value);
- }
- }
- break;
-
- default:
- break;
- }
+ }
+ break;
+
+ case Code::UNARY_OP_IC:
+ case Code::BINARY_OP_IC:
+ case Code::COMPARE_IC:
+ case Code::TO_BOOLEAN_IC:
+ SetInfo(ast_id, target);
+ break;
+
+ case Code::STUB:
+ if (target->major_key() == CodeStub::CallFunction &&
+ target->has_function_cache()) {
+ Object* value = CallFunctionStub::GetCachedValue(target_address);
+ if (value->IsJSFunction()) {
+ SetInfo(ast_id, value);
+ }
+ }
+ break;
+
+ default:
+ break;
}
}
=======================================
--- /branches/bleeding_edge/src/type-info.h Fri Oct 14 01:43:27 2011
+++ /branches/bleeding_edge/src/type-info.h Fri Oct 14 04:56:07 2011
@@ -277,6 +277,7 @@
byte* old_start,
byte* new_start);
void ProcessRelocInfos(ZoneList<RelocInfo>* infos);
+ void ProcessTargetAt(Address target_address, unsigned ast_id);
// Returns an element from the backing store. Returns undefined if
// there is no information.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev