Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: src/ia32/full-codegen-ia32.cc

Issue 6928060: Merge Label and NearLabel (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index c46a869f3f5800ae94a457db9f338dc110d701f6..0b2d42d191c7fb04fccffb3867571f086e7c715a 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -237,11 +237,11 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
{ Comment cmnt(masm_, "[ Stack check");
PrepareForBailoutForId(AstNode::kFunctionEntryId, NO_REGISTERS);
- NearLabel ok;
+ Label ok;
ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit));
- __ j(above_equal, &ok, taken);
+ __ j(above_equal, &ok, taken, Label::kNear);
StackCheckStub stub;
__ CallStub(&stub);
__ bind(&ok);
@@ -270,11 +270,11 @@ void FullCodeGenerator::ClearAccumulator() {
void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) {
Comment cmnt(masm_, "[ Stack check");
- NearLabel ok;
+ Label ok;
ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit));
- __ j(above_equal, &ok, taken);
+ __ j(above_equal, &ok, taken, Label::kNear);
StackCheckStub stub;
__ CallStub(&stub);
// Record a mapping of this PC offset to the OSR id. This is used to find
@@ -471,10 +471,10 @@ void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
void FullCodeGenerator::AccumulatorValueContext::Plug(
Label* materialize_true,
Label* materialize_false) const {
- NearLabel done;
+ Label done;
__ bind(materialize_true);
__ mov(result_register(), isolate()->factory()->true_value());
- __ jmp(&done);
+ __ jmp(&done, Label::kNear);
__ bind(materialize_false);
__ mov(result_register(), isolate()->factory()->false_value());
__ bind(&done);
@@ -484,10 +484,10 @@ void FullCodeGenerator::AccumulatorValueContext::Plug(
void FullCodeGenerator::StackValueContext::Plug(
Label* materialize_true,
Label* materialize_false) const {
- NearLabel done;
+ Label done;
__ bind(materialize_true);
__ push(Immediate(isolate()->factory()->true_value()));
- __ jmp(&done);
+ __ jmp(&done, Label::kNear);
__ bind(materialize_false);
__ push(Immediate(isolate()->factory()->false_value()));
__ bind(&done);
@@ -627,8 +627,8 @@ void FullCodeGenerator::PrepareForBailoutBeforeSplit(State state,
// preparation to avoid preparing with the same AST id twice.
if (!context()->IsTest() || !info_->IsOptimizable()) return;
- NearLabel skip;
- if (should_normalize) __ jmp(&skip);
+ Label skip;
+ if (should_normalize) __ jmp(&skip, Label::kNear);
ForwardBailoutStack* current = forward_bailout_stack_;
while (current != NULL) {
@@ -862,11 +862,11 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ j(equal, &exit);
// Convert the object to a JS object.
- NearLabel convert, done_convert;
+ Label convert, done_convert;
__ test(eax, Immediate(kSmiTagMask));
- __ j(zero, &convert);
+ __ j(zero, &convert, Label::kNear);
__ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx);
- __ j(above_equal, &done_convert);
+ __ j(above_equal, &done_convert, Label::kNear);
__ bind(&convert);
__ push(eax);
__ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
@@ -903,9 +903,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ j(zero, &call_runtime);
// For all objects but the receiver, check that the cache is empty.
- NearLabel check_prototype;
+ Label check_prototype;
__ cmp(ecx, Operand(eax));
- __ j(equal, &check_prototype);
+ __ j(equal, &check_prototype, Label::kNear);
__ mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
__ cmp(edx, isolate()->factory()->empty_fixed_array());
__ j(not_equal, &call_runtime);
@@ -918,9 +918,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// The enum cache is valid. Load the map of the object being
// iterated over and use the cache for the iteration.
- NearLabel use_cache;
+ Label use_cache;
__ mov(eax, FieldOperand(eax, HeapObject::kMapOffset));
- __ jmp(&use_cache);
+ __ jmp(&use_cache, Label::kNear);
// Get the set of properties to enumerate.
__ bind(&call_runtime);
@@ -930,10 +930,10 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// If we got a map from the runtime call, we can do a fast
// modification check. Otherwise, we got a fixed array, and we have
// to do a slow check.
- NearLabel fixed_array;
+ Label fixed_array;
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
isolate()->factory()->meta_map());
- __ j(not_equal, &fixed_array);
+ __ j(not_equal, &fixed_array, Label::kNear);
// We got a map in register eax. Get the enumeration cache from it.
__ bind(&use_cache);
@@ -973,10 +973,10 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// Check if the expected map still matches that of the enumerable.
// If not, we have to filter the key.
- NearLabel update_each;
+ Label update_each;
__ mov(ecx, Operand(esp, 4 * kPointerSize));
__ cmp(edx, FieldOperand(ecx, HeapObject::kMapOffset));
- __ j(equal, &update_each);
+ __ j(equal, &update_each, Label::kNear);
// Convert the entry to a string or null if it isn't a property
// anymore. If the property has been removed while iterating, we
@@ -1084,7 +1084,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
if (s != NULL && s->is_eval_scope()) {
// Loop up the context chain. There is no frame effect so it is
// safe to use raw labels here.
- NearLabel next, fast;
+ Label next, fast;
if (!context.is(temp)) {
__ mov(temp, context);
}
@@ -1092,7 +1092,7 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions(
// Terminate at global context.
__ cmp(FieldOperand(temp, HeapObject::kMapOffset),
Immediate(isolate()->factory()->global_context_map()));
- __ j(equal, &fast);
+ __ j(equal, &fast, Label::kNear);
// Check that extension is NULL.
__ cmp(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0));
__ j(not_equal, slow);
@@ -1241,11 +1241,11 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
if (var->mode() == Variable::CONST) {
// Constants may be the hole value if they have not been initialized.
// Unhole them.
- NearLabel done;
+ Label done;
MemOperand slot_operand = EmitSlotSearch(slot, eax);
__ mov(eax, slot_operand);
__ cmp(eax, isolate()->factory()->the_hole_value());
- __ j(not_equal, &done);
+ __ j(not_equal, &done, Label::kNear);
__ mov(eax, isolate()->factory()->undefined_value());
__ bind(&done);
context()->Plug(eax);
@@ -1288,7 +1288,7 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) {
void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
Comment cmnt(masm_, "[ RegExpLiteral");
- NearLabel materialized;
+ Label materialized;
// Registers will be used as follows:
// edi = JS function.
// ecx = literals array.
@@ -1300,7 +1300,7 @@ void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
FixedArray::kHeaderSize + expr->literal_index() * kPointerSize;
__ mov(ebx, FieldOperand(ecx, literal_offset));
__ cmp(ebx, isolate()->factory()->undefined_value());
- __ j(not_equal, &materialized);
+ __ j(not_equal, &materialized, Label::kNear);
// Create regexp literal using runtime function
// Result will be in eax.
@@ -1657,7 +1657,8 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Expression* right) {
// Do combined smi check of the operands. Left operand is on the
// stack. Right operand is in eax.
- NearLabel done, smi_case, stub_call;
+ NearLabel smi_case;
+ Label done, stub_call;
__ pop(edx);
__ mov(ecx, eax);
__ or_(eax, Operand(edx));
@@ -1668,7 +1669,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ mov(eax, ecx);
TypeRecordingBinaryOpStub stub(op, mode);
EmitCallIC(stub.GetCode(), &patch_site, expr->id());
- __ jmp(&done);
+ __ jmp(&done, Label::kNear);
// Smi case.
__ bind(&smi_case);
@@ -1721,7 +1722,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ imul(eax, Operand(ecx));
__ j(overflow, &stub_call);
__ test(eax, Operand(eax));
- __ j(not_zero, &done, taken);
+ __ j(not_zero, &done, taken, Label::kNear);
__ mov(ebx, edx);
__ or_(ebx, Operand(ecx));
__ j(negative, &stub_call);
@@ -2843,13 +2844,13 @@ void FullCodeGenerator::EmitValueOf(ZoneList<Expression*>* args) {
VisitForAccumulatorValue(args->at(0)); // Load the object.
- NearLabel done;
+ Label done;
// If the object is a smi return the object.
__ test(eax, Immediate(kSmiTagMask));
- __ j(zero, &done);
+ __ j(zero, &done, Label::kNear);
// If the object is not a value type, return the object.
__ CmpObjectType(eax, JS_VALUE_TYPE, ebx);
- __ j(not_equal, &done);
+ __ j(not_equal, &done, Label::kNear);
__ mov(eax, FieldOperand(eax, JSValue::kValueOffset));
__ bind(&done);
@@ -2880,14 +2881,14 @@ void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
VisitForAccumulatorValue(args->at(1)); // Load the value.
__ pop(ebx); // eax = value. ebx = object.
- NearLabel done;
+ Label done;
// If the object is a smi, return the value.
__ test(ebx, Immediate(kSmiTagMask));
- __ j(zero, &done);
+ __ j(zero, &done, Label::kNear);
// If the object is not a value type, return the value.
__ CmpObjectType(ebx, JS_VALUE_TYPE, ecx);
- __ j(not_equal, &done);
+ __ j(not_equal, &done, Label::kNear);
// Store the value.
__ mov(FieldOperand(ebx, JSValue::kValueOffset), eax);
@@ -3829,10 +3830,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
// Call ToNumber only if operand is not a smi.
- NearLabel no_conversion;
+ Label no_conversion;
if (ShouldInlineSmiCase(expr->op())) {
__ test(eax, Immediate(kSmiTagMask));
- __ j(zero, &no_conversion);
+ __ j(zero, &no_conversion, Label::kNear);
}
ToNumberStub convert_stub;
__ CallStub(&convert_stub);
@@ -3859,7 +3860,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
// Inline smi case if we are in a loop.
- NearLabel stub_call, done;
+ NearLabel done;
+ Label stub_call;
JumpPatchSite patch_site(masm_);
if (ShouldInlineSmiCase(expr->op())) {
@@ -3868,7 +3870,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
} else {
__ sub(Operand(eax), Immediate(Smi::FromInt(1)));
}
- __ j(overflow, &stub_call);
+ __ j(overflow, &stub_call, Label::kNear);
// We could eliminate this smi check if we split the code at
// the first smi check before calling ToNumber.
patch_site.EmitJumpIfSmi(eax, &done);
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698