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

Side by Side Diff: src/hydrogen.cc

Issue 23241027: Avoid setting / depending on flags when transitioning, and when fields are known to be constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4465 matching lines...) Expand 10 before | Expand all | Expand 10 after
4476 BuildCheckPrototypeMaps( 4476 BuildCheckPrototypeMaps(
4477 Handle<JSObject>(JSObject::cast(map->prototype())), 4477 Handle<JSObject>(JSObject::cast(map->prototype())),
4478 Handle<JSObject>(JSObject::cast(proto))); 4478 Handle<JSObject>(JSObject::cast(proto)));
4479 } 4479 }
4480 4480
4481 HObjectAccess field_access = HObjectAccess::ForField(map, lookup, name); 4481 HObjectAccess field_access = HObjectAccess::ForField(map, lookup, name);
4482 bool transition_to_field = lookup->IsTransitionToField(*map); 4482 bool transition_to_field = lookup->IsTransitionToField(*map);
4483 4483
4484 HStoreNamedField *instr; 4484 HStoreNamedField *instr;
4485 if (FLAG_track_double_fields && field_access.representation().IsDouble()) { 4485 if (FLAG_track_double_fields && field_access.representation().IsDouble()) {
4486 HObjectAccess heap_number_access = 4486 HObjectAccess heap_number_access = field_access.WithRepresentation(
4487 field_access.WithRepresentation(Representation::Tagged()); 4487 Representation::Tagged(), HObjectAccess::CONSTANT);
4488 if (transition_to_field) { 4488 if (transition_to_field) {
4489 // The store requires a mutable HeapNumber to be allocated. 4489 // The store requires a mutable HeapNumber to be allocated.
4490 NoObservableSideEffectsScope no_side_effects(this); 4490 NoObservableSideEffectsScope no_side_effects(this);
4491 HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize); 4491 HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize);
4492 HInstruction* heap_number = Add<HAllocate>(heap_number_size, 4492 HInstruction* heap_number = Add<HAllocate>(heap_number_size,
4493 HType::HeapNumber(), isolate()->heap()->GetPretenureMode(), 4493 HType::HeapNumber(), isolate()->heap()->GetPretenureMode(),
4494 HEAP_NUMBER_TYPE); 4494 HEAP_NUMBER_TYPE);
4495 AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); 4495 AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map());
4496 Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(), 4496 Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
4497 value); 4497 value);
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
5381 current_block()->FinishExit(new(zone()) HAbnormalExit); 5381 current_block()->FinishExit(new(zone()) HAbnormalExit);
5382 set_current_block(NULL); 5382 set_current_block(NULL);
5383 } 5383 }
5384 5384
5385 5385
5386 HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object, 5386 HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object,
5387 HObjectAccess access) { 5387 HObjectAccess access) {
5388 if (FLAG_track_double_fields && access.representation().IsDouble()) { 5388 if (FLAG_track_double_fields && access.representation().IsDouble()) {
5389 // load the heap number 5389 // load the heap number
5390 HLoadNamedField* heap_number = Add<HLoadNamedField>( 5390 HLoadNamedField* heap_number = Add<HLoadNamedField>(
5391 object, access.WithRepresentation(Representation::Tagged())); 5391 object, access.WithRepresentation(
5392 Representation::Tagged(), HObjectAccess::CONSTANT));
5392 heap_number->set_type(HType::HeapNumber()); 5393 heap_number->set_type(HType::HeapNumber());
5393 // load the double value from it 5394 // load the double value from it
5394 return New<HLoadNamedField>( 5395 return New<HLoadNamedField>(
5395 heap_number, HObjectAccess::ForHeapNumberValue()); 5396 heap_number, HObjectAccess::ForHeapNumberValue());
5396 } 5397 }
5397 return New<HLoadNamedField>(object, access); 5398 return New<HLoadNamedField>(object, access);
5398 } 5399 }
5399 5400
5400 5401
5401 HInstruction* HGraphBuilder::BuildLoadStringLength(HValue* object, 5402 HInstruction* HGraphBuilder::BuildLoadStringLength(HValue* object,
(...skipping 4464 matching lines...) Expand 10 before | Expand all | Expand 10 after
9866 if (ShouldProduceTraceOutput()) { 9867 if (ShouldProduceTraceOutput()) {
9867 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9868 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9868 } 9869 }
9869 9870
9870 #ifdef DEBUG 9871 #ifdef DEBUG
9871 graph_->Verify(false); // No full verify. 9872 graph_->Verify(false); // No full verify.
9872 #endif 9873 #endif
9873 } 9874 }
9874 9875
9875 } } // namespace v8::internal 9876 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698