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

Side by Side Diff: src/type-info.cc

Issue 6606002: Merge revision 6500-6600 from bleeding_edge to the isolates branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
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 unified diff | Download patch | Annotate | Revision Log
« src/ast.cc ('K') | « src/type-info.h ('k') | src/utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return Handle<JSObject>(JSObject::cast(function->instance_prototype())); 165 return Handle<JSObject>(JSObject::cast(function->instance_prototype()));
166 } 166 }
167 167
168 168
169 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { 169 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) {
170 Handle<Object> object = GetElement(map_, expr->position()); 170 Handle<Object> object = GetElement(map_, expr->position());
171 return *object == Isolate::Current()->builtins()->builtin(id); 171 return *object == Isolate::Current()->builtins()->builtin(id);
172 } 172 }
173 173
174 174
175 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) { 175 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr) {
176 Handle<Object> object = GetElement(map_, expr->position()); 176 Handle<Object> object = GetElement(map_, expr->position());
177 TypeInfo unknown = TypeInfo::Unknown(); 177 TypeInfo unknown = TypeInfo::Unknown();
178 if (!object->IsCode()) return unknown; 178 if (!object->IsCode()) return unknown;
179 Handle<Code> code = Handle<Code>::cast(object); 179 Handle<Code> code = Handle<Code>::cast(object);
180 if (!code->is_compare_ic_stub()) return unknown; 180 if (!code->is_compare_ic_stub()) return unknown;
181 181
182 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); 182 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
183 switch (state) { 183 switch (state) {
184 case CompareIC::UNINITIALIZED: 184 case CompareIC::UNINITIALIZED:
185 // Uninitialized means never executed. 185 // Uninitialized means never executed.
186 // TODO(fschneider): Introduce a separate value for never-executed ICs. 186 // TODO(fschneider): Introduce a separate value for never-executed ICs.
187 return unknown; 187 return unknown;
188 case CompareIC::SMIS: 188 case CompareIC::SMIS:
189 return TypeInfo::Smi(); 189 return TypeInfo::Smi();
190 case CompareIC::HEAP_NUMBERS: 190 case CompareIC::HEAP_NUMBERS:
191 return TypeInfo::Number(); 191 return TypeInfo::Number();
192 case CompareIC::OBJECTS: 192 case CompareIC::OBJECTS:
193 // TODO(kasperl): We really need a type for JS objects here. 193 // TODO(kasperl): We really need a type for JS objects here.
194 return TypeInfo::NonPrimitive(); 194 return TypeInfo::NonPrimitive();
195 case CompareIC::GENERIC: 195 case CompareIC::GENERIC:
196 default: 196 default:
197 return unknown; 197 return unknown;
198 } 198 }
199 } 199 }
200 200
201 201
202 TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr, Side side) { 202 TypeInfo TypeFeedbackOracle::BinaryType(BinaryOperation* expr) {
203 Handle<Object> object = GetElement(map_, expr->position()); 203 Handle<Object> object = GetElement(map_, expr->position());
204 TypeInfo unknown = TypeInfo::Unknown(); 204 TypeInfo unknown = TypeInfo::Unknown();
205 if (!object->IsCode()) return unknown; 205 if (!object->IsCode()) return unknown;
206 Handle<Code> code = Handle<Code>::cast(object); 206 Handle<Code> code = Handle<Code>::cast(object);
207 if (code->is_binary_op_stub()) { 207 if (code->is_binary_op_stub()) {
208 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>( 208 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>(
209 code->binary_op_type()); 209 code->binary_op_type());
210 switch (type) { 210 switch (type) {
211 case BinaryOpIC::UNINIT_OR_SMI: 211 case BinaryOpIC::UNINIT_OR_SMI:
212 return TypeInfo::Smi(); 212 return TypeInfo::Smi();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 source_positions->Add(position); 399 source_positions->Add(position);
400 } 400 }
401 } else { 401 } else {
402 ASSERT(RelocInfo::IsPosition(mode)); 402 ASSERT(RelocInfo::IsPosition(mode));
403 position = static_cast<int>(info->data()); 403 position = static_cast<int>(info->data());
404 } 404 }
405 } 405 }
406 } 406 }
407 407
408 } } // namespace v8::internal 408 } } // namespace v8::internal
OLDNEW
« src/ast.cc ('K') | « src/type-info.h ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698