Commit 69a4c52b authored by ricow@chromium.org's avatar ricow@chromium.org

Revert revisions 7644 and 7632, they are causing assertion failures in...

Revert revisions 7644 and 7632, they are causing assertion failures in interactive_ui_tests debug mode.
Review URL: http://codereview.chromium.org/6873076

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7664 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5f7eb953
......@@ -315,7 +315,6 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
no_const_pool_before_ = 0;
last_const_pool_end_ = 0;
last_bound_pos_ = 0;
ast_id_for_reloc_info_ = kNoASTId;
}
......@@ -2723,14 +2722,7 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
}
}
ASSERT(buffer_space() >= kMaxRelocSize); // too late to grow buffer here
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
ASSERT(ast_id_for_reloc_info_ != kNoASTId);
RelocInfo reloc_info_with_ast_id(pc_, rmode, ast_id_for_reloc_info_);
ast_id_for_reloc_info_ = kNoASTId;
reloc_info_writer.Write(&reloc_info_with_ast_id);
} else {
reloc_info_writer.Write(&rinfo);
}
reloc_info_writer.Write(&rinfo);
}
}
......
......@@ -1166,10 +1166,6 @@ class Assembler : public AssemblerBase {
// Mark address of a debug break slot.
void RecordDebugBreakSlot();
// Record the AST id of the CallIC being compiled, so that it can be placed
// in the relocation information.
void RecordAstId(unsigned ast_id) { ast_id_for_reloc_info_ = ast_id; }
// Record a comment relocation entry that can be used by a disassembler.
// Use --code-comments to enable.
void RecordComment(const char* msg);
......@@ -1227,11 +1223,6 @@ class Assembler : public AssemblerBase {
void CheckConstPool(bool force_emit, bool require_jump);
protected:
// Relocation for a type-recording IC has the AST id added to it. This
// member variable is a way to pass the information from the call site to
// the relocation info.
unsigned ast_id_for_reloc_info_;
bool emit_debug_code() const { return emit_debug_code_; }
int buffer_space() const { return reloc_info_writer.pos() - pc_; }
......
This diff is collapsed.
......@@ -148,9 +148,8 @@ int MacroAssembler::CallSize(
}
void MacroAssembler::Call(intptr_t target,
RelocInfo::Mode rmode,
Condition cond) {
void MacroAssembler::Call(
intptr_t target, RelocInfo::Mode rmode, Condition cond) {
// Block constant pool for the call instruction sequence.
BlockConstPoolScope block_const_pool(this);
#ifdef DEBUG
......@@ -215,31 +214,8 @@ int MacroAssembler::CallSize(
}
void MacroAssembler::CallWithAstId(Handle<Code> code,
RelocInfo::Mode rmode,
unsigned ast_id,
Condition cond) {
#ifdef DEBUG
int pre_position = pc_offset();
#endif
ASSERT(rmode == RelocInfo::CODE_TARGET_WITH_ID);
ASSERT(ast_id != kNoASTId);
ASSERT(ast_id_for_reloc_info_ == kNoASTId);
ast_id_for_reloc_info_ = ast_id;
// 'code' is always generated ARM code, never THUMB code
Call(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
#ifdef DEBUG
int post_position = pc_offset();
CHECK_EQ(pre_position + CallSize(code, rmode, cond), post_position);
#endif
}
void MacroAssembler::Call(Handle<Code> code,
RelocInfo::Mode rmode,
Condition cond) {
void MacroAssembler::Call(
Handle<Code> code, RelocInfo::Mode rmode, Condition cond) {
#ifdef DEBUG
int pre_position = pc_offset();
#endif
......
// Copyright 2011 the V8 project authors. All rights reserved.
// Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
......@@ -105,13 +105,7 @@ class MacroAssembler: public Assembler {
int CallSize(byte* target, RelocInfo::Mode rmode, Condition cond = al);
void Call(byte* target, RelocInfo::Mode rmode, Condition cond = al);
int CallSize(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
void Call(Handle<Code> code,
RelocInfo::Mode rmode,
Condition cond = al);
void CallWithAstId(Handle<Code> code,
RelocInfo::Mode rmode,
unsigned ast_id,
Condition cond = al);
void Call(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
void Ret(Condition cond = al);
// Emit code to discard a non-negative number of pointer-sized elements
......@@ -964,9 +958,7 @@ class MacroAssembler: public Assembler {
void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
int CallSize(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
void Call(intptr_t target,
RelocInfo::Mode rmode,
Condition cond = al);
void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
// Helper functions for generating invokes.
void InvokePrologue(const ParameterCount& expected,
......
This diff is collapsed.
......@@ -42,7 +42,7 @@
namespace v8 {
namespace internal {
const unsigned kNoASTId = -1;
// -----------------------------------------------------------------------------
// Platform independent assembler base class.
......@@ -209,11 +209,10 @@ class RelocInfo BASE_EMBEDDED {
enum Mode {
// Please note the order is important (see IsCodeTarget, IsGCRelocMode).
CODE_TARGET, // Code target which is not any of the above.
CODE_TARGET_WITH_ID,
CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor.
CODE_TARGET_CONTEXT, // Code target used for contextual loads and stores.
DEBUG_BREAK, // Code target for the debugger statement.
CODE_TARGET, // Code target which is not any of the above.
EMBEDDED_OBJECT,
GLOBAL_PROPERTY_CELL,
......@@ -229,12 +228,10 @@ class RelocInfo BASE_EMBEDDED {
// add more as needed
// Pseudo-types
NUMBER_OF_MODES, // There are at most 14 modes with noncompact encoding.
NUMBER_OF_MODES, // must be no greater than 14 - see RelocInfoWriter
NONE, // never recorded
LAST_CODE_ENUM = DEBUG_BREAK,
LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL,
// Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding.
LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID
LAST_CODE_ENUM = CODE_TARGET,
LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL
};
......@@ -364,8 +361,7 @@ class RelocInfo BASE_EMBEDDED {
static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1;
static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION;
static const int kDataMask =
(1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT);
static const int kDebugMask = kPositionMask | 1 << COMMENT;
static const int kApplyMask; // Modes affected by apply. Depends on arch.
private:
......@@ -384,14 +380,9 @@ class RelocInfo BASE_EMBEDDED {
// lower addresses.
class RelocInfoWriter BASE_EMBEDDED {
public:
RelocInfoWriter() : pos_(NULL),
last_pc_(NULL),
last_id_(0),
last_position_(0) {}
RelocInfoWriter(byte* pos, byte* pc) : pos_(pos),
last_pc_(pc),
last_id_(0),
last_position_(0) {}
RelocInfoWriter() : pos_(NULL), last_pc_(NULL), last_data_(0) {}
RelocInfoWriter(byte* pos, byte* pc) : pos_(pos), last_pc_(pc),
last_data_(0) {}
byte* pos() const { return pos_; }
byte* last_pc() const { return last_pc_; }
......@@ -416,15 +407,13 @@ class RelocInfoWriter BASE_EMBEDDED {
inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta);
inline void WriteTaggedPC(uint32_t pc_delta, int tag);
inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag);
inline void WriteExtraTaggedIntData(int data_delta, int top_tag);
inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag);
inline void WriteTaggedData(intptr_t data_delta, int tag);
inline void WriteExtraTag(int extra_tag, int top_tag);
byte* pos_;
byte* last_pc_;
int last_id_;
int last_position_;
intptr_t last_data_;
DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter);
};
......@@ -466,13 +455,12 @@ class RelocIterator: public Malloced {
int GetTopTag();
void ReadTaggedPC();
void AdvanceReadPC();
void AdvanceReadId();
void AdvanceReadPosition();
void AdvanceReadData();
void AdvanceReadVariableLengthPCJump();
int GetLocatableTypeTag();
void ReadTaggedId();
void ReadTaggedPosition();
int GetPositionTypeTag();
void ReadTaggedData();
static RelocInfo::Mode DebugInfoModeFromTag(int tag);
// If the given mode is wanted, set it in rinfo_ and return true.
// Else return false. Used for efficiently skipping unwanted modes.
......@@ -485,8 +473,6 @@ class RelocIterator: public Malloced {
RelocInfo rinfo_;
bool done_;
int mode_mask_;
int last_id_;
int last_position_;
DISALLOW_COPY_AND_ASSIGN(RelocIterator);
};
......
......@@ -282,9 +282,6 @@ static int DecodeIt(FILE* f,
} else {
out.AddFormatted(" %s", Code::Kind2String(kind));
}
if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
out.AddFormatted(" (id = %d)", static_cast<int>(relocinfo.data()));
}
} else if (rmode == RelocInfo::RUNTIME_ENTRY &&
Isolate::Current()->deoptimizer_data() != NULL) {
// A runtime entry reloinfo might be a deoptimization bailout.
......
......@@ -744,7 +744,7 @@ void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
if (ShouldInlineSmiCase(op)) {
EmitInlineSmiBinaryOp(expr, op, mode, left, right);
} else {
EmitBinaryOp(expr, op, mode);
EmitBinaryOp(op, mode);
}
break;
}
......
// Copyright 2011 the V8 project authors. All rights reserved.
// Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
......@@ -445,13 +445,12 @@ class FullCodeGenerator: public AstVisitor {
// Apply the compound assignment operator. Expects the left operand on top
// of the stack and the right one in the accumulator.
void EmitBinaryOp(BinaryOperation* expr,
Token::Value op,
void EmitBinaryOp(Token::Value op,
OverwriteMode mode);
// Helper functions for generating inlined smi code for certain
// binary operations.
void EmitInlineSmiBinaryOp(BinaryOperation* expr,
void EmitInlineSmiBinaryOp(Expression* expr,
Token::Value op,
OverwriteMode mode,
Expression* left,
......@@ -513,16 +512,12 @@ class FullCodeGenerator: public AstVisitor {
static Register context_register();
// Helper for calling an IC stub.
void EmitCallIC(Handle<Code> ic,
RelocInfo::Mode mode,
unsigned ast_id);
void EmitCallIC(Handle<Code> ic, RelocInfo::Mode mode);
// Calling an IC stub with a patch site. Passing NULL for patch_site
// or non NULL patch_site which is not activated indicates no inlined smi code
// and emits a nop after the IC call.
void EmitCallIC(Handle<Code> ic,
JumpPatchSite* patch_site,
unsigned ast_id);
void EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site);
// Set fields in the stack frame. Offsets are the frame pointer relative
// offsets defined in, e.g., StandardFrameConstants.
......
......@@ -30,7 +30,7 @@
// The original source code covered by the above license above has been
// modified significantly by Google Inc.
// Copyright 2011 the V8 project authors. All rights reserved.
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// A light-weight IA32 Assembler.
......@@ -311,12 +311,8 @@ void Assembler::emit(Handle<Object> handle) {
}
void Assembler::emit(uint32_t x, RelocInfo::Mode rmode, unsigned id) {
if (rmode == RelocInfo::CODE_TARGET && id != kNoASTId) {
RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, static_cast<intptr_t>(id));
} else if (rmode != RelocInfo::NONE) {
RecordRelocInfo(rmode);
}
void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode);
emit(x);
}
......
......@@ -1589,15 +1589,13 @@ void Assembler::call(const Operand& adr) {
}
void Assembler::call(Handle<Code> code,
RelocInfo::Mode rmode,
unsigned ast_id) {
void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) {
positions_recorder()->WriteRecordedPositions();
EnsureSpace ensure_space(this);
last_pc_ = pc_;
ASSERT(RelocInfo::IsCodeTarget(rmode));
EMIT(0xE8);
emit(reinterpret_cast<intptr_t>(code.location()), rmode, ast_id);
emit(reinterpret_cast<intptr_t>(code.location()), rmode);
}
......
......@@ -848,9 +848,7 @@ class Assembler : public AssemblerBase {
void call(Label* L);
void call(byte* entry, RelocInfo::Mode rmode);
void call(const Operand& adr);
void call(Handle<Code> code,
RelocInfo::Mode rmode,
unsigned ast_id = kNoASTId);
void call(Handle<Code> code, RelocInfo::Mode rmode);
// Jumps
void jmp(Label* L); // unconditional jump to L
......@@ -1072,9 +1070,7 @@ class Assembler : public AssemblerBase {
void GrowBuffer();
inline void emit(uint32_t x);
inline void emit(Handle<Object> handle);
inline void emit(uint32_t x,
RelocInfo::Mode rmode,
unsigned ast_id = kNoASTId);
inline void emit(uint32_t x, RelocInfo::Mode rmode);
inline void emit(const Immediate& x);
inline void emit_w(const Immediate& x);
......
This diff is collapsed.
......@@ -1104,9 +1104,9 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
}
void MacroAssembler::CallStub(CodeStub* stub, unsigned ast_id) {
void MacroAssembler::CallStub(CodeStub* stub) {
ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs.
call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id);
call(stub->GetCode(), RelocInfo::CODE_TARGET);
}
......
......@@ -452,7 +452,7 @@ class MacroAssembler: public Assembler {
// Runtime calls
// Call a code stub. Generate the code if necessary.
void CallStub(CodeStub* stub, unsigned ast_id = kNoASTId);
void CallStub(CodeStub* stub);
// Call a code stub and return the code object called. Try to generate
// the code if necessary. Do not perform a GC but instead return a retry
......
This diff is collapsed.
......@@ -36,18 +36,18 @@ namespace v8 {
namespace internal {
// Unknown
// | \____________
// | |
// Primitive Non-primitive
// | \_______ |
// | | |
// Number String |
// / \ | |
// Double Integer32 | /
// | | / /
// | Smi / /
// | | / __/
// Uninitialized.
// | |
// | \--------------|
// Primitive Non-primitive
// | \--------| |
// Number String |
// / | | |
// Double Integer32 | /
// | | / /
// | Smi / /
// | | / /
// | | / /
// Uninitialized.--/
class TypeInfo {
public:
......@@ -263,21 +263,21 @@ class TypeFeedbackOracle BASE_EMBEDDED {
TypeInfo SwitchType(CaseClause* clause);
private:
ZoneMapList* CollectReceiverTypes(unsigned ast_id,
ZoneMapList* CollectReceiverTypes(int position,
Handle<String> name,
Code::Flags flags);
void SetInfo(unsigned ast_id, Object* target);
void SetInfo(int position, Object* target);
void PopulateMap(Handle<Code> code);
void CollectIds(Code* code,
List<int>* code_positions,
List<unsigned>* ast_ids);
void CollectPositions(Code* code,
List<int>* code_positions,
List<int>* source_positions);
// Returns an element from the backing store. Returns undefined if
// there is no information.
Handle<Object> GetInfo(unsigned ast_id);
Handle<Object> GetInfo(int pos);
Handle<Context> global_context_;
Handle<NumberDictionary> dictionary_;
......
......@@ -61,15 +61,9 @@ void Assembler::emitw(uint16_t x) {
}
void Assembler::emit_code_target(Handle<Code> target,
RelocInfo::Mode rmode,
unsigned ast_id) {
void Assembler::emit_code_target(Handle<Code> target, RelocInfo::Mode rmode) {
ASSERT(RelocInfo::IsCodeTarget(rmode));
if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) {
RecordRelocInfo(RelocInfo::CODE_TARGET_WITH_ID, ast_id);
} else {
RecordRelocInfo(rmode);
}
RecordRelocInfo(rmode);
int current = code_targets_.length();
if (current > 0 && code_targets_.last().is_identical_to(target)) {
// Optimization if we keep jumping to the same code target.
......
......@@ -869,14 +869,12 @@ void Assembler::call(Label* L) {
}
void Assembler::call(Handle<Code> target,
RelocInfo::Mode rmode,
unsigned ast_id) {
void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) {
positions_recorder()->WriteRecordedPositions();
EnsureSpace ensure_space(this);
// 1110 1000 #32-bit disp.
emit(0xE8);
emit_code_target(target, rmode, ast_id);
emit_code_target(target, rmode);
}
......
......@@ -1183,9 +1183,7 @@ class Assembler : public AssemblerBase {
// Calls
// Call near relative 32-bit displacement, relative to next instruction.
void call(Label* L);
void call(Handle<Code> target,
RelocInfo::Mode rmode,
unsigned ast_id = kNoASTId);
void call(Handle<Code> target, RelocInfo::Mode rmode);
// Calls directly to the given address using a relative offset.
// Should only ever be used in Code objects for calls within the
......@@ -1429,9 +1427,7 @@ class Assembler : public AssemblerBase {
inline void emitl(uint32_t x);
inline void emitq(uint64_t x, RelocInfo::Mode rmode);
inline void emitw(uint16_t x);
inline void emit_code_target(Handle<Code> target,
RelocInfo::Mode rmode,
unsigned ast_id = kNoASTId);
inline void emit_code_target(Handle<Code> target, RelocInfo::Mode rmode);
void emit(Immediate x) { emitl(x.value_); }
// Emits a REX prefix that encodes a 64-bit operand size and
......
This diff is collapsed.
......@@ -425,9 +425,9 @@ void MacroAssembler::Abort(const char* msg) {
}
void MacroAssembler::CallStub(CodeStub* stub, unsigned ast_id) {
void MacroAssembler::CallStub(CodeStub* stub) {
ASSERT(allow_stub_calls()); // calls are not allowed in some stubs
Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id);
Call(stub->GetCode(), RelocInfo::CODE_TARGET);
}
......@@ -1610,14 +1610,12 @@ void MacroAssembler::Call(Address destination, RelocInfo::Mode rmode) {
}
void MacroAssembler::Call(Handle<Code> code_object,
RelocInfo::Mode rmode,
unsigned ast_id) {
void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) {
#ifdef DEBUG
int end_position = pc_offset() + CallSize(code_object);
#endif
ASSERT(RelocInfo::IsCodeTarget(rmode));
call(code_object, rmode, ast_id);
call(code_object, rmode);
#ifdef DEBUG
CHECK_EQ(end_position, pc_offset());
#endif
......
......@@ -692,9 +692,7 @@ class MacroAssembler: public Assembler {
void Call(Address destination, RelocInfo::Mode rmode);
void Call(ExternalReference ext);
void Call(Handle<Code> code_object,
RelocInfo::Mode rmode,
unsigned ast_id = kNoASTId);
void Call(Handle<Code> code_object, RelocInfo::Mode rmode);
// The size of the code generated for different call instructions.
int CallSize(Address destination, RelocInfo::Mode rmode) {
......@@ -934,7 +932,7 @@ class MacroAssembler: public Assembler {
// Runtime calls
// Call a code stub.
void CallStub(CodeStub* stub, unsigned ast_id = kNoASTId);
void CallStub(CodeStub* stub);
// Call a code stub and return the code object called. Try to generate
// the code if necessary. Do not perform a GC but instead return a retry
......
......@@ -501,11 +501,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env,
CHECK(Debug::HasDebugInfo(shared));
TestBreakLocationIterator it1(Debug::GetDebugInfo(shared));
it1.FindBreakLocationFromPosition(position);
v8::internal::RelocInfo::Mode actual_mode = it1.it()->rinfo()->rmode();
if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) {
actual_mode = v8::internal::RelocInfo::CODE_TARGET;
}
CHECK_EQ(mode, actual_mode);
CHECK_EQ(mode, it1.it()->rinfo()->rmode());
if (mode != v8::internal::RelocInfo::JS_RETURN) {
CHECK_EQ(debug_break,
Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address()));
......@@ -520,11 +516,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env,
CHECK(debug->EnsureDebugInfo(shared));
TestBreakLocationIterator it2(Debug::GetDebugInfo(shared));
it2.FindBreakLocationFromPosition(position);
actual_mode = it2.it()->rinfo()->rmode();
if (actual_mode == v8::internal::RelocInfo::CODE_TARGET_WITH_ID) {
actual_mode = v8::internal::RelocInfo::CODE_TARGET;
}
CHECK_EQ(mode, actual_mode);
CHECK_EQ(mode, it2.it()->rinfo()->rmode());
if (mode == v8::internal::RelocInfo::JS_RETURN) {
CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment