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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 3388004: Add support for near labels.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 3 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
Index: src/x64/code-stubs-x64.cc
===================================================================
--- src/x64/code-stubs-x64.cc (revision 5449)
+++ src/x64/code-stubs-x64.cc (working copy)
@@ -203,7 +203,7 @@
void ToBooleanStub::Generate(MacroAssembler* masm) {
- Label false_result, true_result, not_string;
+ NearLabel false_result, true_result, not_string;
__ movq(rax, Operand(rsp, 1 * kPointerSize));
// 'null' => false.
@@ -989,7 +989,7 @@
Label runtime_call;
Label runtime_call_clear_stack;
Label input_not_smi;
- Label loaded;
+ NearLabel loaded;
// Test that rax is a number.
__ movq(rax, Operand(rsp, kPointerSize));
__ JumpIfNotSmi(rax, &input_not_smi);
@@ -1069,7 +1069,7 @@
__ addl(rcx, rcx);
__ lea(rcx, Operand(rax, rcx, times_8, 0));
// Check if cache matches: Double value is stored in uint32_t[2] array.
- Label cache_miss;
+ NearLabel cache_miss;
__ cmpq(rbx, Operand(rcx, 0));
__ j(not_equal, &cache_miss);
// Cache hit!
@@ -1160,7 +1160,7 @@
// Compute st(0) % st(1)
{
- Label partial_remainder_loop;
+ NearLabel partial_remainder_loop;
__ bind(&partial_remainder_loop);
__ fprem1();
__ fwait();
@@ -1202,7 +1202,7 @@
// cvttsd2si (32-bit version) directly.
Register double_exponent = rbx;
Register double_value = rdi;
- Label done, exponent_63_plus;
+ NearLabel done, exponent_63_plus;
// Get double and extract exponent.
__ movq(double_value, FieldOperand(source, HeapNumber::kValueOffset));
// Clear result preemptively, in case we need to return zero.
@@ -1758,7 +1758,7 @@
// rcx: RegExp data (FixedArray)
// Check the representation and encoding of the subject string.
- Label seq_ascii_string, seq_two_byte_string, check_code;
+ NearLabel seq_ascii_string, seq_two_byte_string, check_code;
__ movq(rax, Operand(rsp, kSubjectOffset));
__ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
__ movzxbl(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset));
@@ -1883,7 +1883,7 @@
// Argument 4: End of string data
// Argument 3: Start of string data
- Label setup_two_byte, setup_rest;
+ NearLabel setup_two_byte, setup_rest;
__ testb(rdi, rdi);
__ j(zero, &setup_two_byte);
__ SmiToInteger32(rdi, FieldOperand(rax, String::kLengthOffset));
@@ -1910,10 +1910,10 @@
__ pop(rsi);
// Check the result.
- Label success;
+ NearLabel success;
__ cmpl(rax, Immediate(NativeRegExpMacroAssembler::SUCCESS));
__ j(equal, &success);
- Label failure;
+ NearLabel failure;
__ cmpl(rax, Immediate(NativeRegExpMacroAssembler::FAILURE));
__ j(equal, &failure);
__ cmpl(rax, Immediate(NativeRegExpMacroAssembler::EXCEPTION));
@@ -1968,7 +1968,7 @@
// rbx: last_match_info backing store (FixedArray)
// rcx: offsets vector
// rdx: number of capture registers
- Label next_capture, done;
+ NearLabel next_capture, done;
// Capture register counter starts from number of capture registers and
// counts down until wraping after zero.
__ bind(&next_capture);
@@ -2122,14 +2122,14 @@
// Two identical objects are equal unless they are both NaN or undefined.
{
- Label not_identical;
+ NearLabel not_identical;
__ cmpq(rax, rdx);
__ j(not_equal, &not_identical);
if (cc_ != equal) {
// Check for undefined. undefined OP undefined is false even though
// undefined == undefined.
- Label check_for_nan;
+ NearLabel check_for_nan;
__ CompareRoot(rdx, Heap::kUndefinedValueRootIndex);
__ j(not_equal, &check_for_nan);
__ Set(rax, NegativeComparisonResult(cc_));
@@ -2147,7 +2147,7 @@
__ Set(rax, EQUAL);
__ ret(0);
} else {
- Label heap_number;
+ NearLabel heap_number;
// If it's not a heap number, then return equal for (in)equality operator.
__ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
Factory::heap_number_map());
@@ -2211,7 +2211,7 @@
// If the first object is a JS object, we have done pointer comparison.
STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
- Label first_non_object;
+ NearLabel first_non_object;
__ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rcx);
__ j(below, &first_non_object);
// Return non-zero (eax (not rax) is not zero)
@@ -2240,7 +2240,7 @@
// Generate the number comparison code.
if (include_number_compare_) {
Label non_number_comparison;
- Label unordered;
+ NearLabel unordered;
FloatingPointHelper::LoadSSE2UnknownOperands(masm, &non_number_comparison);
__ xorl(rax, rax);
__ xorl(rcx, rcx);
@@ -2304,7 +2304,7 @@
// Not strict equality. Objects are unequal if
// they are both JSObjects and not undetectable,
// and their pointers are different.
- Label not_both_objects, return_unequal;
+ NearLabel not_both_objects, return_unequal;
// At most one is a smi, so we can test for smi by adding the two.
// A smi plus a heap object has the low bit set, a heap object plus
// a heap object has the low bit clear.
@@ -2462,7 +2462,7 @@
// Before returning we restore the context from the frame pointer if not NULL.
// The frame pointer is NULL in the exception handler of a JS entry frame.
__ xor_(rsi, rsi); // tentatively set context pointer to NULL
- Label skip;
+ NearLabel skip;
__ cmpq(rbp, Immediate(0));
__ j(equal, &skip);
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
@@ -2622,7 +2622,7 @@
// Handling of failure.
__ bind(&failure_returned);
- Label retry;
+ NearLabel retry;
// If the returned exception is RETRY_AFTER_GC continue at retry label
STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0);
__ testl(rax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize));
@@ -2662,7 +2662,7 @@
__ movq(rsp, Operand(kScratchRegister, 0));
// Unwind the handlers until the ENTRY handler is found.
- Label loop, done;
+ NearLabel loop, done;
__ bind(&loop);
// Load the type of the current stack handler.
const int kStateOffset = StackHandlerConstants::kStateOffset;
@@ -2932,7 +2932,7 @@
// rdx is function, rax is map.
// Look up the function and the map in the instanceof cache.
- Label miss;
+ NearLabel miss;
__ CompareRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex);
__ j(not_equal, &miss);
__ CompareRoot(rax, Heap::kInstanceofCacheMapRootIndex);
@@ -2960,7 +2960,7 @@
__ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset));
// Loop through the prototype chain looking for the function prototype.
- Label loop, is_instance, is_not_instance;
+ NearLabel loop, is_instance, is_not_instance;
__ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex);
__ bind(&loop);
__ cmpq(rcx, rbx);
@@ -3265,7 +3265,7 @@
// rax: first string
// rdx: second string
// Check if either of the strings are empty. In that case return the other.
- Label second_not_zero_length, both_not_zero_length;
+ NearLabel second_not_zero_length, both_not_zero_length;
__ movq(rcx, FieldOperand(rdx, String::kLengthOffset));
__ SmiTest(rcx);
__ j(not_zero, &second_not_zero_length);
@@ -3521,7 +3521,7 @@
ASSERT(count.is(rcx)); // rep movs count
// Nothing to do for zero characters.
- Label done;
+ NearLabel done;
__ testl(count, count);
__ j(zero, &done);
@@ -3532,7 +3532,7 @@
}
// Don't enter the rep movs if there are less than 4 bytes to copy.
- Label last_bytes;
+ NearLabel last_bytes;
__ testl(count, Immediate(~7));
__ j(zero, &last_bytes);
@@ -3576,7 +3576,7 @@
// Make sure that both characters are not digits as such strings has a
// different hash algorithm. Don't try to look for these in the symbol table.
- Label not_array_index;
+ NearLabel not_array_index;
__ leal(scratch, Operand(c1, -'0'));
__ cmpl(scratch, Immediate(static_cast<int>('9' - '0')));
__ j(above, &not_array_index);
@@ -3900,7 +3900,7 @@
NULL);
// Register scratch4 now holds left.length - right.length.
const Register length_difference = scratch4;
- Label left_shorter;
+ NearLabel left_shorter;
__ j(less, &left_shorter);
// The right string isn't longer that the left one.
// Get the right string's length by subtracting the (non-negative) difference
@@ -3910,7 +3910,7 @@
// Register scratch1 now holds Min(left.length, right.length).
const Register min_length = scratch1;
- Label compare_lengths;
+ NearLabel compare_lengths;
// If min-length is zero, go directly to comparing lengths.
__ SmiTest(min_length);
__ j(zero, &compare_lengths);
@@ -3918,7 +3918,7 @@
__ SmiToInteger32(min_length, min_length);
// Registers scratch2 and scratch3 are free.
- Label result_not_equal;
+ NearLabel result_not_equal;
Label loop;
{
// Check characters 0 .. min_length - 1 in a loop.
@@ -3954,7 +3954,7 @@
__ Move(rax, Smi::FromInt(EQUAL));
__ ret(0);
- Label result_greater;
+ NearLabel result_greater;
__ bind(&result_not_equal);
// Unequal comparison of left to right, either character or length.
__ j(greater, &result_greater);
@@ -3982,7 +3982,7 @@
__ movq(rax, Operand(rsp, 1 * kPointerSize)); // right
// Check for identity.
- Label not_same;
+ NearLabel not_same;
__ cmpq(rdx, rax);
__ j(not_equal, &not_same);
__ Move(rax, Smi::FromInt(EQUAL));

Powered by Google App Engine
This is Rietveld 408576698