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

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

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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/frames-ia32.h ('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
===================================================================
--- src/ia32/full-codegen-ia32.cc (revision 7267)
+++ src/ia32/full-codegen-ia32.cc (working copy)
@@ -129,9 +129,9 @@
{ Comment cmnt(masm_, "[ Allocate locals");
int locals_count = scope()->num_stack_slots();
if (locals_count == 1) {
- __ push(Immediate(Factory::undefined_value()));
+ __ push(Immediate(isolate()->factory()->undefined_value()));
} else if (locals_count > 1) {
- __ mov(eax, Immediate(Factory::undefined_value()));
+ __ mov(eax, Immediate(isolate()->factory()->undefined_value()));
for (int i = 0; i < locals_count; i++) {
__ push(eax);
}
@@ -252,7 +252,7 @@
// Always emit a 'return undefined' in case control fell off the end of
// the body.
{ Comment cmnt(masm_, "[ return <undefined>;");
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
EmitReturnSequence();
}
}
@@ -467,10 +467,10 @@
Label* materialize_false) const {
NearLabel done;
__ bind(materialize_true);
- __ mov(result_register(), Factory::true_value());
+ __ mov(result_register(), isolate()->factory()->true_value());
__ jmp(&done);
__ bind(materialize_false);
- __ mov(result_register(), Factory::false_value());
+ __ mov(result_register(), isolate()->factory()->false_value());
__ bind(&done);
}
@@ -480,10 +480,10 @@
Label* materialize_false) const {
NearLabel done;
__ bind(materialize_true);
- __ push(Immediate(Factory::true_value()));
+ __ push(Immediate(isolate()->factory()->true_value()));
__ jmp(&done);
__ bind(materialize_false);
- __ push(Immediate(Factory::false_value()));
+ __ push(Immediate(isolate()->factory()->false_value()));
__ bind(&done);
}
@@ -500,15 +500,17 @@
void FullCodeGenerator::AccumulatorValueContext::Plug(bool flag) const {
- Handle<Object> value =
- flag ? Factory::true_value() : Factory::false_value();
+ Handle<Object> value = flag
+ ? isolate()->factory()->true_value()
+ : isolate()->factory()->false_value();
__ mov(result_register(), value);
}
void FullCodeGenerator::StackValueContext::Plug(bool flag) const {
- Handle<Object> value =
- flag ? Factory::true_value() : Factory::false_value();
+ Handle<Object> value = flag
+ ? isolate()->factory()->true_value()
+ : isolate()->factory()->false_value();
__ push(Immediate(value));
}
@@ -530,11 +532,11 @@
Label* if_false,
Label* fall_through) {
// Emit the inlined tests assumed by the stub.
- __ cmp(result_register(), Factory::undefined_value());
+ __ cmp(result_register(), isolate()->factory()->undefined_value());
__ j(equal, if_false);
- __ cmp(result_register(), Factory::true_value());
+ __ cmp(result_register(), isolate()->factory()->true_value());
__ j(equal, if_true);
- __ cmp(result_register(), Factory::false_value());
+ __ cmp(result_register(), isolate()->factory()->false_value());
__ j(equal, if_false);
STATIC_ASSERT(kSmiTag == 0);
__ test(result_register(), Operand(result_register()));
@@ -629,7 +631,7 @@
}
if (should_normalize) {
- __ cmp(eax, Factory::true_value());
+ __ cmp(eax, isolate()->factory()->true_value());
Split(equal, if_true, if_false, NULL);
__ bind(&skip);
}
@@ -650,7 +652,7 @@
case Slot::LOCAL:
if (mode == Variable::CONST) {
__ mov(Operand(ebp, SlotOffset(slot)),
- Immediate(Factory::the_hole_value()));
+ Immediate(isolate()->factory()->the_hole_value()));
} else if (function != NULL) {
VisitForAccumulatorValue(function);
__ mov(Operand(ebp, SlotOffset(slot)), result_register());
@@ -672,7 +674,7 @@
}
if (mode == Variable::CONST) {
__ mov(ContextOperand(esi, slot->index()),
- Immediate(Factory::the_hole_value()));
+ Immediate(isolate()->factory()->the_hole_value()));
// No write barrier since the hole value is in old space.
} else if (function != NULL) {
VisitForAccumulatorValue(function);
@@ -695,7 +697,7 @@
// 'undefined') because we may have a (legal) redeclaration and we
// must not destroy the current value.
if (mode == Variable::CONST) {
- __ push(Immediate(Factory::the_hole_value()));
+ __ push(Immediate(isolate()->factory()->the_hole_value()));
} else if (function != NULL) {
VisitForStackValue(function);
} else {
@@ -723,15 +725,15 @@
__ pop(edx);
} else {
__ mov(edx, eax);
- __ mov(eax, Factory::the_hole_value());
+ __ mov(eax, isolate()->factory()->the_hole_value());
}
ASSERT(prop->key()->AsLiteral() != NULL &&
prop->key()->AsLiteral()->handle()->IsSmi());
__ Set(ecx, Immediate(prop->key()->AsLiteral()->handle()));
- Handle<Code> ic(Builtins::builtin(
- is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
- : Builtins::KeyedStoreIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(is_strict_mode()
+ ? Builtins::KeyedStoreIC_Initialize_Strict
+ : Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
}
@@ -848,9 +850,9 @@
// ignore null and undefined in contrast to the specification; see
// ECMA-262 section 12.6.4.
VisitForAccumulatorValue(stmt->enumerable());
- __ cmp(eax, Factory::undefined_value());
+ __ cmp(eax, isolate()->factory()->undefined_value());
__ j(equal, &exit);
- __ cmp(eax, Factory::null_value());
+ __ cmp(eax, isolate()->factory()->null_value());
__ j(equal, &exit);
// Convert the object to a JS object.
@@ -876,7 +878,7 @@
// Check that there are no elements. Register ecx contains the
// current JS object we've reached through the prototype chain.
__ cmp(FieldOperand(ecx, JSObject::kElementsOffset),
- Factory::empty_fixed_array());
+ isolate()->factory()->empty_fixed_array());
__ j(not_equal, &call_runtime);
// Check that instance descriptors are not empty so that we can
@@ -884,7 +886,7 @@
// prototype load.
__ mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
__ mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOffset));
- __ cmp(edx, Factory::empty_descriptor_array());
+ __ cmp(edx, isolate()->factory()->empty_descriptor_array());
__ j(equal, &call_runtime);
// Check that there is an enum cache in the non-empty instance
@@ -899,13 +901,13 @@
__ cmp(ecx, Operand(eax));
__ j(equal, &check_prototype);
__ mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
- __ cmp(edx, Factory::empty_fixed_array());
+ __ cmp(edx, isolate()->factory()->empty_fixed_array());
__ j(not_equal, &call_runtime);
// Load the prototype from the map and loop if non-null.
__ bind(&check_prototype);
__ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
- __ cmp(ecx, Factory::null_value());
+ __ cmp(ecx, isolate()->factory()->null_value());
__ j(not_equal, &next);
// The enum cache is valid. Load the map of the object being
@@ -923,7 +925,8 @@
// modification check. Otherwise, we got a fixed array, and we have
// to do a slow check.
NearLabel fixed_array;
- __ cmp(FieldOperand(eax, HeapObject::kMapOffset), Factory::meta_map());
+ __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
+ isolate()->factory()->meta_map());
__ j(not_equal, &fixed_array);
// We got a map in register eax. Get the enumeration cache from it.
@@ -1029,8 +1032,8 @@
__ push(esi);
__ push(Immediate(info));
__ push(Immediate(pretenure
- ? Factory::true_value()
- : Factory::false_value()));
+ ? isolate()->factory()->true_value()
+ : isolate()->factory()->false_value()));
__ CallRuntime(Runtime::kNewClosure, 3);
}
context()->Plug(eax);
@@ -1082,7 +1085,7 @@
__ bind(&next);
// Terminate at global context.
__ cmp(FieldOperand(temp, HeapObject::kMapOffset),
- Immediate(Factory::global_context_map()));
+ Immediate(isolate()->factory()->global_context_map()));
__ j(equal, &fast);
// Check that extension is NULL.
__ cmp(ContextOperand(temp, Context::EXTENSION_INDEX), Immediate(0));
@@ -1098,7 +1101,8 @@
// load IC call.
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, slot->var()->name());
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::LoadIC_Initialize));
RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF)
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
@@ -1159,9 +1163,9 @@
__ mov(eax,
ContextSlotOperandCheckExtensions(potential_slot, slow));
if (potential_slot->var()->mode() == Variable::CONST) {
- __ cmp(eax, Factory::the_hole_value());
+ __ cmp(eax, isolate()->factory()->the_hole_value());
__ j(not_equal, done);
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
}
__ jmp(done);
} else if (rewrite != NULL) {
@@ -1181,7 +1185,8 @@
ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
slow));
__ mov(eax, Immediate(key_literal->handle()));
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
__ jmp(done);
}
@@ -1204,7 +1209,8 @@
// object on the stack.
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, var->name());
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::LoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
context()->Plug(eax);
@@ -1234,9 +1240,9 @@
NearLabel done;
MemOperand slot_operand = EmitSlotSearch(slot, eax);
__ mov(eax, slot_operand);
- __ cmp(eax, Factory::the_hole_value());
+ __ cmp(eax, isolate()->factory()->the_hole_value());
__ j(not_equal, &done);
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
__ bind(&done);
context()->Plug(eax);
} else {
@@ -1267,7 +1273,8 @@
__ mov(eax, Immediate(key_literal->handle()));
// Do a keyed property load.
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Drop key and object left on the stack by IC.
@@ -1289,7 +1296,7 @@
int literal_offset =
FixedArray::kHeaderSize + expr->literal_index() * kPointerSize;
__ mov(ebx, FieldOperand(ecx, literal_offset));
- __ cmp(ebx, Factory::undefined_value());
+ __ cmp(ebx, isolate()->factory()->undefined_value());
__ j(not_equal, &materialized);
// Create regexp literal using runtime function
@@ -1372,7 +1379,7 @@
VisitForAccumulatorValue(value);
__ mov(ecx, Immediate(key->handle()));
__ mov(edx, Operand(esp, 0));
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1426,12 +1433,13 @@
__ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
__ push(Immediate(Smi::FromInt(expr->literal_index())));
__ push(Immediate(expr->constant_elements()));
- if (expr->constant_elements()->map() == Heap::fixed_cow_array_map()) {
+ if (expr->constant_elements()->map() ==
+ isolate()->heap()->fixed_cow_array_map()) {
ASSERT(expr->depth() == 1);
FastCloneShallowArrayStub stub(
FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
__ CallStub(&stub);
- __ IncrementCounter(&Counters::cow_arrays_created_stub, 1);
+ __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1);
} else if (expr->depth() > 1) {
__ CallRuntime(Runtime::kCreateArrayLiteral, 3);
} else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
@@ -1616,14 +1624,16 @@
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ mov(ecx, Immediate(key->handle()));
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::LoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
}
@@ -1764,7 +1774,7 @@
__ mov(edx, eax);
__ pop(eax); // Restore value.
__ mov(ecx, prop->key()->AsLiteral()->handle());
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1787,7 +1797,7 @@
__ pop(edx);
}
__ pop(eax); // Restore value.
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1813,7 +1823,7 @@
// ecx, and the global object on the stack.
__ mov(ecx, var->name());
__ mov(edx, GlobalObjectOperand());
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT);
@@ -1832,14 +1842,14 @@
break;
case Slot::LOCAL:
__ mov(edx, Operand(ebp, SlotOffset(slot)));
- __ cmp(edx, Factory::the_hole_value());
+ __ cmp(edx, isolate()->factory()->the_hole_value());
__ j(not_equal, &skip);
__ mov(Operand(ebp, SlotOffset(slot)), eax);
break;
case Slot::CONTEXT: {
__ mov(ecx, ContextOperand(esi, Context::FCONTEXT_INDEX));
__ mov(edx, ContextOperand(ecx, slot->index()));
- __ cmp(edx, Factory::the_hole_value());
+ __ cmp(edx, isolate()->factory()->the_hole_value());
__ j(not_equal, &skip);
__ mov(ContextOperand(ecx, slot->index()), eax);
int offset = Context::SlotOffset(slot->index());
@@ -1916,7 +1926,7 @@
} else {
__ pop(edx);
}
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -1956,7 +1966,7 @@
}
// Record source code position before IC call.
SetSourcePosition(expr->position());
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -2008,7 +2018,8 @@
// Record source position of the IC call.
SetSourcePosition(expr->position());
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
- Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+ Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize(
+ arg_count, in_loop);
EmitCallIC(ic, mode);
RecordJSReturnSite(expr);
// Restore context register.
@@ -2040,7 +2051,8 @@
// Record source position of the IC call.
SetSourcePosition(expr->position());
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
- Handle<Code> ic = StubCache::ComputeKeyedCallInitialize(arg_count, in_loop);
+ Handle<Code> ic = isolate()->stub_cache()->ComputeKeyedCallInitialize(
+ arg_count, in_loop);
__ mov(ecx, Operand(esp, (arg_count + 1) * kPointerSize)); // Key.
EmitCallIC(ic, mode);
RecordJSReturnSite(expr);
@@ -2077,7 +2089,7 @@
if (arg_count > 0) {
__ push(Operand(esp, arg_count * kPointerSize));
} else {
- __ push(Immediate(Factory::undefined_value()));
+ __ push(Immediate(FACTORY->undefined_value()));
}
// Push the receiver of the enclosing function.
@@ -2113,7 +2125,7 @@
{ PreservePositionScope pos_scope(masm()->positions_recorder());
VisitForStackValue(fun);
// Reserved receiver slot.
- __ push(Immediate(Factory::undefined_value()));
+ __ push(Immediate(isolate()->factory()->undefined_value()));
// Push the arguments.
for (int i = 0; i < arg_count; i++) {
@@ -2232,7 +2244,8 @@
// Record source code position for IC call.
SetSourcePosition(prop->position());
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::KeyedLoadIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Push result (function).
__ push(eax);
@@ -2253,7 +2266,7 @@
// also use the full code generator.
FunctionLiteral* lit = fun->AsFunctionLiteral();
if (lit != NULL &&
- lit->name()->Equals(Heap::empty_string()) &&
+ lit->name()->Equals(isolate()->heap()->empty_string()) &&
loop_depth() == 0) {
lit->set_try_full_codegen(true);
}
@@ -2300,7 +2313,8 @@
__ Set(eax, Immediate(arg_count));
__ mov(edi, Operand(esp, arg_count * kPointerSize));
- Handle<Code> construct_builtin(Builtins::builtin(Builtins::JSConstructCall));
+ Handle<Code> construct_builtin(isolate()->builtins()->builtin(
+ Builtins::JSConstructCall));
__ call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
context()->Plug(eax);
}
@@ -2360,7 +2374,7 @@
__ test(eax, Immediate(kSmiTagMask));
__ j(zero, if_false);
- __ cmp(eax, Factory::null_value());
+ __ cmp(eax, isolate()->factory()->null_value());
__ j(equal, if_true);
__ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
// Undetectable objects behave like undefined when tested with typeof.
@@ -2639,17 +2653,17 @@
// Functions have class 'Function'.
__ bind(&function);
- __ mov(eax, Factory::function_class_symbol());
+ __ mov(eax, isolate()->factory()->function_class_symbol());
__ jmp(&done);
// Objects with a non-function constructor have class 'Object'.
__ bind(&non_function_constructor);
- __ mov(eax, Factory::Object_symbol());
+ __ mov(eax, isolate()->factory()->Object_symbol());
__ jmp(&done);
// Non-JS objects have class null.
__ bind(&null);
- __ mov(eax, Factory::null_value());
+ __ mov(eax, isolate()->factory()->null_value());
// All done.
__ bind(&done);
@@ -2675,7 +2689,7 @@
}
#endif
// Finally, we're expected to leave a value on the top of the stack.
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
context()->Plug(eax);
}
@@ -2703,7 +2717,7 @@
// by computing:
// ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
// This is implemented on both SSE2 and FPU.
- if (CpuFeatures::IsSupported(SSE2)) {
+ if (isolate()->cpu_features()->IsSupported(SSE2)) {
CpuFeatures::Scope fscope(SSE2);
__ mov(ebx, Immediate(0x49800000)); // 1.0 x 2^20 as single.
__ movd(xmm1, Operand(ebx));
@@ -2872,13 +2886,13 @@
__ bind(&index_out_of_range);
// When the index is out of range, the spec requires us to return
// NaN.
- __ Set(result, Immediate(Factory::nan_value()));
+ __ Set(result, Immediate(isolate()->factory()->nan_value()));
__ jmp(&done);
__ bind(&need_conversion);
// Move the undefined value into the result register, which will
// trigger conversion.
- __ Set(result, Immediate(Factory::undefined_value()));
+ __ Set(result, Immediate(isolate()->factory()->undefined_value()));
__ jmp(&done);
NopRuntimeCallHelper call_helper;
@@ -2921,7 +2935,7 @@
__ bind(&index_out_of_range);
// When the index is out of range, the spec requires us to return
// the empty string.
- __ Set(result, Immediate(Factory::empty_string()));
+ __ Set(result, Immediate(isolate()->factory()->empty_string()));
__ jmp(&done);
__ bind(&need_conversion);
@@ -3060,7 +3074,7 @@
// Check the object's elements are in fast case and writable.
__ mov(elements, FieldOperand(object, JSObject::kElementsOffset));
__ cmp(FieldOperand(elements, HeapObject::kMapOffset),
- Immediate(Factory::fixed_array_map()));
+ Immediate(isolate()->factory()->fixed_array_map()));
__ j(not_equal, &slow_case);
// Check that both indices are smis.
@@ -3098,7 +3112,7 @@
__ bind(&new_space);
// We are done. Drop elements from the stack, and return undefined.
__ add(Operand(esp), Immediate(3 * kPointerSize));
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
__ jmp(&done);
__ bind(&slow_case);
@@ -3116,10 +3130,10 @@
int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
Handle<FixedArray> jsfunction_result_caches(
- Top::global_context()->jsfunction_result_caches());
+ isolate()->global_context()->jsfunction_result_caches());
if (jsfunction_result_caches->length() <= cache_id) {
__ Abort("Attempt to use undefined cache.");
- __ mov(eax, Factory::undefined_value());
+ __ mov(eax, isolate()->factory()->undefined_value());
context()->Plug(eax);
return;
}
@@ -3176,7 +3190,8 @@
__ and_(Operand(tmp), right);
__ test(Operand(tmp), Immediate(kSmiTagMask));
__ j(zero, &fail);
- __ CmpObjectType(left, JS_REGEXP_TYPE, tmp);
+ __ mov(tmp, FieldOperand(left, HeapObject::kMapOffset));
+ __ CmpInstanceType(tmp, JS_REGEXP_TYPE);
__ j(not_equal, &fail);
__ cmp(tmp, FieldOperand(right, HeapObject::kMapOffset));
__ j(not_equal, &fail);
@@ -3184,10 +3199,10 @@
__ cmp(tmp, FieldOperand(right, JSRegExp::kDataOffset));
__ j(equal, &ok);
__ bind(&fail);
- __ mov(eax, Immediate(Factory::false_value()));
+ __ mov(eax, Immediate(isolate()->factory()->false_value()));
__ jmp(&done);
__ bind(&ok);
- __ mov(eax, Immediate(Factory::true_value()));
+ __ mov(eax, Immediate(isolate()->factory()->true_value()));
__ bind(&done);
context()->Plug(eax);
@@ -3280,7 +3295,7 @@
__ mov(array_length, FieldOperand(array, JSArray::kLengthOffset));
__ SmiUntag(array_length);
__ j(not_zero, &non_trivial_array);
- __ mov(result_operand, Factory::empty_string());
+ __ mov(result_operand, FACTORY->empty_string());
__ jmp(&done);
// Save the array length.
@@ -3491,7 +3506,7 @@
__ bind(&bailout);
- __ mov(result_operand, Factory::undefined_value());
+ __ mov(result_operand, FACTORY->undefined_value());
__ bind(&done);
__ mov(eax, result_operand);
// Drop temp values from the stack, and restore context register.
@@ -3529,7 +3544,8 @@
// Call the JS runtime function via a call IC.
__ Set(ecx, Immediate(expr->name()));
InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
- Handle<Code> ic = StubCache::ComputeCallInitialize(arg_count, in_loop);
+ Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize(
+ arg_count, in_loop);
EmitCallIC(ic, RelocInfo::CODE_TARGET);
// Restore context register.
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
@@ -3595,7 +3611,7 @@
case Token::VOID: {
Comment cmnt(masm_, "[ UnaryOperation (VOID)");
VisitForEffect(expr->expression());
- context()->Plug(Factory::undefined_value());
+ context()->Plug(isolate()->factory()->undefined_value());
break;
}
@@ -3843,7 +3859,7 @@
case NAMED_PROPERTY: {
__ mov(ecx, prop->key()->AsLiteral()->handle());
__ pop(edx);
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::StoreIC_Initialize_Strict
: Builtins::StoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -3860,7 +3876,7 @@
case KEYED_PROPERTY: {
__ pop(ecx);
__ pop(edx);
- Handle<Code> ic(Builtins::builtin(
+ Handle<Code> ic(isolate()->builtins()->builtin(
is_strict_mode() ? Builtins::KeyedStoreIC_Initialize_Strict
: Builtins::KeyedStoreIC_Initialize));
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -3888,7 +3904,8 @@
Comment cmnt(masm_, "Global variable");
__ mov(eax, GlobalObjectOperand());
__ mov(ecx, Immediate(proxy->name()));
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
+ Handle<Code> ic(isolate()->builtins()->builtin(
+ Builtins::LoadIC_Initialize));
// Use a regular load, not a contextual load, to avoid a reference
// error.
EmitCallIC(ic, RelocInfo::CODE_TARGET);
@@ -3941,12 +3958,12 @@
}
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
- if (check->Equals(Heap::number_symbol())) {
+ if (check->Equals(isolate()->heap()->number_symbol())) {
__ JumpIfSmi(eax, if_true);
__ cmp(FieldOperand(eax, HeapObject::kMapOffset),
- Factory::heap_number_map());
+ isolate()->factory()->heap_number_map());
Split(equal, if_true, if_false, fall_through);
- } else if (check->Equals(Heap::string_symbol())) {
+ } else if (check->Equals(isolate()->heap()->string_symbol())) {
__ JumpIfSmi(eax, if_false);
__ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx);
__ j(above_equal, if_false);
@@ -3954,13 +3971,13 @@
__ test_b(FieldOperand(edx, Map::kBitFieldOffset),
1 << Map::kIsUndetectable);
Split(zero, if_true, if_false, fall_through);
- } else if (check->Equals(Heap::boolean_symbol())) {
- __ cmp(eax, Factory::true_value());
+ } else if (check->Equals(isolate()->heap()->boolean_symbol())) {
+ __ cmp(eax, isolate()->factory()->true_value());
__ j(equal, if_true);
- __ cmp(eax, Factory::false_value());
+ __ cmp(eax, isolate()->factory()->false_value());
Split(equal, if_true, if_false, fall_through);
- } else if (check->Equals(Heap::undefined_symbol())) {
- __ cmp(eax, Factory::undefined_value());
+ } else if (check->Equals(isolate()->heap()->undefined_symbol())) {
+ __ cmp(eax, isolate()->factory()->undefined_value());
__ j(equal, if_true);
__ JumpIfSmi(eax, if_false);
// Check for undetectable objects => true.
@@ -3968,13 +3985,13 @@
__ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset));
__ test(ecx, Immediate(1 << Map::kIsUndetectable));
Split(not_zero, if_true, if_false, fall_through);
- } else if (check->Equals(Heap::function_symbol())) {
+ } else if (check->Equals(isolate()->heap()->function_symbol())) {
__ JumpIfSmi(eax, if_false);
__ CmpObjectType(eax, FIRST_FUNCTION_CLASS_TYPE, edx);
Split(above_equal, if_true, if_false, fall_through);
- } else if (check->Equals(Heap::object_symbol())) {
+ } else if (check->Equals(isolate()->heap()->object_symbol())) {
__ JumpIfSmi(eax, if_false);
- __ cmp(eax, Factory::null_value());
+ __ cmp(eax, isolate()->factory()->null_value());
__ j(equal, if_true);
__ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, edx);
__ j(below, if_false);
@@ -4022,7 +4039,7 @@
VisitForStackValue(expr->right());
__ InvokeBuiltin(Builtins::IN, CALL_FUNCTION);
PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL);
- __ cmp(eax, Factory::true_value());
+ __ cmp(eax, isolate()->factory()->true_value());
Split(equal, if_true, if_false, fall_through);
break;
@@ -4115,12 +4132,12 @@
VisitForAccumulatorValue(expr->expression());
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
- __ cmp(eax, Factory::null_value());
+ __ cmp(eax, isolate()->factory()->null_value());
if (expr->is_strict()) {
Split(equal, if_true, if_false, fall_through);
} else {
__ j(equal, if_true);
- __ cmp(eax, Factory::undefined_value());
+ __ cmp(eax, isolate()->factory()->undefined_value());
__ j(equal, if_true);
__ test(eax, Immediate(kSmiTagMask));
__ j(zero, if_false);
@@ -4155,16 +4172,16 @@
mode == RelocInfo::CODE_TARGET_CONTEXT);
switch (ic->kind()) {
case Code::LOAD_IC:
- __ IncrementCounter(&Counters::named_load_full, 1);
+ __ IncrementCounter(isolate()->counters()->named_load_full(), 1);
break;
case Code::KEYED_LOAD_IC:
- __ IncrementCounter(&Counters::keyed_load_full, 1);
+ __ IncrementCounter(isolate()->counters()->keyed_load_full(), 1);
break;
case Code::STORE_IC:
- __ IncrementCounter(&Counters::named_store_full, 1);
+ __ IncrementCounter(isolate()->counters()->named_store_full(), 1);
break;
case Code::KEYED_STORE_IC:
- __ IncrementCounter(&Counters::keyed_store_full, 1);
+ __ IncrementCounter(isolate()->counters()->keyed_store_full(), 1);
default:
break;
}
@@ -4198,16 +4215,16 @@
void FullCodeGenerator::EmitCallIC(Handle<Code> ic, JumpPatchSite* patch_site) {
switch (ic->kind()) {
case Code::LOAD_IC:
- __ IncrementCounter(&Counters::named_load_full, 1);
+ __ IncrementCounter(COUNTERS->named_load_full(), 1);
break;
case Code::KEYED_LOAD_IC:
- __ IncrementCounter(&Counters::keyed_load_full, 1);
+ __ IncrementCounter(COUNTERS->keyed_load_full(), 1);
break;
case Code::STORE_IC:
- __ IncrementCounter(&Counters::named_store_full, 1);
+ __ IncrementCounter(COUNTERS->named_store_full(), 1);
break;
case Code::KEYED_STORE_IC:
- __ IncrementCounter(&Counters::keyed_store_full, 1);
+ __ IncrementCounter(COUNTERS->keyed_store_full(), 1);
default:
break;
}
« no previous file with comments | « src/ia32/frames-ia32.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698